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