diff --git a/Makefile.am b/Makefile.am --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,70 @@ -SUBDIRS = src +ACLOCAL_AMFLAGS = -I m4 + + +AM_CPPFLAGS = -DSYSCONFDIR='"$(sysconfdir)"' \ + -DLOCALSTATEDIR='"$(localstatedir)"' \ + -I$(top_srcdir)/src +AM_CFLAGS = $(DISTLIBS_CFLAGS) +LIBS = $(DISTLIBS_LDADD) $(DISTLIBS_LDFLAGS) +LDADD = libdistrencommon.la + +include_HEADERS = src/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 = src/common/options.c \ + src/common/options.h \ + src/common/execio.h \ + src/common/execio.c \ + src/common/remoteio.h \ + src/common/libremoteio.h \ + src/common/remoteio.c \ + src/common/asprintf.h \ + src/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 -ACLOCAL_AMFLAGS = -I m4 +# libdistren.la: +libdistren_la_SOURCES = $(include_HEADERS) \ + src/client/libdistren.h \ + src/client/libdistren.c \ + src/client/libdistren_job.c \ + src/client/libdistren_unbias.c \ + src/client/libdistren_config.c +libdistren_la_LIBADD = libdistrencommon.la +libdistren_la_LDFLAGS = $(AM_LDFLAGS) -version-info 0:0:0 + +# distren: +distren_SOURCES = src/client/distren.c +distren_LDADD = libdistren.la + +# shared server sources: +SERVER_SOURCES = src/server/slavefuncs.c \ + src/server/slavefuncs.h \ + src/server/distrenjob.c \ + src/server/distrenjob.h +# distrend: +distrend_SOURCES = $(SERVER_SOURCES) \ + src/server/distrend.c \ + src/server/distrend.h \ + src/server/user_mgr.c \ + src/server/user_mgr.h \ + src/server/listen.h \ + src/server/listen.c +distrend_LDADD = libdistrencommon.la +# distrenslave: +distrenslave_SOURCES = $(SERVER_SOURCES) \ + src/server/slave.c +distrenslave_LDADD = libdistrencommon.la + # configuration files: @@ -10,3 +74,16 @@ nodist_sysconf_DATA = etc/distrendaemon. etc/distrenslave.conf EXTRA_DIST = etc/distrendaemon.conf.in \ etc/distrenslave.conf.in + + +# tests +TESTS=test/check_execio test/check_asprintf +check_PROGRAMS=$(TESTS) + +#check_execio_LIBS = $(CHECK_LIBS) +#check_asprintf_LIBS = $(CHECK_LIBS) +test_check_execio_LDADD = $(CHECK_LIBS) src/libdistrencommon.la +test_check_asprintf_LDADD = $(CHECK_LIBS) src/libdistrencommon.la +test_check_execio_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS) +test_check_asprintf_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS) + diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ AC_PROG_CC AC_PROG_LIBTOOL #AC_PROG_RANLIB #don't add this even if autoscan says to, because AC_PROG_LIBTOOL is enough -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([gnu dist-bzip2 subdir-objects -Wall]) AM_PROG_CC_C_O #basic low-level checks (suggested by autoscan) @@ -68,8 +68,6 @@ AC_DEFINE_DIR([LOCALSTATEDIR], [localsta AC_DEFINE_DIR([RUNSTATEDIR], [localstatedir/run], [Default directory for registering runtime information like pid-files]) AC_CONFIG_FILES([Makefile -src/Makefile -src/tests/Makefile etc/distrendaemon.conf etc/distrenslave.conf ]) diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 --- a/src/Makefile.am +++ /dev/null @@ -1,69 +0,0 @@ - -SUBDIRS = . tests - -AM_CPPFLAGS = -DSYSCONFDIR='"$(sysconfdir)"' \ - -DLOCALSTATEDIR='"$(localstatedir)"' \ - -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/libdistren_config.c b/src/client/libdistren_config.c --- a/src/client/libdistren_config.c +++ b/src/client/libdistren_config.c @@ -21,8 +21,8 @@ Functions and code for retrieving the client's configuration information. */ -#include "libdistren.h" -#include "options.h" +#include "client/libdistren.h" +#include "common/options.h" /** @todo Stub diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -20,14 +20,15 @@ /* This file contains the code which both processes (renders) jobs as a slave, and the code which distributes frames to slaves after receiving them from the client portion of the codebase. */ -#include "asprintf.h" #include "distrenjob.h" -#include "execio.h" #include "listen.h" -#include "options.h" -#include "protocol.h" #include "slavefuncs.h" +#include "common/asprintf.h" +#include "common/execio.h" +#include "common/options.h" +#include "common/protocol.h" + #include #include #include diff --git a/src/server/distrenjob.c b/src/server/distrenjob.c --- a/src/server/distrenjob.c +++ b/src/server/distrenjob.c @@ -17,10 +17,11 @@ along with DistRen. If not, see . */ -#include "asprintf.h" #include "distrenjob.h" #include "slavefuncs.h" +#include "common/asprintf.h" + #include #include #include diff --git a/src/server/slave.c b/src/server/slave.c --- a/src/server/slave.c +++ b/src/server/slave.c @@ -18,12 +18,13 @@ */ -#include "asprintf.h" -#include "protocol.h" -#include "options.h" -#include "remoteio.h" #include "slavefuncs.h" +#include "common/asprintf.h" +#include "common/options.h" +#include "common/protocol.h" +#include "common/remoteio.h" + #include #include #include diff --git a/src/server/slavefuncs.c b/src/server/slavefuncs.c --- a/src/server/slavefuncs.c +++ b/src/server/slavefuncs.c @@ -17,13 +17,14 @@ along with DistRen. If not, see . */ -#include "asprintf.h" #include "distrenjob.h" -#include "execio.h" -#include "protocol.h" -#include "remoteio.h" #include "slavefuncs.h" +#include "common/asprintf.h" +#include "common/execio.h" +#include "common/protocol.h" +#include "common/remoteio.h" + #include #include #include diff --git a/src/server/slavefuncs.h b/src/server/slavefuncs.h --- a/src/server/slavefuncs.h +++ b/src/server/slavefuncs.h @@ -21,7 +21,8 @@ #define _DISTREN_SLAVEFUNCS_H #include "distrenjob.h" -#include "remoteio.h" + +#include "common/remoteio.h" #include #include diff --git a/src/server/user_mgr.c b/src/server/user_mgr.c --- a/src/server/user_mgr.c +++ b/src/server/user_mgr.c @@ -17,9 +17,18 @@ along with DistRen. If not, see . */ -#include "asprintf.h" #include "user_mgr.h" +#include "common/asprintf.h" + + +#include +#include +#include +#include +#include +#include + #include #include #include @@ -27,13 +36,6 @@ #include #include -#include -#include -#include -#include -#include -#include - struct user_mgr_info { struct user *user_array; diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am deleted file mode 100644 --- a/src/tests/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -TESTS=check_execio check_asprintf - -LIBS = $(CHECK_LIBS) -LDADD = $(top_builddir)/src/libdistrencommon.la - -check_PROGRAMS=$(TESTS) -AM_CFLAGS = $(CHECK_CFLAGS) -I$(top_builddir)/src/common diff --git a/src/tests/check_asprintf.c b/test/check_asprintf.c rename from src/tests/check_asprintf.c rename to test/check_asprintf.c --- a/src/tests/check_asprintf.c +++ b/test/check_asprintf.c @@ -17,12 +17,12 @@ along with DistRen. If not, see . */ -#include "asprintf.h" +#include "common/asprintf.h" #include #include -START_TEST (asprintf) +START_TEST (check_asprintf) { /* tere _must_ be a better way to test this... */ char *teststring = "abcdefghijklmnopqrstuvwxyz"; diff --git a/src/tests/check_execio.c b/test/check_execio.c rename from src/tests/check_execio.c rename to test/check_execio.c --- a/src/tests/check_execio.c +++ b/test/check_execio.c @@ -17,11 +17,11 @@ along with DistRen. If not, see . */ -#include "execio.h" +#include "common/execio.h" #include -START_TEST (execio) +START_TEST (check_execio) { struct execio *eio; char *echoargv[] =