source: main/trunk/greenstone2/common-src/indexers/mg/configure.in@ 25169

Last change on this file since 25169 was 25169, checked in by jmt12, 12 years ago

Propagating ARCH_DEP_FLAGS. It appears that you need to at least reissue the AC_SUBST command even for variables that have been exported in 'higher' configures

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