From 6532debf0bd95509cff9eb8634f57aef20a696b9 Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Sun, 12 Feb 2012 12:12:32 -0800 Subject: [PATCH] Convert build to use automake Signed-off-by: Geoff Levand --- INSTALL | 166 +++++++++++++++++++++++++++++++++++ Makefile.am | 33 +++++++ Makefile.in | 45 ---------- bootstrap | 39 ++++++++- configure.ac | 100 --------------------- configure.ac.in | 194 +++++++++++++++++++++++++++++++++++++++++ discover/Makefile.am | 58 ++++++++++++ lib/Makefile.am | 35 ++++++++ man/Makefile.am | 15 ++++ man/pb-cui.8 | 4 + man/pb-discover.8 | 4 + man/pb-event.8 | 4 + man/petitboot.8 | 4 + rules.mk | 185 --------------------------------------- ui/Makefile.am | 29 ++++++ ui/common/Makefile.am | 63 +++++++++++++ ui/ncurses/Makefile.am | 58 ++++++++++++ ui/test/Makefile.am | 33 +++++++ ui/twin/Makefile.am | 62 +++++++++++++ utils/Makefile.am | 28 ++++++ 20 files changed, 828 insertions(+), 331 deletions(-) create mode 100644 INSTALL create mode 100644 Makefile.am delete mode 100644 Makefile.in mode change 100644 => 100755 bootstrap delete mode 100644 configure.ac create mode 100644 configure.ac.in create mode 100644 discover/Makefile.am create mode 100644 lib/Makefile.am create mode 100644 man/Makefile.am delete mode 100644 rules.mk create mode 100644 ui/Makefile.am create mode 100644 ui/common/Makefile.am create mode 100644 ui/ncurses/Makefile.am create mode 100644 ui/test/Makefile.am create mode 100644 ui/twin/Makefile.am create mode 100644 utils/Makefile.am diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..69d94ab --- /dev/null +++ b/INSTALL @@ -0,0 +1,166 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes a while. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Type `make install' to install the programs and any data files and + documentation. + + 4. You can remove the program binaries and object files from the + source code directory by typing `make clean'. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..a89b0b0 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,33 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +SUBDIRS = lib discover ui utils man + +ACLOCAL_AMFLAGS = -I m4 + +AM_CPPFLAGS = $(DEFAULT_CPPFLAGS) +AM_CFLAGS = $(DEFAULT_CFLAGS) + +LIBTOOL_DEPS = @LIBTOOL_DEPS@ + +libtool: $(LIBTOOL_DEPS) + $(SHELL) ./config.status libtool + +EXTRA_DIST = bootstrap configure.ac.in + +MAINTAINERCLEANFILES = aclocal.m4 config.* configure configure.ac depcomp \ + install-sh ltmain.sh Makefile.in missing $(PACKAGE)-*.gz + +maintainer-clean-local: + rm -rf m4 diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index ad93a29..0000000 --- a/Makefile.in +++ /dev/null @@ -1,45 +0,0 @@ - -# general package info -VERSION = @PACKAGE_VERSION@ -PACKAGE = @PACKAGE_NAME@ - -# toolchain -CC = @CC@ -LDFLAGS = @LDFLAGS@ -CFLAGS = @CFLAGS@ -DEFS = @DEFS@ -CPPFLAGS = @CPPFLAGS@ $(DEFS) - -# dependencies -PBTWIN = @PBTWIN@ -LIBTWIN = @LIBTWIN@ -twin_CFLAGS = @twin_CFLAGS@ -twin_LDFLAGS = @twin_LIBS@ - -# build target -ENABLE_PS3 = @ENABLE_PS3@ -ENABLE_X11 = @ENABLE_X11@ - -# other programs -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -SHELL = @SHELL@ -STRIP = @STRIP@ - -# paths -prefix = @prefix@ -exec_prefix = @exec_prefix@ -sbindir = @sbindir@ -datarootdir = @datarootdir@ -datadir = @datadir@ -pkgdatadir = ${datadir}/${PACKAGE} -localstatedir = @localstatedir@ -builddir = @builddir@ -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -mandir = @mandir@ - -include $(top_srcdir)/rules.mk diff --git a/bootstrap b/bootstrap old mode 100644 new mode 100755 index bf4d77f..6a9f35b --- a/bootstrap +++ b/bootstrap @@ -1,5 +1,42 @@ -#!/bin/sh -ex +#! /bin/bash +# bootstrap -- Use this script to create generated files from a VCS checkout +# + +version= + +if [ "$1" ]; then + version=$1 +elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then + + # If available, use the git commit revision for the package version. + + # Add a date prefix for easy reading. + # date='2010-11-30 16:36:09 -0800' + + date=$(git log --pretty=format:"%ci" -1 HEAD) + date=${date##20} + date=${date%% [0-9][0-9]:*} + date=${date//-/.} + + version=$(printf '%s-%s%s' ${date} g ${head}) + + # Add a '-dirty' postfix for uncommitted changes. + + if git diff-index HEAD | read dummy; then + version=`printf '%s%s' ${version} -dirty` + fi +else + # Default to current date and time. + + version="dev-$(date +%y.%m.%d-%H.%M.%S)" +fi + +set -x + +sed -e s,@version@,${version},g configure.ac.in > configure.ac aclocal +libtoolize --force --copy autoheader +automake --foreign --add-missing --copy autoconf diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 7582071..0000000 --- a/configure.ac +++ /dev/null @@ -1,100 +0,0 @@ -## configure.ac -- Process this file with autoconf to produce configure -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -AC_INIT([petitboot], [0.3], [Geoff Levand ]) - -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([Makefile]) - -default_CFLAGS="--std=gnu99 -O2 -g -Wall -W -Wunused -Wstrict-prototypes \ --Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Winline" - -if test "x$CFLAGS" = "x"; then - CFLAGS="$default_CFLAGS" -fi - -AC_PROG_CC -AC_PROG_INSTALL - -AC_CHECK_HEADERS([stdarg.h]) -AC_CHECK_HEADERS([varargs.h]) -#AC_CHECK_FUNCS([va_copy]) - -dnl Checking for va_copy availability -AC_MSG_CHECKING([for va_copy]) -AC_TRY_LINK([#include -va_list ap1,ap2;], [va_copy(ap1,ap2);], -have_va_copy=yes, -have_va_copy=no) -AC_MSG_RESULT($have_va_copy) -if test x"$have_va_copy" = x"yes"; then - AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) -else - AC_MSG_CHECKING([for __va_copy]) - AC_TRY_LINK([#include - va_list ap1,ap2;], [__va_copy(ap1,ap2);], - have___va_copy=yes, - have___va_copy=no) - AC_MSG_RESULT($have___va_copy) - if test x"$have___va_copy" = x"yes"; then - AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) - fi -fi - -AC_ARG_ENABLE([ps3], - [AS_HELP_STRING([--enable-ps3], - [build support for the PS3 game console])], - [], - [enable_ps3=check]) - -AS_IF([test "x$enable_ps3" != xno], [AC_SUBST([ENABLE_PS3], ["y"])], []) - -AC_ARG_WITH([twin], - [AS_HELP_STRING([--with-twin], - [build GUI versions using the twin window system])], - [], - [with_twin=check]) - -PBTWIN= -LIBTWIN= -AS_IF([test "x$with_twin" != xno], - [PKG_CHECK_MODULES([twin], [libtwin], [], - [AC_MSG_RESULT([$twin_PKG_ERRORS]) - AC_MSG_RESULT([Consider adjusting PKG_CONFIG_PATH environment variable])]) - AC_CHECK_LIB([twin], [main], - [AC_SUBST([LIBTWIN], ["-ltwin"]) - AC_SUBST([PBTWIN], ["y"]) - AC_DEFINE([HAVE_LIBTWIN], [1], [Define if you have libtwin])], - [if test "x$with_twin" != xcheck; then - AC_MSG_FAILURE([--with-twin was given, but test for twin failed]) - fi], - [${twin_LIBS}]) - AC_CHECK_HEADERS([libtwin/twin_x11.h]) - AC_CHECK_HEADERS([libtwin/twin_fbdev.h])]) - -AC_ARG_ENABLE([x11], - [AS_HELP_STRING([--enable-x11], - [build for x11])], - [], - [enable_x11=check]) - -AS_IF([test "x$enable_x11" != xno], [AC_SUBST([ENABLE_X11], ["y"])], []) - - -mkdir -p discover lib/list lib/log lib/pb-protocol lib/system lib/talloc \ - lib/waiter test ui/common ui/ncurses ui/test ui/twin utils - -AC_OUTPUT diff --git a/configure.ac.in b/configure.ac.in new file mode 100644 index 0000000..28e96d3 --- /dev/null +++ b/configure.ac.in @@ -0,0 +1,194 @@ +## configure.ac -- Process this file with autoconf to produce configure +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +AC_INIT([petitboot], [@version@], [Geoff Levand ]) + +AC_CONFIG_MACRO_DIR([m4]) + +AC_PREFIX_DEFAULT([/usr/local]) + +AS_IF([test "x$CFLAGS" = "x"], [AC_SUBST([CFLAGS], [""])]) + +AC_PROG_CC +AC_PROG_INSTALL + +AM_INIT_AUTOMAKE +LT_INIT + +AC_CHECK_HEADERS([stdarg.h]) +AC_CHECK_HEADERS([varargs.h]) + +dnl Checking for va_copy availability +AC_MSG_CHECKING([for va_copy]) +AC_TRY_LINK([#include +va_list ap1,ap2;], [va_copy(ap1,ap2);], +have_va_copy=yes, +have_va_copy=no) +AC_MSG_RESULT($have_va_copy) +if test x"$have_va_copy" = x"yes"; then + AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) +else + AC_MSG_CHECKING([for __va_copy]) + AC_TRY_LINK([#include + va_list ap1,ap2;], [__va_copy(ap1,ap2);], + have___va_copy=yes, + have___va_copy=no) + AC_MSG_RESULT($have___va_copy) + if test x"$have___va_copy" = x"yes"; then + AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) + fi +fi + +AC_ARG_WITH( + [ncurses], + [AS_HELP_STRING([--with-ncurses], + [build text console UI programs using ncurses [default=yes]] + )], + [], + [with_ncurses=yes] +) +AM_CONDITIONAL([WITH_NCURSES], [test "x$with_ncurses" = "xyes"]) + +AC_ARG_WITH( + [twin-x11], + [AS_HELP_STRING([--with-twin-x11], + [build x11 GUI programs using the twin window system [default=yes]] + )], + [], + [with_twin_x11=yes] +) +AM_CONDITIONAL([WITH_TWIN_X11], [test "x$with_twin_x11" = "xyes"]) + +AC_ARG_WITH( + [twin-fbdev], + [AS_HELP_STRING( + [--with-twin-fbdev], + [build frame buffer GUI programs using the twin window system [default=no]] + )], + [], + [with_twin_fbdev=yes] +) +AM_CONDITIONAL([WITH_TWIN_FBDEV], [test "x$with_twin_fbdev" = "xyes"]) + +AM_CONDITIONAL( + [WITH_TWIN], + [test "x$with_twin_x11" = "xyes" || test "x$with_twin_fbdev" = "xyes"]) + +AS_IF( + [test "x$with_twin_x11" = "xyes" || test "x$with_twin_fbdev" = "xyes"], + [PKG_CHECK_MODULES( + [twin], + [libtwin], + [SAVE_LIBS="$LIBS" LIBS="$LIBS $twin_LIBS" + AC_CHECK_LIB( + [twin], + [twin_feature_init], + [], + [AC_MSG_FAILURE([--with-twin was given, but test for twin failed])] + ) + LIBS="$SAVE_LIBS" + ], + [AC_MSG_RESULT([$twin_PKG_ERRORS]) + AC_MSG_FAILURE([ Consider adjusting PKG_CONFIG_PATH environment variable]) + ] + )] +) + +AS_IF( + [test "x$with_twin_x11" = "xyes"], + [SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $twin_CFLAGS" + AC_CHECK_HEADERS( + [libtwin/twin_x11.h], + [], + [AC_MSG_FAILURE([ --with-twin-x11 given but libtwin/twin_x11.h not found])] + ) + CPPFLAGS="$SAVE_CPPFLAGS" + ] +) + +AS_IF( + [test "x$with_twin_fbdev" = "xyes"], + [SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $twin_CFLAGS" + AC_CHECK_HEADERS( + [libtwin/twin_fbdev.h], + [], + [AC_MSG_FAILURE([ --with-twin-fbdev given but libtwin/twin_fbdev.h not found])] + ) + CPPFLAGS="$SAVE_CPPFLAGS" + ] +) + +AC_ARG_ENABLE( + [busybox], + [AS_HELP_STRING( + [--enable-busybox], + [build programs with extra support for busybox [default=no]]) + ], + [], + [enable_busybox=no] +) +#AM_CONDITIONAL([ENABLE_BUSYBOX], [test "x$enable_busybox" = "xyes"]) + +AC_ARG_ENABLE( + [ps3], + [AS_HELP_STRING( + [--enable-ps3], + [build additional programs for the PS3 game console [default=no]] + )], + [], + [enable_ps3=no] +) +AM_CONDITIONAL([ENABLE_PS3], [test "x$enable_ps3" = "xyes"]) + +AC_ARG_ENABLE( + [debug], + [AS_HELP_STRING([--enable-debug], + [build programs with extra debug info [default=no]] + )], + [], + [enable_debug=check] +) +#AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = "xyes"]) + +default_cflags="--std=gnu99 -g \ + -Wall -W -Wunused -Wstrict-prototypes -Wmissing-prototypes \ + -Wmissing-declarations -Wredundant-decls -Winline" + +AS_IF( + [test "x$enable_debug" = "xyes"], + [AC_SUBST([DEFAULT_CFLAGS], ["$default_cflags -O0 -DDEBUG"])], + [AC_SUBST([DEFAULT_CFLAGS], ["$default_cflags -O2 -DNDEBUG"])] +) + + +AC_SUBST([LIBTOOL_DEPS]) +AC_SUBST([DESTDIR]) + +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([ + Makefile + discover/Makefile + lib/Makefile + man/Makefile + ui/Makefile + ui/common/Makefile + ui/ncurses/Makefile + ui/test/Makefile + ui/twin/Makefile + utils/Makefile +]) + +AC_OUTPUT diff --git a/discover/Makefile.am b/discover/Makefile.am new file mode 100644 index 0000000..6ace400 --- /dev/null +++ b/discover/Makefile.am @@ -0,0 +1,58 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +AM_CPPFLAGS = -I$(top_srcdir)/lib $(DEFAULT_CPPFLAGS) + +AM_CFLAGS = $(DEFAULT_CFLAGS) \ + -DPREFIX='"$(prefix)"' \ + -DPKG_SHARE_DIR='"$(pkgdatadir)"' \ + -DLOCAL_STATE_DIR='"$(localstatedir)"' + +noinst_LTLIBRARIES = libparser.la + +libparser_la_SOURCES = \ + parser.c \ + parser.h \ + parser-conf.c \ + parser-conf.h \ + parser-utils.c \ + parser-utils.h \ + paths.c \ + paths.h + +bin_PROGRAMS = pb-discover + +pb_discover_SOURCES = \ + device-handler.c \ + device-handler.h \ + discover-server.c \ + discover-server.h \ + event.c \ + event.h \ + event-parser.c \ + kboot-parser.c \ + message.h \ + params.c \ + params.h \ + pb-discover.c \ + pb-discover.h \ + udev.c \ + udev.h \ + user-event.c \ + user-event.h \ + yaboot-parser.c +pb_discover_LDADD = libparser.la $(top_builddir)/lib/libpbcore.la + +EXTRA_DIST = native-parser.c +MAINTAINERCLEANFILES = Makefile.in diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 0000000..7b3d50d --- /dev/null +++ b/lib/Makefile.am @@ -0,0 +1,35 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +AM_CPPFLAGS = -I$(top_srcdir)/lib $(DEFAULT_CPPFLAGS) + +AM_CFLAGS = $(DEFAULT_CFLAGS) + +noinst_LTLIBRARIES = libpbcore.la + +libpbcore_la_SOURCES = \ + log/log.h \ + log/log.c \ + list/list.c \ + list/list.h \ + waiter/waiter.c \ + waiter/waiter.h \ + pb-protocol/pb-protocol.c \ + pb-protocol/pb-protocol.h \ + talloc/talloc.c \ + talloc/talloc.h \ + system/system.c \ + system/system.h + +MAINTAINERCLEANFILES = Makefile.in diff --git a/man/Makefile.am b/man/Makefile.am new file mode 100644 index 0000000..ef17dd5 --- /dev/null +++ b/man/Makefile.am @@ -0,0 +1,15 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +man_MANS = pb-cui.8 pb-discover.8 pb-event.8 petitboot.8 \ No newline at end of file diff --git a/man/pb-cui.8 b/man/pb-cui.8 index e671c20..fbe9b13 100644 --- a/man/pb-cui.8 +++ b/man/pb-cui.8 @@ -65,3 +65,7 @@ Display the program version number. .Sh SEE ALSO .\" ======== .Xr petitboot 8 , Xr pb-discover 8 , Xr pb-event 8 +.\" +.Sh REPORTING BUGS +.\" ============== +Send bug reports to Geoff Levand diff --git a/man/pb-discover.8 b/man/pb-discover.8 index 9123e0f..a9b6633 100644 --- a/man/pb-discover.8 +++ b/man/pb-discover.8 @@ -42,3 +42,7 @@ pb-discover daemon and receive boot option information. .Sh SEE ALSO .\" ======== .Xr petitboot 8 , Xr pb-cui 8 , Xr pb-event 8 +.\" +.Sh REPORTING BUGS +.\" ============== +Send bug reports to Geoff Levand diff --git a/man/pb-event.8 b/man/pb-event.8 index dc123e1..d198b22 100644 --- a/man/pb-event.8 +++ b/man/pb-event.8 @@ -41,3 +41,7 @@ petitboot device discovery daemon. .Sh SEE ALSO .\" ======== .Xr petitboot 8 , Xr pb-cui 8 , Xr pb-discover 8 +.\" +.Sh REPORTING BUGS +.\" ============== +Send bug reports to Geoff Levand diff --git a/man/petitboot.8 b/man/petitboot.8 index 9dc2222..653ee9d 100644 --- a/man/petitboot.8 +++ b/man/petitboot.8 @@ -45,3 +45,7 @@ from a DHCP server. .Sh SEE ALSO .\" ======== .Xr pb-cui 8 , Xr pb-discover 8 , Xr pb-event 8 +.\" +.Sh REPORTING BUGS +.\" ============== +Send bug reports to Geoff Levand diff --git a/rules.mk b/rules.mk deleted file mode 100644 index a665aa2..0000000 --- a/rules.mk +++ /dev/null @@ -1,185 +0,0 @@ - -VPATH = $(srcdir) - -CPPFLAGS += -I$(top_srcdir) -I$(top_srcdir)/lib -I$(builddir) -LDFLAGS += $(CFLAGS) - -# we need paths to be overridable at build-time -DEFS += '-DPREFIX="$(prefix)"' '-DPKG_SHARE_DIR="$(pkgdatadir)"' \ - '-DLOCAL_STATE_DIR="$(localstatedir)"' - -# programs -pb_discover = discover/pb-discover -pb_cui = ui/ncurses/pb-cui -pb_test = ui/test/pb-test -pb_twin = ui/twin/pb-twin -pb_event = utils/pb-event -parser_test = test/parser-test - -# install targets and components -daemons = $(pb_discover) -parsers = event kboot yaboot -uis = $(pb_cui) -tests = $(parser_test) $(pb_test) -utils = $(pb_event) - -ifeq ($(PBTWIN),y) - uis += $(pb_twin) -endif - -# other to install -artwork = background.jpg cdrom.png hdd.png usbpen.png tux.png cursor.gz -man8 = pb-cui.8 pb-discover.8 pb-event.8 petitboot.8 -rules = utils/99-petitboot.rules -udhcpc = utils/udhcpc - -# client/daemon lib objs -list_objs = lib/list/list.o -log_objs = lib/log/log.o -protocol_objs = lib/pb-protocol/pb-protocol.o -system_objs = lib/system/system.o -talloc_objs = lib/talloc/talloc.o -waiter_objs = lib/waiter/waiter.o - -# daemon objs -parser_objs = discover/parser.o discover/parser-conf.o discover/paths.o \ - $(foreach p, $(parsers), discover/$(p)-parser.o) -discover_objs = discover/event.o discover/user-event.o discover/udev.o \ - discover/discover-server.o discover/device-handler.o discover/paths.o \ - discover/parser-utils.o - -# client objs -ui_common_objs = ui/common/discover-client.o ui/common/joystick.o \ - ui/common/loader.o ui/common/ui-system.o ui/common/timer.o \ - ui/common/url.o -ncurses_objs = ui/ncurses/nc-scr.o ui/ncurses/nc-menu.o ui/ncurses/nc-ked.o \ - ui/ncurses/nc-cui.o -twin_objs = ui/twin/pb-twin.o - -# Makefiles -makefiles = Makefile $(top_srcdir)/rules.mk - -# headers -discover_headers = $(wildcard $(top_srcdir)/discover/*.h) -lib_headers = $(wildcard $(top_srcdir)/lib/*/*.h) -ui_headers = $(wildcard $(top_srcdir)/ui/*/*.h) - -# object collections -lib_objs = $(list_objs) $(log_objs) $(protocol_objs) $(system_objs) \ - $(talloc_objs) $(waiter_objs) - -daemon_objs = $(lib_objs) $(parser_objs) $(discover_objs) -daemon_headers = $(lib_headers) $(discover_headers) - -client_objs = $(lib_objs) $(ui_common_objs) -client_headers = $(lib_headers) $(discover_headers) $(ui_headers) - -all: $(uis) $(daemons) $(utils) - -# ncurses cui -pb_cui_objs-y$(ENABLE_PS3) += ui/ncurses/pb-cui.o -pb_cui_objs-$(ENABLE_PS3) += ui/ncurses/ps3-cui.o ui/common/ps3.o -pb_cui_ldflags-$(ENABLE_PS3) += -lps3-utils - -pb_cui_objs = $(client_objs) $(ncurses_objs) $(pb_cui_objs-y) -$(pb_cui_objs): $(makefiles) $(client_headers) -$(pb_cui): LDFLAGS += $(pb_cui_ldflags-y) -lmenu -lform -lncurses - -$(pb_cui): $(pb_cui_objs) - $(LINK.o) -o $@ $^ - -# test ui -pb_test_objs = $(client_objs) ui/test/pb-test.o -$(pb_test_objs): $(makefiles) $(client_headers) - -$(pb_test): $(pb_test_objs) - $(LINK.o) -o $@ $^ - -# twin gui -pb_twin_objs = $(client_objs) $(twin_objs) ui/twin/ps3-twin.o -$(pb_twin_objs): $(makefiles) $(client_headers) - -$(pb_twin): LDFLAGS+=$(twin_LDFLAGS) $(LIBTWIN) -$(pb_twin): CFLAGS+=$(twin_CFLAGS) - -$(pb_twin): $(pb_twin_objs) - $(LINK.o) -o $@ $^ - -# discovery daemon -pb_discover_objs = $(daemon_objs) discover/pb-discover.o -$(pb_discover_objs): $(makefiles) $(daemon_headers) - -$(pb_discover): $(pb_discover_objs) - $(LINK.o) -o $@ $^ - -# utils -pb_event_objs = utils/pb-event.o -$(pb_event_objs): $(makefiles) $(client_headers) - -$(pb_event): $(pb_event_objs) - $(LINK.o) -o $@ $^ - -# parser-test -parser_test_objs = $(lib_objs) $(parser_objs) test/parser-test.o -$(parser_test_objs): $(makefiles) $(client_headers) - -$(parser_test): $(parser_test_objs) - $(LINK.o) -o $@ $^ - -parser-test: $(parser_test) - -install: all $(rules) $(udhcpc) - $(INSTALL) -d $(DESTDIR)$(sbindir)/ - $(INSTALL_PROGRAM) $(daemons) $(uis) $(utils) $(DESTDIR)$(sbindir)/ - $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/artwork/ - $(INSTALL_DATA) $(addprefix $(top_srcdir)/ui/common/artwork/,$(artwork)) \ - $(DESTDIR)$(pkgdatadir)/artwork/ - $(INSTALL) -d $(DESTDIR)$(pkgdatadir)/utils - $(INSTALL_DATA) $(top_srcdir)/$(rules) $(DESTDIR)$(pkgdatadir)/utils - $(INSTALL_DATA) $(top_srcdir)/$(udhcpc) $(DESTDIR)$(pkgdatadir)/utils - $(INSTALL) -d $(DESTDIR)$(mandir)/man8/ - $(INSTALL_DATA) $(addprefix $(top_srcdir)/man/, $(man8)) \ - $(DESTDIR)$(mandir)/man8/ - -dist: $(PACKAGE)-$(VERSION).tar.gz - -check: parser-test - $(SHELL) test/parser-test.sh - -distcheck: dist - tar -xvf $(PACKAGE)-$(VERSION).tar.gz - cd $(PACKAGE)-$(VERSION) && make check - -$(PACKAGE)-$(VERSION).tar.gz: $(PACKAGE)-$(VERSION) - tar czvf $@ $^ - -$(PACKAGE)-$(VERSION): clean - for f in $$(git --git-dir=$(top_srcdir)/.git ls-files); do \ - d=$@/$$(dirname $$f); \ - mkdir -p $$d; \ - cp -a $(top_srcdir)/$$f $$d; \ - done - -clean: - rm -rf $(PACKAGE)-$(VERSION) - rm -f $(uis) - rm -f $(pb_cui_objs) - rm -f $(pb_test_objs) - rm -f $(pb_twin_objs) - rm -f $(daemons) - rm -f $(pb_discover_objs) - rm -f $(utils) - rm -f $(pb_event_objs) - rm -f $(tests) - rm -f $(parser_test_objs) - -maintainer-clean: clean - -rm -f $(top_srcdir)/aclocal.m4 - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f $(top_srcdir)/config.h.in - -rm -f $(top_srcdir)/configure - -rm -f config.h - -rm -f config.log - -rm -f config.status - -rm -f Makefile - -rm -f $(PACKAGE)-$(VERSION).tar.gz diff --git a/ui/Makefile.am b/ui/Makefile.am new file mode 100644 index 0000000..8c5d98c --- /dev/null +++ b/ui/Makefile.am @@ -0,0 +1,29 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +if WITH_NCURSES + EXTRA_1 = ncurses +endif + +if WITH_TWIN_X11 + EXTRA_2 = twin +endif + +if WITH_TWIN_FBDEV + EXTRA_2 = twin +endif + +SUBDIRS = common test $(EXTRA_1) $(EXTRA_2) + +MAINTAINERCLEANFILES = Makefile.in diff --git a/ui/common/Makefile.am b/ui/common/Makefile.am new file mode 100644 index 0000000..9955c18 --- /dev/null +++ b/ui/common/Makefile.am @@ -0,0 +1,63 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +AM_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lib \ + -I$(includedir) \ + $(DEFAULT_CPPFLAGS) + +AM_CFLAGS = \ + $(DEFAULT_CFLAGS) + +noinst_LTLIBRARIES = libpbui.la + +libpbui_la_SOURCES = \ + discover-client.c \ + discover-client.h \ + joystick.c \ + joystick.h \ + loader.c \ + loader.h \ + timer.c \ + timer.h \ + ui-system.c \ + ui-system.h \ + url.c \ + url.h + +if ENABLE_PS3 +libpbui_la_SOURCES += \ + ps3.c \ + ps3.h +endif + +artwork = + +if WITH_TWIN +artwork += \ + artwork/background.jpg \ + artwork/cdrom.png \ + artwork/cursor.gz \ + artwork/hdd.png \ + artwork/network.png \ + artwork/system.png \ + artwork/tux.png \ + artwork/usbpen.png +endif + +artworkdir = $(pkgdatadir)/artwork/ +dist_artwork_DATA = $(artwork) + +MAINTAINERCLEANFILES = Makefile.in diff --git a/ui/ncurses/Makefile.am b/ui/ncurses/Makefile.am new file mode 100644 index 0000000..164d408 --- /dev/null +++ b/ui/ncurses/Makefile.am @@ -0,0 +1,58 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +AM_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lib \ + -I$(includedir) \ + $(DEFAULT_CPPFLAGS) + +AM_CFLAGS = \ + $(DEFAULT_CFLAGS) + +AM_LDFLAGS = -lmenu -lform -lncurses + +common_libs = \ + libpbnc.la \ + $(top_builddir)/ui/common/libpbui.la \ + $(top_builddir)/lib/libpbcore.la + +noinst_LTLIBRARIES = libpbnc.la + +libpbnc_la_SOURCES = \ + nc-cui.c \ + nc-cui.h \ + nc-ked.c \ + nc-ked.h \ + nc-menu.c \ + nc-menu.h \ + nc-scr.c \ + nc-scr.h + +bin_PROGRAMS = pb-nc-generic + +if ENABLE_PS3 +bin_PROGRAMS += pb-nc-ps3 +endif + + +pb_nc_generic_SOURCES = generic-main.c +pb_nc_generic_LDADD = $(common_libs) + +pb_nc_ps3_SOURCES = ps3-main.c +pb_nc_ps3_LDADD = $(common_libs) $(libdir)/libps3-utils.so +#pb_nc_ps3_LDFLAGS = -L$(libdir) -lps3-utils + + +MAINTAINERCLEANFILES = Makefile.in diff --git a/ui/test/Makefile.am b/ui/test/Makefile.am new file mode 100644 index 0000000..1daf78e --- /dev/null +++ b/ui/test/Makefile.am @@ -0,0 +1,33 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +AM_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lib \ + -I$(includedir) \ + $(DEFAULT_CPPFLAGS) + +AM_CFLAGS = \ + $(DEFAULT_CFLAGS) + +common_libs = \ + $(top_builddir)/ui/common/libpbui.la \ + $(top_builddir)/lib/libpbcore.la + +noinst_PROGRAMS = discover-test + +discover_test_SOURCES = discover-test.c +discover_test_LDADD = $(common_libs) + +MAINTAINERCLEANFILES = Makefile.in diff --git a/ui/twin/Makefile.am b/ui/twin/Makefile.am new file mode 100644 index 0000000..310f1a5 --- /dev/null +++ b/ui/twin/Makefile.am @@ -0,0 +1,62 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +AM_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lib \ + -I$(includedir) \ + $(DEFAULT_CPPFLAGS) \ + $(twin_CFLAGS) + +AM_CFLAGS = \ + -DPB_ARTWORK_PATH='"$(pkgdatadir)/artwork/"' \ + $(DEFAULT_CFLAGS) \ + $(twin_CFLAGS) + +AM_LDFLAGS = \ + $(twin_LIBS) + +common_libs = \ + libpbt.la \ + $(top_builddir)/ui/common/libpbui.la \ + $(top_builddir)/lib/libpbcore.la + +noinst_LTLIBRARIES = libpbt.la + +libpbt_la_SOURCES = \ + pbt-client.c \ + pbt-client.h \ + pbt-main.c \ + pbt-main.h \ + pbt-menu.c \ + pbt-menu.h \ + pbt-scr.c \ + pbt-scr.h + +bin_PROGRAMS = pb-twin-generic + +if ENABLE_PS3 +bin_PROGRAMS += pb-twin-ps3 +endif + + +pb_twin_generic_SOURCES = main-generic.c +pb_twin_generic_LDADD = $(common_libs) + +pb_twin_ps3_SOURCES = main-ps3.c +pb_twin_ps3_LDADD = $(common_libs) +pb_twin_ps3_LDFLAGS = -lps3-utils + + +MAINTAINERCLEANFILES = Makefile.in diff --git a/utils/Makefile.am b/utils/Makefile.am new file mode 100644 index 0000000..432bc48 --- /dev/null +++ b/utils/Makefile.am @@ -0,0 +1,28 @@ +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +AM_CPPFLAGS = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/lib \ + -I$(includedir) \ + $(DEFAULT_CPPFLAGS) + +AM_CFLAGS = \ + $(DEFAULT_CFLAGS) + +bin_PROGRAMS = pb-event + +pb_event_SOURCES = pb-event.c + +MAINTAINERCLEANFILES = Makefile.in -- 2.39.2