dnl Process this file with autoconf to produce a configure script. AC_INIT(lib/text_t.h) AC_CONFIG_HEADER(config.h) PACKAGE=gsdl VERSION=2.1 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_SUBST(PACKAGE) AC_SUBST(VERSION) dnl dnl Set use of fast cgi dnl USE_FASTCGI=0 if test USE_FASTCGI = 1; then AC_DEFINE(USE_FASTCGI) AC_SUBST(USE_FASTCGI) fi dnl dnl Set use of corba dnl AC_ARG_ENABLE(corba, [ --enable-corba Enable CORBA support], USE_CORBA=1, USE_CORBA=0) AC_DEFINE_UNQUOTED(USE_CORBA, $USE_CORBA) AC_SUBST(USE_CORBA) AC_ARG_WITH(micodir, [ --with-micodir Use installed MICO directory], MICO_DIR=$enableval, MICO_DIR="default") AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR") AC_SUBST(MICO_DIR) dnl dnl Set use of z39.50 dnl AC_ARG_ENABLE(z3950, [ --enable-z3950 Enable Z39.50 client support], USE_Z3950=1, USE_Z3950=0) if test USE_Z3950 = 1; then AC_DEFINE(USE_Z3950, $USE_Z3950) AC_SUBST(USE_Z3950) fi dnl dnl look for libgdbm if not in standard location dnl AC_ARG_WITH(gdbm, [ --with-gdbm=dir Use local gdbm library and headers], gdbmdir=$withval) dnl Checks for programs. LDFLAGS= dnl only set CFLAGS if not already set in environment if test -z "$CFLAGS"; then CFLAGS=-O2 fi AC_SUBST(CFLAGS) AC_PROG_CC AC_PROG_CXX AC_PROG_AWK AC_PROG_YACC dnl get $target_cpu, $target_vendor, and $target_os dnl (as well as host_*) AC_CANONICAL_SYSTEM dnl do we actually want this? It adds a prefix based on host, system etc dnl AC_ARG_PROGRAM AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB #moved CORBA MICO directory test to get version of MICO if test $USE_CORBA = 1; then if test $MICO_DIR = "default"; then #do something MICO_INC="-I packages/mico/mico/include" else #build the micotest program MICO_INC= "" if test $MICO_DIR != yes; then MICO_INC="-I $MICO_DIR" fi fi #get MICO_VER value sh -c "$CC -c micotest.cpp -o micotest.o $MICO_INC 2>&1" > /dev/null sh -c "$CC -o micotest micotest.o -lstdc++ 2>&1" > /dev/null MICO_VER=`./micotest` || MICO_VER=2.3.5 sh -c "rm micotest" sh -c "rm micotest.o" #do test of MICO_VER if test MICO_VER != 0; then AC_DEFINE(MICO_VER) AC_SUBST(MICO_VER) fi #end USE_CORBA test fi dnl Checks for typedefs, structures, and compiler characteristics. AC_AIX AC_ISC_POSIX AC_MINIX fp_C_PROTOTYPES AC_C_CONST AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM dnl --- This should be in the stdc checking ----------------- if test "$ac_cv_prog_cc_stdc" = '-Xc'; then dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or dnl XOPEN extensions (like popen). dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg dnl needs. So drop back to -Xa AC_TRY_COMPILE( [#include ], [ FILE *rubbish = popen("yes", "r"); ],, [CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa']) fi dnl ---------------------- dnl Checks for libraries. dnl Replace `main' with a function in -lg: AC_CHECK_LIB(g, main) dnl Replace `main' with a function in -lgdbm: AC_CHECK_LIB(gdbm, main) dnl Replace `main' with a function in -lm: AC_CHECK_LIB(m, main) dnl Replace `main' with a function in -lstdc++: AC_CHECK_LIB(stdc++, main) dnl Replace `main' with a function in -lcrypt: AC_CHECK_LIB(crypt, main) dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h) AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL)) AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL)) AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE)) dnl Checks for library functions. AC_FUNC_ALLOCA AC_PROG_GCC_TRADITIONAL AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror) AC_REPLACE_FUNCS(ftruncate strstr strcasecmp) # *** Custom checking (based on GNU tar configure.in) *** # --------------------------------------------------------------------------- AC_MSG_CHECKING(for HP-UX needing gmalloc) if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then AC_MSG_RESULT(yes) LIBOBJS="$LIBOBJS gmalloc.o" AC_DEFINE(HAVE_VALLOC) else AC_MSG_RESULT(no) AC_CHECK_FUNCS(valloc) fi fp_WITH_DMALLOC fp_WITH_REGEX # --------------------------------------------------------------------------- if test "$ac_cv_func_alloca" = 'no'; then dnl support functions for alloca.c LIBOBJS="$LIBOBJS xmalloc.o error.o" fi # --------------------------------------------------------------------------- dnl dnl Switch into C++ dnl AC_LANG_CPLUSPLUS dnl dnl Check that the GDBM library is available dnl dnl check libgdbm manually, in case it's not in the standard location. AC_MSG_CHECKING(that the GDBM library is available) if test ! -z "$gdbmdir" ; then # look in given directory for header file if test -e $gdbmdir/include/gdbm.h ; then GDBM_INCLUDE="-I$gdbmdir/include" ; elif test -e $gdbmdir/gdbm.h ; then GDBM_INCLUDE="-I$gdbmdir" ; fi # look in given directory for library if test -e $gdbmdir/libgdbm.a ; then GDBM_LIBPATH="-L$gdbmdir" ; elif test -e $gdbmdir/lib/libgdbm.a ; then GDBM_LIBPATH="-L$gdbmdir/lib" ; elif test -e $gdbmdir/.libs/libgdbm.a ; then GDBM_LIBPATH="-L$gdbmdir/.libs" ; fi if test ! -z "$GDBM_LIBPATH" -a ! -z "$GDBM_INCLUDE" ; then AC_MSG_RESULT($gdbmdir) ; AC_DEFINE(HAVE_LIBGDBM , 1) else AC_MSG_RESULT(can't find both gdbm.h and libgdbm.a in $gdbmdir); AC_MSG_CHECKING( looking for GDBM library in default locations) fi fi if test -z "$GDBM_INCLUDE" ; then # try in system directory AC_TRY_COMPILE( [#include ], [], success=yes, success=no ) AC_MSG_RESULT($success) if test $success = "no"; then AC_MSG_ERROR(GDBM Library not available - cannot install) fi GDBM_LIBPATH= GDBM_INCLUDE= fi AC_SUBST(GDBM_LIBPATH) AC_SUBST(GDBM_INCLUDE) dnl dnl Now check that Perl is actually around, and can be found dnl AC_MSG_CHECKING(that Perl 5 is available) success="no" pl_path="$PATH" IFS="${IFS= }"; pl_save_ifs="$IFS"; IFS=":" for pl_dir in $pl_path; do test -z "$pl_dir" && pl_dir=. if test -x $pl_dir/perl; then success="yes" break fi done IFS="$pl_save_ifs" dnl dnl Perl actually can be run; now we see if it is version 5 by dnl running a sample script (which returns a "clean" version number dnl and then tests the result using expr. If perl errors in some dnl way (eg. broken Perl executable, missing script), we set a failure dnl value ("0") and then proceed as best we can dnl if test $success = "yes"; then try=`perl configtest.pl` || try="0" try=`expr $try \> 5.000` if test $try = "1"; then AC_MSG_RESULT("yes") else success="no" fi fi if test $success = "no"; then AC_MSG_RESULT("no") AC_MSG_ERROR("Perl 5 not available - cannot install") fi dnl dnl Check if the STL library has any known faults; dnl In GCC 2.7.2.x series, some STL library headers are missing dnl a file called "new" which is referred to by other headers dnl (eg. vector/vector.h); if this applies, then all use of the dnl STL will cause a compile fail, so we'd better let the user dnl know now, before things really go wrong! dnl success=no AC_MSG_CHECKING("whether STL library has known faults") dnl - first shot, try simple good old vector on its own AC_TRY_COMPILE( [#include ], [], success=yes, ) dnl - try using the .h equivalent if test $success = "no"; then AC_TRY_COMPILE( [#include ], [], success="yes", ) fi dnl - now try for the objectspace headers if test $success = "no"; then AC_TRY_COMPILE( [#include ], [], success="yes", ) fi if test $success = yes; then AC_MSG_RESULT("no") else AC_MSG_RESULT("yes") AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler") fi gsdlos=`uname | tr A-Z a-z` AC_SUBST(gsdlos) # --------------------------------------------------------------------------- if test "$ac_cv_func_alloca" = 'no'; then dnl support functions for alloca.c LIBOBJS="$LIBOBJS xmalloc.o error.o" fi # --------------------------------------------------------------------------- dnl for Darwin, as our packages don't (yet) correctly guess our system type. ac_configure_args="$ac_configure_args --host=$host --target=$target" AC_CONFIG_SUBDIRS(packages) AC_OUTPUT(packages/Makefile packages/mg/Makefile packages/mg/src/text/Makefile packages/mg/src/images/Makefile packages/mg/src/scripts/Makefile packages/mg/lib/Makefile src/mgpp/Makefile src/mgpp/lib/Makefile src/mgpp/text/Makefile src/hashfile/Makefile src/colservr/Makefile src/recpt/Makefile src/txt2db/Makefile src/db2txt/Makefile lib/Makefile Makefile src/getpw/Makefile src/phind/generate/Makefile)