[3745] | 1 | dnl Process this file with autoconf to produce a configure script.
|
---|
| 2 | AC_INIT(src/text/mgquery.c)
|
---|
| 3 | AC_CONFIG_HEADER(config.h)
|
---|
| 4 | AC_ARG_PROGRAM
|
---|
| 5 |
|
---|
| 6 | dnl
|
---|
| 7 | PACKAGE=mg
|
---|
| 8 | VERSION=1.2
|
---|
| 9 |
|
---|
[7882] | 10 | LDFLAGS=
|
---|
| 11 |
|
---|
[3745] | 12 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
---|
| 13 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
|
---|
| 14 | AC_SUBST(PACKAGE)
|
---|
| 15 | AC_SUBST(VERSION)
|
---|
| 16 |
|
---|
| 17 | dnl Checks for programs.
|
---|
| 18 | AC_PROG_CXX
|
---|
| 19 | AC_PROG_AWK
|
---|
| 20 | AC_PROG_YACC
|
---|
| 21 | AC_PROG_CC
|
---|
| 22 | AC_PROG_INSTALL
|
---|
| 23 | AC_PROG_LN_S
|
---|
| 24 | AC_PROG_MAKE_SET
|
---|
| 25 | AC_PROG_RANLIB
|
---|
| 26 |
|
---|
| 27 | dnl Checks for typedefs, structures, and compiler characteristics.
|
---|
| 28 | AC_AIX
|
---|
| 29 | AC_ISC_POSIX
|
---|
| 30 | AC_MINIX
|
---|
| 31 | fp_C_PROTOTYPES
|
---|
| 32 | AC_C_CONST
|
---|
| 33 | AC_TYPE_OFF_T
|
---|
| 34 | AC_TYPE_SIZE_T
|
---|
| 35 | AC_HEADER_TIME
|
---|
| 36 | AC_STRUCT_TM
|
---|
| 37 |
|
---|
| 38 | dnl --- This should be in the stdc checking -----------------
|
---|
| 39 | if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
|
---|
| 40 | dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
|
---|
| 41 | dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
|
---|
| 42 | dnl XOPEN extensions (like popen).
|
---|
| 43 | dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
|
---|
| 44 | dnl needs. So drop back to -Xa
|
---|
| 45 | AC_TRY_COMPILE(
|
---|
| 46 | [#include <stdio.h>
|
---|
| 47 | ], [ FILE *rubbish = popen("yes", "r"); ],,
|
---|
| 48 | [CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
|
---|
| 49 | fi
|
---|
| 50 | dnl ----------------------
|
---|
| 51 |
|
---|
| 52 |
|
---|
| 53 | dnl Checks for libraries.
|
---|
| 54 | dnl Replace `main' with a function in -lm:
|
---|
| 55 | AC_CHECK_LIB(m, main)
|
---|
| 56 |
|
---|
| 57 | dnl Checks for header files.
|
---|
| 58 | AC_HEADER_DIRENT
|
---|
| 59 | AC_HEADER_STDC
|
---|
| 60 | AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h string.h memory.h sys/procfs.h)
|
---|
| 61 | AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
|
---|
| 62 | AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
|
---|
| 63 | AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
|
---|
| 64 |
|
---|
| 65 | dnl Checks for library functions.
|
---|
| 66 | AC_FUNC_ALLOCA
|
---|
| 67 | AC_PROG_GCC_TRADITIONAL
|
---|
| 68 | AC_TYPE_SIGNAL
|
---|
| 69 | AC_FUNC_VPRINTF
|
---|
| 70 | AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize)
|
---|
| 71 | AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
|
---|
| 72 |
|
---|
| 73 |
|
---|
| 74 | # *** Custom checking (based on GNU tar configure.in) ***
|
---|
| 75 | # ---------------------------------------------------------------------------
|
---|
| 76 | AC_MSG_CHECKING(for HP-UX needing gmalloc)
|
---|
| 77 | if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
|
---|
| 78 | AC_MSG_RESULT(yes)
|
---|
[10191] | 79 | AC_LIBOBJ(gmalloc)
|
---|
[3745] | 80 | AC_DEFINE(HAVE_VALLOC)
|
---|
| 81 | else
|
---|
| 82 | AC_MSG_RESULT(no)
|
---|
| 83 | AC_CHECK_FUNCS(valloc)
|
---|
| 84 | fi
|
---|
| 85 |
|
---|
[10191] | 86 | # we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
|
---|
| 87 | # a non-standard Path
|
---|
[10917] | 88 | # is there a better way to do this??
|
---|
| 89 | AC_MSG_CHECKING(for OS to set JNI options)
|
---|
| 90 | # set defaults
|
---|
| 91 | JNIINC=""
|
---|
| 92 | JNISUFFIX="so"
|
---|
| 93 | JNIFLAGS="-shared"
|
---|
| 94 |
|
---|
[10191] | 95 | if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
|
---|
[10917] | 96 | AC_MSG_RESULT(Darwin)
|
---|
[10191] | 97 | JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
|
---|
| 98 | JNISUFFIX="jnilib"
|
---|
[10887] | 99 | JNIFLAGS="-dynamiclib -fno-common -single_module -framework JavaVM"
|
---|
[10191] | 100 | fi
|
---|
[10917] | 101 | if test "`(uname -s) 2> /dev/null`" = 'SunOS'; then
|
---|
| 102 | AC_MSG_RESULT(Solaris)
|
---|
| 103 | JNIINC="-I\$(JAVA_HOME)/include/solaris "
|
---|
| 104 | fi
|
---|
| 105 | if test "`(uname -s) 2> /dev/null`" = 'Linux'; then
|
---|
| 106 | AC_MSG_RESULT(Linux)
|
---|
| 107 | JNIINC="-I\$(JAVA_HOME)/include/linux "
|
---|
| 108 | fi
|
---|
| 109 |
|
---|
[10191] | 110 | AC_SUBST(JNIINC)
|
---|
| 111 | AC_SUBST(JNISUFFIX)
|
---|
| 112 | AC_SUBST(JNIFLAGS)
|
---|
| 113 |
|
---|
[3745] | 114 | fp_WITH_DMALLOC
|
---|
| 115 | fp_WITH_REGEX
|
---|
| 116 |
|
---|
[10840] | 117 | # text for endianness
|
---|
| 118 | AC_C_BIGENDIAN
|
---|
| 119 |
|
---|
[3745] | 120 | # ---------------------------------------------------------------------------
|
---|
| 121 | if test "$ac_cv_func_alloca" = 'no'; then
|
---|
| 122 | dnl support functions for alloca.c
|
---|
[10191] | 123 | AC_LIBOBJ(xmalloc)
|
---|
| 124 | AC_LIBOBJ(error)
|
---|
[3745] | 125 | fi
|
---|
| 126 |
|
---|
| 127 |
|
---|
| 128 | # ---------------------------------------------------------------------------
|
---|
| 129 |
|
---|
| 130 | AC_OUTPUT([Makefile src/text/Makefile src/images/Makefile
|
---|
| 131 | src/scripts/Makefile lib/Makefile
|
---|
| 132 | jni/Makefile java/org/greenstone/mg/Makefile ],
|
---|
| 133 | [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
|
---|