dnl Process this file with autoconf to produce a configure script. AC_INIT(lib/text_t.h) AC_CONFIG_HEADER(config.h) AC_ARG_PROGRAM PACKAGE=gsdl VERSION=2.1 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_SUBST(PACKAGE) AC_SUBST(VERSION) USE_FASTCGI=0 if test USE_FASTCGI = 1; then AC_DEFINE(USE_FASTCGI) AC_SUBST(USE_FASTCGI) fi dnl Checks for programs. LDFLAGS= CFLAGS=-O2 AC_SUBST(CFLAGS) AC_PROG_CC AC_PROG_CXX AC_PROG_AWK AC_PROG_YACC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB 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 AC_MSG_CHECKING("that the GDBM library is available") 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 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) 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 # --------------------------------------------------------------------------- AC_OUTPUT(packages/mg/Makefile packages/mg/src/text/Makefile packages/mg/src/images/Makefile packages/mg/src/scripts/Makefile packages/mg/lib/Makefile src/hashfile/Makefile src/colservr/Makefile src/recpt/Makefile src/txt2db/Makefile src/db2txt/Makefile lib/Makefile Makefile)