From 41b3d6e76417912fda803543325e1edba21896ba Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 8 Jan 2007 12:43:41 +0000 Subject: [PATCH] Automaked pazpar2. Bug #799. Preprocessor defines are put in cconfig.h and included in every C source. cconfig.h is the "configure" defines. The usualy filename convention is config.h but that is already defined. For now all contents of www and test is copied verbatim to the tar-dist. The contents is not installed during 'make install'. That should be done, but since the configuration is still in progress we don't bother yet. Similarly with www: part of tar-dist but not yet installed. The only application installed at this installed is pazpar2 - in PREFIX/bin. --- .cvsignore | 9 +++++ Makefile.am | 13 +++++++ buildconf.sh | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 31 +++++++++++++++++ src/.cvsignore | 5 +++ src/Makefile.am | 15 ++++++++ src/Makefile.dist | 45 ------------------------ src/config.c | 6 +++- src/eventl.c | 7 +++- src/http.c | 6 +++- src/http_command.c | 6 +++- src/pazpar2.c | 9 +++-- src/reclists.c | 6 +++- src/relevance.c | 6 +++- src/termlists.c | 6 +++- src/util.c | 7 +++- 16 files changed, 219 insertions(+), 56 deletions(-) create mode 100644 Makefile.am create mode 100755 buildconf.sh create mode 100644 configure.ac create mode 100644 src/Makefile.am delete mode 100644 src/Makefile.dist diff --git a/.cvsignore b/.cvsignore index e69de29..c433f6a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1,9 @@ +Makefile +Makefile.in +aclocal.m4 +ChangeLog +autom4te.cache +config.cache +config.log +config.status +configure diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..f0647d2 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,13 @@ +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = src + +EXTRA_DIST = README PROTOCOL m4/yaz.m4 + +dist-hook: + if test -x /usr/bin/cvs2cl -a -d CVS; then cvs2cl ; fi + cp -r $(srcdir)/etc $(distdir) + cvs=`find $(distdir)/etc -name CVS -type d -print`; if test "$$cvs"; then rm -r $$cvs; fi + cp -r $(srcdir)/www $(distdir) + cvs=`find $(distdir)/www -name CVS -type d -print`; if test "$$cvs"; then rm -r $$cvs; fi diff --git a/buildconf.sh b/buildconf.sh new file mode 100755 index 0000000..f718842 --- /dev/null +++ b/buildconf.sh @@ -0,0 +1,98 @@ +#!/bin/sh +# $Id: buildconf.sh,v 1.1 2007-01-08 12:43:41 adam Exp $ + +automake=automake +aclocal=aclocal +autoconf=autoconf +libtoolize=libtoolize +autoheader=autoheader + +if [ "`uname -s`" = FreeBSD ]; then + # FreeBSD intalls the various auto* tools with version numbers + echo "Using special configuration for FreeBSD ..." + automake=automake19 + aclocal="aclocal19 -I /usr/local/share/aclocal" + autoconf=autoconf259 + libtoolize=libtoolize15 + autoheader=autoheader259 +fi +if $automake --version|head -1 |grep '1\.[4-7]'; then + echo "automake 1.4-1.7 is active. You should use automake 1.8 or later" + if test -f /etc/debian_version; then + echo " sudo apt-get install automake1.9" + echo " sudo update-alternatives --config automake" + fi + exit 1 +fi + +set -x + +# I am tired of underquoted warnings for Tcl macros +$aclocal -I m4 2>&1 | grep -v aclocal/tcl.m4 +$autoheader +$automake --add-missing +$autoconf +set - +if [ -f config.cache ]; then + rm config.cache +fi + +enable_configure=false +enable_help=true +sh_flags="" +conf_flags="" +case $1 in + -d) + sh_flags="-g -Wall" + enable_configure=true + enable_help=false + shift + ;; + -c) + sh_flags="" + enable_configure=true + enable_help=false + shift + ;; +esac + +if $enable_configure; then + if test -n "$sh_flags"; then + CFLAGS="$sh_flags" ./configure $* + else + ./configure $* + fi +fi +if $enable_help; then + cat < @@ -8,6 +8,10 @@ #include #include +#if HAVE_CONFIG_H +#include +#endif + #include #include diff --git a/src/eventl.c b/src/eventl.c index 324dca1..89ffb12 100644 --- a/src/eventl.c +++ b/src/eventl.c @@ -6,12 +6,17 @@ */ /* - * $Id: eventl.c,v 1.1 2006-12-20 20:47:16 quinn Exp $ + * $Id: eventl.c,v 1.2 2007-01-08 12:43:41 adam Exp $ * Based on revision YAZ' server/eventl.c 1.29. */ #include #include + +#if HAVE_CONFIG_H +#include +#endif + #ifdef WIN32 #include #else diff --git a/src/http.c b/src/http.c index db811b2..09d9f5c 100644 --- a/src/http.c +++ b/src/http.c @@ -1,5 +1,5 @@ /* - * $Id: http.c,v 1.5 2007-01-06 04:54:58 quinn Exp $ + * $Id: http.c,v 1.6 2007-01-08 12:43:41 adam Exp $ */ #include @@ -15,6 +15,10 @@ #include #include +#if HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/src/http_command.c b/src/http_command.c index 086db07..4068cc8 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -1,5 +1,5 @@ /* - * $Id: http_command.c,v 1.8 2007-01-06 05:32:23 quinn Exp $ + * $Id: http_command.c,v 1.9 2007-01-08 12:43:41 adam Exp $ */ #include @@ -11,6 +11,10 @@ #include #include +#if HAVE_CONFIG_H +#include +#endif + #include #include "util.h" diff --git a/src/pazpar2.c b/src/pazpar2.c index ea3af8a..18d0f0a 100644 --- a/src/pazpar2.c +++ b/src/pazpar2.c @@ -1,4 +1,4 @@ -/* $Id: pazpar2.c,v 1.17 2007-01-06 04:54:58 quinn Exp $ */; +/* $Id: pazpar2.c,v 1.18 2007-01-08 12:43:41 adam Exp $ */; #include #include @@ -20,6 +20,10 @@ #include #include +#if HAVE_CONFIG_H +#include "cconfig.h" +#endif + #define USE_TIMING 0 #if USE_TIMING #include @@ -33,7 +37,6 @@ #include "relevance.h" #include "config.h" -#define PAZPAR2_VERSION "0.1" #define MAX_CHUNK 15 static void client_fatal(struct client *cl); @@ -70,7 +73,7 @@ struct parameters global_parameters = 30, "81", "Index Data PazPar2 (MasterKey)", - PAZPAR2_VERSION, + VERSION, 600, // 10 minutes 60, 100, diff --git a/src/reclists.c b/src/reclists.c index 6bca856..b9ac9f1 100644 --- a/src/reclists.c +++ b/src/reclists.c @@ -1,9 +1,13 @@ /* - * $Id: reclists.c,v 1.2 2007-01-05 20:33:05 adam Exp $ + * $Id: reclists.c,v 1.3 2007-01-08 12:43:41 adam Exp $ */ #include +#if HAVE_CONFIG_H +#include +#endif + #include #include "pazpar2.h" diff --git a/src/relevance.c b/src/relevance.c index d689e7b..75800a2 100644 --- a/src/relevance.c +++ b/src/relevance.c @@ -1,11 +1,15 @@ /* - * $Id: relevance.c,v 1.3 2007-01-03 06:23:44 quinn Exp $ + * $Id: relevance.c,v 1.4 2007-01-08 12:43:41 adam Exp $ */ #include #include #include +#if HAVE_CONFIG_H +#include +#endif + #include "relevance.h" #include "pazpar2.h" diff --git a/src/termlists.c b/src/termlists.c index 7f32e3d..e586169 100644 --- a/src/termlists.c +++ b/src/termlists.c @@ -1,11 +1,15 @@ /* - * $Id: termlists.c,v 1.1 2006-12-20 20:47:16 quinn Exp $ + * $Id: termlists.c,v 1.2 2007-01-08 12:43:41 adam Exp $ */ #include #include #include +#if HAVE_CONFIG_H +#include +#endif + #include "termlists.h" // Discussion: diff --git a/src/util.c b/src/util.c index a8547fa..8abcddc 100644 --- a/src/util.c +++ b/src/util.c @@ -1,6 +1,11 @@ -/* $Id: util.c,v 1.1 2006-12-20 20:47:16 quinn Exp $ */ +/* $Id: util.c,v 1.2 2007-01-08 12:43:41 adam Exp $ */ #include + +#if HAVE_CONFIG_H +#include +#endif + #include void die(char *string, char *add) -- 1.7.10.4