# HG changeset patch # User Binki # Date 2010-01-12 19:52:27 # Node ID 2c0ae3006fa077699e19a37725a193f91bb8764e # Parent 9a7f470708e217b87175e5201dde0e70830f7d24 consolidate some Makefiles diff --git a/INSTALL b/INSTALL --- a/INSTALL +++ b/INSTALL @@ -2,7 +2,7 @@ Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. +2006, 2007, 2008 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -159,7 +159,7 @@ Particular systems CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + ./configure CC="cc -Ae" and if that doesn't work, install pre-built binaries of GCC for HP-UX. @@ -174,16 +174,6 @@ and if that doesn't work, try ./configure CC="cc -nodtk" - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - Specifying the System Type ========================== @@ -199,8 +189,7 @@ type, such as `sun4', or a canonical nam where SYSTEM can have one of these forms: - OS - KERNEL-OS + OS KERNEL-OS 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 diff --git a/Makefile.am b/Makefile.am --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,12 @@ -SUBDIRS = src etc +SUBDIRS = src ACLOCAL_AMFLAGS = -I m4 + + +# configuration files: +dist_sysconf_DATA = etc/distrenclient.conf \ + etc/distrencommon.conf +nodist_sysconf_DATA = etc/distrendaemon.conf \ + etc/distrenslave.conf +EXTRA_DIST = etc/distrendaemon.conf.in \ + etc/distrenslave.conf.in diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -35,12 +35,6 @@ AC_CHECK_FUNCS([strdup]) AC_CHECK_HEADERS([fcntl.h]) AC_CHECK_HEADERS([malloc.h]) -# TODO: write up --with-list option -AC_CHECK_HEADERS([list.h queue.h stack.h], [], [AC_MSG_ERROR([I need liblist to be installed])]) -AC_CHECK_LIB([list], [list_init], [ - AC_SUBST([LIST_LIBS],[-llist])], [ - AC_MSG_ERROR([I need liblist to be installed]) ]) - AC_FUNC_FORK AC_FUNC_MALLOC @@ -64,21 +58,13 @@ AC_DEFINE([_GNU_SOURCE], [1]) PKG_PROG_PKG_CONFIG(0.17.2) -PKGCONFIG_OHNOWRAP([DISTLIBS], [libconfuse >= 2.5 libcurl libxml-2.0]) +PKGCONFIG_OHNOWRAP([DISTLIBS], [libconfuse >= 2.5 libcurl libxml-2.0 liblist >= 2.2.1]) PKGCONFIG_OHNOWRAP([CHECK], [check >= 0.9.3]) -AC_DEFINE_DIR([SYSCONFDIR], [sysconfdir], [Directory to find configuration files in]) -AC_DEFINE_DIR([LOCALSTATEDIR], [localstatedir], [Directory in which the server or client may store its state files and data]) -AC_DEFINE_DIR([RUNSTATEDIR], [localstatedir/run], [Directory where PID files are stored]) - AC_CONFIG_FILES([Makefile src/Makefile -src/common/Makefile -src/server/Makefile -src/client/Makefile src/tests/Makefile -etc/Makefile etc/distrendaemon.conf etc/distrenslave.conf ]) diff --git a/etc/Makefile.am b/etc/Makefile.am deleted file mode 100644 --- a/etc/Makefile.am +++ /dev/null @@ -1,1 +0,0 @@ -sysconf_DATA = distrenclient.conf distrencommon.conf distrendaemon.conf distrenslave.conf diff --git a/src/Makefile.am b/src/Makefile.am --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,1 +1,70 @@ -SUBDIRS = common server client . tests + +SUBDIRS = . tests + +AM_CPPFLAGS = -DSYSCONFDIR='"$(sysconfdir)"' \ + -DLOCALSTATEDIR='"$(localstatedir)"' \ + -DRUNSTATEDIR='"$(localstatedir)/run"' \ + -I. -I$(top_srcdir)/src/common +AM_CFLAGS = $(DISTLIBS_CFLAGS) +AM_LDFLAGS = $(DISTLIBS_LDFLAGS) +# LIBS, LDFLAGS, Huh!? +LIBS = $(DISTLIBS_LDADD) +LDADD = libdistrencommon.la + +include_HEADERS = client/distren.h + +bin_PROGRAMS = distren +if ENABLE_SERVER +bin_PROGRAMS += distrend distrenslave +endif + +lib_LTLIBRARIES = libdistren.la +pkglib_LTLIBRARIES = libdistrencommon.la + +# libdistrencommon.la: +libdistrencommon_la_SOURCES = common/options.c \ + common/options.h \ + common/execio.h \ + common/execio.c \ + common/remoteio.h \ + common/libremoteio.h \ + common/remoteio.c \ + common/asprintf.h \ + common/asprintf.c +#see http://sources.redhat.com/autobook/autobook/autobook_91.html +# either increase the revision number or the interface number each release! +libdistrencommon_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0 + +# libdistren.la: +libdistren_la_SOURCES = $(include_HEADERS) \ + client/libdistren.h \ + client/libdistren.c \ + client/libdistren_job.c \ + client/libdistren_unbias.c \ + client/libdistren_config.c +libdistren_la_LIBADD = libdistrencommon.la +libdistren_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0 + +# distren: +distren_SOURCES = client/distren.c +distren_LDADD = libdistren.la + +# shared server sources: +SERVER_SOURCES = server/slavefuncs.c \ + server/slavefuncs.h \ + server/distrenjob.c \ + server/distrenjob.h +# distrend: +distrend_SOURCES = $(SERVER_SOURCES) \ + server/distrend.c \ + server/distrend.h \ + server/user_mgr.c \ + server/user_mgr.h \ + server/listen.h \ + server/listen.c +distrend_LDADD = libdistrencommon.la +# distrenslave: +distrenslave_SOURCES = $(SERVER_SOURCES) \ + server/slave.c +distrenslave_LDADD = libdistrencommon.la + diff --git a/src/client/Makefile.am b/src/client/Makefile.am deleted file mode 100644 --- a/src/client/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -bin_PROGRAMS = distren -distren_SOURCES = distren.c -distren_LDADD = @DISTLIBS_LDADD@ libdistren.la -distren_LDFLAGS = @DISTLIBS_LDFLAGS@ -distren_CFLAGS = @DISTLIBS_CFLAGS@ - - -include_HEADERS = distren.h - -#see http://sources.redhat.com/autobook/autobook/autobook_106.html#SEC106 -#libdistren: - -lib_LTLIBRARIES = libdistren.la - -libdistren_la_SOURCES = distren.h libdistren.h libdistren.c libdistren_job.c libdistren_unbias.c libdistren_config.c -#evidently the following should not be LDADD, but LDFLAGS because automake doesn't like the idea of LDADD for libraries for some reason... or I am very confused -libdistren_la_LIBADD = @DISTLIBS_LDADD@ @top_builddir@/src/common/libdistrencommon.la -libdistren_la_CFLAGS = @DISTLIBS_CFLAGS@ -I@top_srcdir@/src/common - -#see http://sources.redhat.com/autobook/autobook/autobook_91.html -# either increase the revision number or the interface number each release! -libdistren_la_LDFLAGS = @DISTLIBS_LDFLAGS@ -version-info 0:0:0 diff --git a/src/client/distren.c b/src/client/distren.c --- a/src/client/distren.c +++ b/src/client/distren.c @@ -29,7 +29,7 @@ */ -#include +#include "distren.h" #include /* sprintf, printf */ #include /* malloc, free */ diff --git a/src/client/libdistren.c b/src/client/libdistren.c --- a/src/client/libdistren.c +++ b/src/client/libdistren.c @@ -21,7 +21,7 @@ Implementation of distren_* functions from distren.h excluding distren_job_* functions. */ -#include +#include "libdistren.h" #include #include diff --git a/src/client/libdistren.h b/src/client/libdistren.h --- a/src/client/libdistren.h +++ b/src/client/libdistren.h @@ -24,7 +24,7 @@ Private definitions for libdistren. */ -#include +#include "distren.h" struct distren { diff --git a/src/client/libdistren_config.c b/src/client/libdistren_config.c --- a/src/client/libdistren_config.c +++ b/src/client/libdistren_config.c @@ -21,7 +21,7 @@ Functions and code for retrieving the client's configuration information. */ -#include +#include "libdistren.h" #include "options.h" /** diff --git a/src/client/libdistren_job.c b/src/client/libdistren_job.c --- a/src/client/libdistren_job.c +++ b/src/client/libdistren_job.c @@ -21,7 +21,7 @@ Implementation of distren_job_* functions from distren.h. */ -#include +#include "libdistren.h" /** @todo Stub diff --git a/src/client/libdistren_unbias.c b/src/client/libdistren_unbias.c --- a/src/client/libdistren_unbias.c +++ b/src/client/libdistren_unbias.c @@ -21,7 +21,7 @@ Implementation of libdistren functions that exist to prevent this library from being biased toward certain methods of reporting errors/debug info or free()ing and malloc()ing */ -#include +#include "libdistren.h" void *_malloc(distren_t distren, size_t size) { diff --git a/src/common/Makefile.am b/src/common/Makefile.am deleted file mode 100644 --- a/src/common/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -pkglib_LTLIBRARIES = libdistrencommon.la - -libdistrencommon_la_SOURCES = options.c options.h execio.h execio.c remoteio.h libremoteio.h remoteio.c asprintf.h asprintf.c -#evidently the following should not be LDADD, but LDFLAGS because automake doesn't like the idea of LDADD for libraries for some reason... or I am very confused -libdistrencommon_la_LIBADD = @DISTLIBS_LDADD@ -libdistrencommon_la_CXXFLAGS = @DISTLIBS_CFLAGS@ - -#see http://sources.redhat.com/autobook/autobook/autobook_91.html -# either increase the revision number or the interface number each release! -libdistrencommon_la_LDFLAGS = @DISTLIBS_LDFLAGS@ -version-info 0:0:0 diff --git a/src/server/Makefile.am b/src/server/Makefile.am deleted file mode 100644 --- a/src/server/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -bin_PROGRAMS = -if ENABLE_SERVER -bin_PROGRAMS += distrend distrenslave -endif - -COMMON_SOURCES = slavefuncs.c slavefuncs.h distrenjob.c distrenjob.h - -distrend_SOURCES = distrend.c distrend.h ${COMMON_SOURCES} user_mgr.c user_mgr.h listen.h listen.c -distrend_LDADD = @top_builddir@/src/common/libdistrencommon.la @DISTLIBS_LDADD@ @LIST_LIBS@ -distrend_LDFLAGS = @DISTLIBS_LDFLAGS@ -distrend_CFLAGS = @DISTLIBS_CFLAGS@ -I@top_srcdir@/src/common - -distrenslave_SOURCES = slave.c ${COMMON_SOURCES} -distrenslave_LDADD = @DISTLIBS_LDADD@ @top_builddir@/src/common/libdistrencommon.la -distrenslave_LDFLAGS = @DISTLIBS_LDFLAGS@ -distrenslave_CFLAGS = @DISTLIBS_CFLAGS@ -I@top_srcdir@/src/common diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -1,9 +1,7 @@ TESTS=check_execio check_asprintf -check_PROGRAMS=check_execio check_asprintf -check_execio_SOURCES = check_execio.c -check_execio_CFLAGS = @CHECK_CFLAGS@ -I$(top_builddir)/src/common -check_execio_LDADD = $(top_builddir)/src/common/libdistrencommon.la @CHECK_LIBS@ -check_asprintf_SOURCES=check_asprintf.c -check_asprintf_CFLAGS=$(check_execio_CFLAGS) -check_asprintf_LDADD=$(check_execio_LDADD) +LIBS = $(CHECK_LIBS) +LDADD = $(top_builddir)/src/libdistrencommon.la + +check_PROGRAMS=$(TESTS) +AM_CFLAGS = $(CHECK_CFLAGS) -I$(top_builddir)/src/common