From f33d2c2293d082f63288d8dd430924174837902b Mon Sep 17 00:00:00 2001 From: Marc Cromme Date: Fri, 7 Oct 2005 09:21:41 +0000 Subject: [PATCH] changed build system to use C++ compiler, temp config files moved to config dir, configure.ac used now, src/config.hpp added by autoheader --- buildconf.sh | 5 +- configure.ac | 111 +++++++++++++++++++++++++++++++++++++++++++ configure.in | 58 ----------------------- src/Makefile.am | 6 +-- src/p2_config.cpp | 3 +- usemarcon.m4 | 42 ---------------- yaz.m4 | 137 ----------------------------------------------------- yazpp.m4 | 52 -------------------- 8 files changed, 119 insertions(+), 295 deletions(-) create mode 100644 configure.ac delete mode 100644 configure.in delete mode 100644 usemarcon.m4 delete mode 100644 yaz.m4 delete mode 100644 yazpp.m4 diff --git a/buildconf.sh b/buildconf.sh index 434e2f8..82c872b 100755 --- a/buildconf.sh +++ b/buildconf.sh @@ -1,7 +1,8 @@ #!/bin/sh -# $Id: buildconf.sh,v 1.1 2005-10-06 09:37:25 marc Exp $ +# $Id: buildconf.sh,v 1.2 2005-10-07 09:21:41 marc Exp $ set -x -aclocal -I . +aclocal -I m4 +autoheader libtoolize --automake --force automake --add-missing autoconf diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..62c6a71 --- /dev/null +++ b/configure.ac @@ -0,0 +1,111 @@ +## -*- Autoconf -*- +## Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.57) +AC_INIT(yp2, 0.0.1, marc@indexdata.dk) +AM_CONFIG_HEADER(src/config.hpp) + + +AC_CONFIG_SRCDIR(configure.ac) +AC_CONFIG_AUX_DIR(config) +AC_CANONICAL_SYSTEM +AC_PREFIX_DEFAULT(`pwd`) + +AM_INIT_AUTOMAKE + + +# Checks for programs. +AC_PROG_CXX +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_RANLIB +AM_PROG_LIBTOOL + +# Use C++ compilers only for tests +AC_LANG(C++) + +# Checks for libraries. +##AC_CHECK_LIB(ibrary, main) +AC_CHECK_LIB(boost_thread, main) + +## YAZPP checks +YAZPP_INIT(threads,1.0) +if test -z "$YAZPPLIB"; then + AC_MSG_ERROR([YAZ++ development libraries missing]) +fi +##YAZ_DOC + +## libxslt checks +AC_SUBST(XSLT_LIBS) +AC_SUBST(XSLT_CFLAGS) +xsltdir=default +AC_ARG_WITH(xslt,[[ --with-xslt[=PREFIX] use libxslt in PREFIX]],xsltdir=$withval) +if test "$xsltdir" = "yes" -o "$xsltdir" = "default"; then + for d in /usr /usr/local; do + if test -x $d/bin/xslt-config; then + xsltdir=$d + fi + done +fi +if test "$xsltdir" != "no"; then + AC_MSG_CHECKING(for libXSLT) + if test -x $xsltdir/bin/xslt-config; then + XSLT_LIBS=`$xsltdir/bin/xslt-config --libs` + XSLT_CFLAGS=`$xsltdir/bin/xslt-config --cflags` + XSLT_VER=`$xsltdir/bin/xslt-config --version` + AC_MSG_RESULT($XSLT_VER) + AC_DEFINE([HAVE_XSLT],[1], + [Define to 1 if you have libxslt installed]) + else + AC_MSG_RESULT(Not found) + if test "$xsltdir" = "default"; then + AC_MSG_WARN([Libxslt development libraries not found.]) + else + AC_MSG_ERROR([libxslt development libraries not found.]) fi + fi +fi + + +# Checks for header files. +##AC_HEADER_STDC +##AC_HEADER_STDCXX +##AC_HEADER_SYS_WAIT +##AC_HEADER_TIME +AC_CHECK_HEADERS(boost/thread/mutex.hpp) + + + +# Checks for typedefs, structures, and compiler characteristics. +##AC_TYPE_SIZE_T +##AC_CHECK_SIZEOF(int) +##AC_CHECK_SIZEOF(long int) + + +# Checks for library functions. + +AC_CONFIG_FILES([ + Doxyfile + Makefile + src/Makefile +]) + +AC_OUTPUT + + +# postamble + +echo \ +"------------------------------------------------------------------------ +Configuration: + + Source code location: ${srcdir} + CPP Preprocessor flags: ${CPPFLAGS} + CXX Compiler: ${CXX} + CXX Compiler flags: ${CXXFLAGS} + Linker flags: ${LDFLAGS} + Linked libs: ${LIBS} + Host System Type: ${host} + Install path: ${prefix} + +------------------------------------------------------------------------" diff --git a/configure.in b/configure.in deleted file mode 100644 index 856f384..0000000 --- a/configure.in +++ /dev/null @@ -1,58 +0,0 @@ -AC_INIT(configure.in) -AM_INIT_AUTOMAKE(yp2,0.0.0) - -AC_PROG_CC -AC_PROG_CPP -AC_PROG_CXX -AC_HEADER_STDC -AM_PROG_LIBTOOL - -YAZPP_INIT(threads,1.0) -if test -z "$YAZPPLIB"; then - AC_MSG_ERROR([YAZ++ development libraries missing]) -fi -YAZ_DOC -USEMARCON_INIT - -AC_CHECK_FUNCS(setrlimit getrlimit gettimeofday) -AC_CHECK_HEADERS(pwd.h sys/resource.h sys/stat.h sys/time.h sys/types.h sys/wait.h unistd.h boost/thread/mutex.hpp) -AC_CHECK_LIB(dl,dlopen) -dnl -dnl ----- libXSLT -AC_SUBST(XSLT_LIBS) -AC_SUBST(XSLT_CFLAGS) -xsltdir=default -AC_ARG_WITH(xslt,[[ --with-xslt[=PREFIX] use libxslt in PREFIX]],xsltdir=$withval) -if test "$xsltdir" = "yes" -o "$xsltdir" = "default"; then - for d in /usr /usr/local; do - if test -x $d/bin/xslt-config; then - xsltdir=$d - fi - done -fi -if test "$xsltdir" != "no"; then - AC_MSG_CHECKING(for libXSLT) - if test -x $xsltdir/bin/xslt-config; then - XSLT_LIBS=`$xsltdir/bin/xslt-config --libs` - XSLT_CFLAGS=`$xsltdir/bin/xslt-config --cflags` - XSLT_VER=`$xsltdir/bin/xslt-config --version` - AC_MSG_RESULT($XSLT_VER) - AC_DEFINE(HAVE_XSLT) - else - AC_MSG_RESULT(Not found) - if test "$xsltdir" = "default"; then - AC_MSG_WARN([Libxslt development libraries not found.]) - else - AC_MSG_ERROR([libxslt development libraries not found.]) fi - fi -fi - -AC_SUBST(YAZPROXY_SRC_ROOT) -AC_SUBST(YAZPROXY_BUILD_ROOT) -YAZPROXY_SRC_ROOT=`cd ${srcdir}; pwd` -YAZPROXY_BUILD_ROOT=`pwd` -AC_OUTPUT([ - Doxyfile - Makefile - src/Makefile -]) diff --git a/src/Makefile.am b/src/Makefile.am index d059692..2843b2b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ -## $Id: Makefile.am,v 1.5 2005-10-06 21:41:12 marc Exp $ +## $Id: Makefile.am,v 1.6 2005-10-07 09:21:41 marc Exp $ -AM_CXXFLAGS = $(YAZPPINC) $(XSLT_CFLAGS) $(USEMARCONINC) +AM_CXXFLAGS = $(YAZPPINC) $(XSLT_CFLAGS) bin_PROGRAMS = check_PROGRAMS = test_filter1 test_filter2 test_session1 \ @@ -26,7 +26,7 @@ p2_SOURCES=p2_frontend.cpp p2_msg.cpp p2.cpp p2_frontend.h \ thread_pool_observer.cpp thread_pool_observer.h -LDADD= $(YAZPPLALIB) $(XSLT_LIBS) $(USEMARCONLALIB) -lboost_thread +LDADD= $(YAZPPLALIB) $(XSLT_LIBS) -lboost_thread # Modules diff --git a/src/p2_config.cpp b/src/p2_config.cpp index 6fd43f2..7bea420 100644 --- a/src/p2_config.cpp +++ b/src/p2_config.cpp @@ -1,4 +1,4 @@ -/* $Id: p2_config.cpp,v 1.1 2005-10-06 09:37:25 marc Exp $ +/* $Id: p2_config.cpp,v 1.2 2005-10-07 09:21:41 marc Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -25,6 +25,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include #include "p2_config.h" +#include "config.hpp" #if HAVE_XSLT #include diff --git a/usemarcon.m4 b/usemarcon.m4 deleted file mode 100644 index c52fe0c..0000000 --- a/usemarcon.m4 +++ /dev/null @@ -1,42 +0,0 @@ -## $Id: usemarcon.m4,v 1.1 2005-10-06 09:37:25 marc Exp $ -AC_DEFUN([USEMARCON_INIT], -[ - AC_SUBST(USEMARCONLALIB) - AC_SUBST(USEMARCONINC) - usemarconconfig=NONE - usemarconpath=NONE - AC_ARG_WITH(usemarcon, [ --with-usemarcon=DIR usemarcon-config in DIR (example /home/usemarcon145)], [usemarconpath=$withval]) - - if test "x$usemarconpath" != "xNONE"; then - usemarconconfig=$usemarconpath/usemarcon-config - else - if test "x$srcdir" = "x"; then - usemarconsrcdir=. - else - usemarconsrcdir=$srcdir - fi - for i in ${usemarconsrcdir}/../usemarcon*; do - if test -d $i; then - if test -r $i/usemarcon-config; then - usemarconconfig=$i/usemarcon-config - fi - fi - done - if test "x$usemarconconfig" = "xNONE"; then - AC_PATH_PROG(usemarconconfig, usemarcon-config, NONE) - fi - fi - - AC_MSG_CHECKING(for USEMARCON) - if $usemarconconfig --version >/dev/null 2>&1; then - USEMARCONLALIB=`$usemarconconfig --lalibs $1` - USEMARCONINC=`$usemarconconfig --cflags $1` - USEMARCONVERSION=`$usemarconconfig --version` - AC_MSG_RESULT($usemarconconfig) - AC_DEFINE(HAVE_USEMARCON) - else - AC_MSG_RESULT(Not found) - USEMARCONVERSION=NONE - fi -]) - diff --git a/yaz.m4 b/yaz.m4 deleted file mode 100644 index 2782a1d..0000000 --- a/yaz.m4 +++ /dev/null @@ -1,137 +0,0 @@ -# Use this m4 function for autoconf if you use YAZ in your own -# configure script. - -dnl ----- Setup Docbook documentation for YAZ -AC_DEFUN([YAZ_DOC], -[ -AC_SUBST(DTD_DIR) -AC_ARG_WITH(docbook-dtd,[[ --with-docbook-dtd=DIR use docbookx.dtd in DIR]], -[ - if test -f "$withval/docbookx.dtd"; then - DTD_DIR=$withval - fi -],[ - AC_MSG_CHECKING(for docbookx.dtd) - DTD_DIR="" - for d in /usr/lib/sgml/dtd/docbook-xml \ - /usr/share/sgml/docbook/dtd/4.2 \ - /usr/share/sgml/docbook/dtd/xml/4.* \ - /usr/share/sgml/docbook/xml-dtd-4.* - do - if test -f $d/docbookx.dtd; then - DTD_DIR=$d - fi - done - if test -z "$DTD_DIR"; then - AC_MSG_RESULT(Not found) - else - AC_MSG_RESULT($d) - fi -]) -AC_SUBST(DSSSL_DIR) -AC_ARG_WITH(docbook-dsssl,[[ --with-docbook-dsssl=DIR use Docbook DSSSL in DIR/{html,print}/docbook.dsl]], -[ - if test -f "$withval/html/docbook.dsl"; then - DSSSL_DIR=$withval - fi -],[ - AC_MSG_CHECKING(for docbook.dsl) - DSSSL_DIR="" - for d in /usr/share/sgml/docbook/stylesheet/dsssl/modular \ - /usr/share/sgml/docbook/dsssl-stylesheets-1.* \ - /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh - do - if test -f $d/html/docbook.dsl; then - AC_MSG_RESULT($d) - DSSSL_DIR=$d - break - fi - done - if test -z "$DSSSL_DIR"; then - AC_MSG_RESULT(Not found) - fi -]) -AC_SUBST(XSL_DIR) -AC_ARG_WITH(docbook-xsl,[[ --with-docbook-xsl=DIR use Docbook XSL in DIR/{htmlhelp,xhtml}]], -[ - if test -f "$withval/htmlhelp/htmlhelp.xsl"; then - XSL_DIR=$withval - fi -],[ - AC_MSG_CHECKING(for htmlhelp.xsl) - for d in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh \ - /usr/share/sgml/docbook/xsl-stylesheets-1.* - do - if test -f $d/htmlhelp/htmlhelp.xsl; then - AC_MSG_RESULT($d) - XSL_DIR=$d - break - fi - done - if test -z "$XSL_DIR"; then - AC_MSG_RESULT(Not found) - fi -]) -]) - -AC_DEFUN([YAZ_INIT], -[ - AC_SUBST(YAZLIB) - AC_SUBST(YAZLALIB) - AC_SUBST(YAZINC) - AC_SUBST(YAZVERSION) - yazconfig=NONE - yazpath=NONE - AC_ARG_WITH(yaz, [ --with-yaz=DIR use yaz-config in DIR (example /home/yaz-1.7)], [yazpath=$withval]) - if test "x$yazpath" != "xNONE"; then - yazconfig=$yazpath/yaz-config - else - if test "x$srcdir" = "x"; then - yazsrcdir=. - else - yazsrcdir=$srcdir - fi - for i in ${yazsrcdir}/../../yaz ${yazsrcdir}/../yaz* ${yazsrcdir}/../yaz; do - if test -d $i; then - if test -r $i/yaz-config; then - yazconfig=$i/yaz-config - fi - fi - done - if test "x$yazconfig" = "xNONE"; then - AC_PATH_PROG(yazconfig, yaz-config, NONE) - fi - fi - AC_MSG_CHECKING(for YAZ) - if $yazconfig --version >/dev/null 2>&1; then - YAZLIB=`$yazconfig --libs $1` - # if this is empty, it's a simple version YAZ 1.6 script - # so we have to source it instead... - if test "X$YAZLIB" = "X"; then - . $yazconfig - else - YAZLALIB=`$yazconfig --lalibs $1` - YAZINC=`$yazconfig --cflags $1` - YAZVERSION=`$yazconfig --version` - fi - AC_MSG_RESULT([$yazconfig]) - else - AC_MSG_RESULT(Not found) - YAZVERSION=NONE - fi - if test "X$YAZVERSION" != "XNONE"; then - AC_MSG_CHECKING([for YAZ version]) - AC_MSG_RESULT([$YAZVERSION]) - if test "$2"; then - have_yaz_version=`echo "$YAZVERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'` - req_yaz_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'` - if test "$have_yaz_version" -lt "$req_yaz_version"; then - AC_MSG_ERROR([$YAZVERSION. Requires $2 or later]) - fi - if test "$req_yaz_version" -gt "2000028"; then - YAZINC="$YAZINC -DYAZ_USE_NEW_LOG=1" - fi - fi - fi -]) - diff --git a/yazpp.m4 b/yazpp.m4 deleted file mode 100644 index 63be11e..0000000 --- a/yazpp.m4 +++ /dev/null @@ -1,52 +0,0 @@ -AC_DEFUN([YAZPP_INIT], -[ - AC_SUBST(YAZPPLIB) - AC_SUBST(YAZPPLALIB) - AC_SUBST(YAZPPINC) - AC_SUBST(YAZPPVERSION) - yazppconfig=NONE - yazpppath=NONE - AC_ARG_WITH(yazpp, [ --with-yazpp=DIR yaz++-config in DIR (example /home/yaz++-0.8)], [yazpppath=$withval]) - if test "x$yazpppath" != "xNONE"; then - yazppconfig=$yazpppath/yaz++-config - else - if test "x$srcdir" = "x"; then - yazppsrcdir=. - else - yazppsrcdir=$srcdir - fi - for i in ${yazppsrcdir}/../../yaz++ ${yazppsrcdir}/../yaz++-* ${yazppsrcdir}/../yaz++; do - if test -d $i; then - if test -r $i/yaz++-config; then - yazppconfig=$i/yaz++-config - fi - fi - done - if test "x$yazppconfig" = "xNONE"; then - AC_PATH_PROG(yazppconfig, yaz++-config, NONE) - fi - fi - AC_MSG_CHECKING(for YAZ++) - if $yazppconfig --version >/dev/null 2>&1; then - YAZPPLIB=`$yazppconfig --libs $1` - YAZPPLALIB=`$yazppconfig --lalibs $1` - YAZPPINC=`$yazppconfig --cflags $1` - YAZPPVERSION=`$yazppconfig --version` - AC_MSG_RESULT($yazppconfig) - else - AC_MSG_RESULT(Not found) - YAZVERSION=NONE - fi - if test "X$YAZPPVERSION" != "XNONE"; then - AC_MSG_CHECKING([for YAZ++ version]) - AC_MSG_RESULT([$YAZPPVERSION]) - if test "$2"; then - have_yaz_version=`echo "$YAZPPVERSION" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'` - req_yaz_version=`echo "$2" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'` - if test "$have_yaz_version" -lt "$req_yaz_version"; then - AC_MSG_ERROR([$YAZPPVERSION. Requires $2 or later]) - fi - fi - fi -]) - -- 1.7.10.4