dnl Process this file with autoconf to produce a configure script. AC_INIT(src/java/org/greenstone/gsdl3/Library1.java) AC_CONFIG_HEADER(config.h) PACKAGE=gsdl3 VERSION=0.1 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", Define to the name of the distribution.) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", Define to the version of the distribution.) AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_DEFINE(PROTOTYPES, 1, Define to 1 if ANSI function prototypes are usable.) 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 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 -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, 1, Some braindead header files do not have the requ'd function declarations)) AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL, 1, Some braindead header files do not have the requ'd function declarations)) AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE, 1, See if have this field in the prstatus_t structure. It stores the size of the process heap)) 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) dnl see if gettext is in libc. (try the textdomain() function). AC_CHECK_FUNC( textdomain, AC_DEFINE(ENABLE_NLS,1, Define if you have gettext (eg glibc)) ) dnl dnl Switch into C++ dnl AC_LANG_CPLUSPLUS 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 ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # check for running bash under cygwin if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ; then gsdlos=windows fi AC_SUBST(gsdlos) # --------------------------------------------------------------------------- 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 docs/Makefile src/java/Makefile Makefile) echo "-------------------------------------" echo "Greenstone 3 successfully configured." echo ""