Changeset - 2c0ae3006fa0
[Not reviewed]
default
4 11 0
Nathan Brink (binki) - 16 years ago 2010-01-12 19:52:27
ohnobinki@ohnopublishing.net
consolidate some Makefiles
15 files changed with 95 insertions and 93 deletions:
0 comments (0 inline, 0 general)
INSTALL
Show inline comments
 
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.
 

	
 
Basic Installation
 
==================
 

	
 
   Briefly, the shell commands `./configure; make; make install' should
 
configure, build, and install this package.  The following
 
more-detailed instructions are generic; see the `README' file for
 
instructions specific to this package.
 

	
 
@@ -150,66 +150,55 @@ 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.
 

	
 
Particular systems
 
==================
 

	
 
   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
 
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.
 

	
 
   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
 
parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
 
a workaround.  If GNU CC is not installed, it is therefore recommended
 
to try
 

	
 
     ./configure CC="cc"
 

	
 
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
 
==========================
 

	
 
   There may be some features `configure' cannot figure out
 
automatically, but needs to determine by the type of machine the package
 
will run on.  Usually, assuming the package is built to be run on the
 
_same_ architectures, `configure' can figure that out, but if it prints
 
a message saying it cannot guess the machine type, give it the
 
`--build=TYPE' option.  TYPE can either be a short name for the system
 
type, such as `sun4', or a canonical name which has the form:
 

	
 
     CPU-COMPANY-SYSTEM
 

	
 
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
 
need to know the machine type.
 

	
 
   If you are _building_ compiler tools for cross-compiling, you should
 
use the option `--target=TYPE' to select the type of system they will
 
produce code for.
 

	
 
   If you want to _use_ a cross compiler, that generates code for a
 
platform different from the build platform, you should specify the
 
"host" platform (i.e., that on which the generated programs will
Makefile.am
Show inline comments
 
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
configure.ac
Show inline comments
 
@@ -26,61 +26,47 @@ AC_PROG_LIBTOOL
 

	
 
AM_INIT_AUTOMAKE
 
AM_PROG_CC_C_O
 

	
 
#basic low-level checks (suggested by autoscan)
 
AC_CHECK_FUNCS([dup2])
 
AC_CHECK_FUNCS([memset])
 
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
 

	
 
AC_TYPE_PID_T
 
AC_TYPE_SIZE_T
 

	
 
# selective compilation
 
AC_ARG_ENABLE([server],
 
	[AS_HELP_STRING([--disable-server],[Don't build the distren server])],
 
	[enable_server=$enableval],
 
	[enable_server=yes])
 
AM_CONDITIONAL([ENABLE_SERVER],
 
	[test "x$enable_server" = "xyes"])
 

	
 
# to grab GNU-specific function prototypes for the following functions:
 
# getline
 
AC_DEFINE([_GNU_SOURCE], [1])
 

	
 
#package dependencies:
 

	
 
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
 
])
 

	
 
AC_OUTPUT
etc/Makefile.am
Show inline comments
 
deleted file
src/Makefile.am
Show inline comments
 
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
 

	
src/client/Makefile.am
Show inline comments
 
deleted file
src/client/distren.c
Show inline comments
 
@@ -20,25 +20,25 @@
 

	
 
/* This code is meant to submit files to the distren server(s). Let's say server for now. And let's state file purpose in each file just so we don't get screwed up! */
 

	
 

	
 
/* Ideas for php-side stuff:
 
 *
 
 * PHP adds the users... has captcha and email confirmation wth a pseudo-random number that
 
 * the user must enter on the site. Apache should be running mod_peruser for safety, and I'm
 
 * thinking zserver2 for web serving for convenience...
 
 */
 

	
 

	
 
#include <distren.h>
 
#include "distren.h"
 

	
 
#include <stdio.h> /* sprintf, printf */
 
#include <stdlib.h> /* malloc, free */
 
#include <unistd.h> /* getopt */
 
#include <confuse.h>
 
#include <string.h> // for strcat
 

	
 

	
 
int main(int argc, char *argv[])
 
{
 
  int doLogin = 0;
 

	
src/client/libdistren.c
Show inline comments
 
@@ -12,25 +12,25 @@
 
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  GNU Affero General Public License for more details.
 

	
 
  You should have received a copy of the GNU Affero General Public License
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
/*
 
  Implementation of distren_* functions from distren.h excluding distren_job_* functions.
 
 */
 

	
 
#include <libdistren.h>
 
#include "libdistren.h"
 

	
 
#include <malloc.h>
 
#include <stdio.h>
 

	
 
/**
 
   @todo needs to read configuration in
 
 */
 
int distren_init_mf(distren_t *handle, distren_malloc_t mymalloc, distren_free_t myfree)
 
{
 
  if(!handle
 
     || !mymalloc
 
     || !myfree)
src/client/libdistren.h
Show inline comments
 
@@ -15,25 +15,25 @@
 

	
 
  You should have received a copy of the GNU Affero General Public License
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
#ifndef LIBDISTREN_H_
 
#define LIBDISTREN_H_ 1
 

	
 
/*
 
  Private definitions for libdistren.
 
 */
 

	
 
#include <distren.h>
 
#include "distren.h"
 

	
 
struct distren
 
{
 
  distren_malloc_t malloc;
 
  distren_free_t free;
 
  struct options_common *options; /*< use a pointer just to avoid #include "options.h"? */
 
  char *server;
 
};
 

	
 
struct distren_job
 
{
 
  char *jobid;
src/client/libdistren_config.c
Show inline comments
 
@@ -12,25 +12,25 @@
 
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  GNU Affero General Public License for more details.
 

	
 
  You should have received a copy of the GNU Affero General Public License
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
/*
 
  Functions and code for retrieving the client's configuration information.
 
 */
 

	
 
#include <libdistren.h>
 
#include "libdistren.h"
 
#include "options.h"
 

	
 
/**
 
@todo Stub
 
 */
 
int _distren_getoptions(distren_t handle)
 
{
 
  cfg_t *cfg;
 

	
 
  cfg_opt_t cfg_opts[] =
 
    {
 
      CFG_STR("server", NULL, 0),
src/client/libdistren_job.c
Show inline comments
 
@@ -12,25 +12,25 @@
 
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  GNU Affero General Public License for more details.
 

	
 
  You should have received a copy of the GNU Affero General Public License
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
/*
 
  Implementation of distren_job_* functions from distren.h.
 
 */
 

	
 
#include <libdistren.h>
 
#include "libdistren.h"
 

	
 
/**
 
   @todo Stub
 
 */
 
int distren_job_getid(distren_job_t job, char **jobid)
 
{
 
  return 1;
 
}
 

	
 
/**
 
   @todo Stub
 
 */
src/client/libdistren_unbias.c
Show inline comments
 
@@ -12,23 +12,23 @@
 
  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
  GNU Affero General Public License for more details.
 

	
 
  You should have received a copy of the GNU Affero General Public License
 
  along with DistRen.  If not, see <http://www.gnu.org/licenses/>.
 
*/
 

	
 
/*
 
  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 <libdistren.h>
 
#include "libdistren.h"
 

	
 
void *_malloc(distren_t distren, size_t size)
 
{
 
  return (*distren->malloc)(size);
 
}
 

	
 
void _free(distren_t distren, void *tofree)
 
{
 
  (*distren->free)(tofree);
 
}
src/common/Makefile.am
Show inline comments
 
deleted file
src/server/Makefile.am
Show inline comments
 
deleted file
src/tests/Makefile.am
Show inline comments
 
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
0 comments (0 inline, 0 general)