dnl Process this file with autoconf to produce a configure script. AC_INIT(src/text/mgquery.c) AC_CONFIG_HEADER(config.h) AC_ARG_PROGRAM dnl PACKAGE=mg VERSION=1.2 LDFLAGS= AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_SUBST(PACKAGE) AC_SUBST(VERSION) dnl Checks for programs. AC_PROG_CXX AC_PROG_AWK AC_PROG_YACC AC_PROG_CC 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 -lm: AC_CHECK_LIB(m, main) dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.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) 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 # --------------------------------------------------------------------------- AC_OUTPUT([Makefile src/text/Makefile src/images/Makefile src/scripts/Makefile lib/Makefile jni/Makefile java/org/greenstone/mg/Makefile ], [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])