1 | dnl Process this file with autoconf to produce a configure script.
|
---|
2 | AC_INIT(text/MGQuery.cpp)
|
---|
3 | AC_CONFIG_HEADER(config.h)
|
---|
4 |
|
---|
5 | dnl get $target_cpu, $target_vendor, and $target_os
|
---|
6 | dnl (as well as host_*)
|
---|
7 | AC_CANONICAL_SYSTEM
|
---|
8 | AC_ARG_PROGRAM
|
---|
9 |
|
---|
10 | dnl
|
---|
11 | PACKAGE=mgpp
|
---|
12 | VERSION=1.3
|
---|
13 |
|
---|
14 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
---|
15 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
|
---|
16 | AC_SUBST(PACKAGE)
|
---|
17 | AC_SUBST(VERSION)
|
---|
18 |
|
---|
19 | gsdlos=`uname | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
|
---|
20 | # check for running bash under cygwin
|
---|
21 | if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ;
|
---|
22 | then
|
---|
23 | gsdlos=windows
|
---|
24 | fi
|
---|
25 | if test "x$crossOS" != "x" ; then
|
---|
26 | gsdlos=$crossOS
|
---|
27 | gsdlarch=""
|
---|
28 | fi
|
---|
29 | AC_SUBST(gsdlos)
|
---|
30 |
|
---|
31 | dnl
|
---|
32 | dnl Disable all Java compilation
|
---|
33 | dnl
|
---|
34 | AC_ARG_ENABLE(java, [ --disable-java Disable Java compilation], ENABLE_JAVA=$enableval, ENABLE_JAVA=yes)
|
---|
35 | if test $ENABLE_JAVA = "yes" -o $ENABLE_JAVA = "1" ; then
|
---|
36 | ENABLE_JAVA=1
|
---|
37 | if test "x$JAVA_HOME" != "x" ; then
|
---|
38 | echo "Detected JAVA_HOME is set, however this will not be used during compilation"
|
---|
39 | echo "To control the version of 'javac' and 'java' set environment variables JAVAC"
|
---|
40 | echo "and JAVA respectively"
|
---|
41 | export JAVA_HOME=
|
---|
42 | fi
|
---|
43 | else
|
---|
44 | ENABLE_JAVA=0
|
---|
45 | fi
|
---|
46 | AC_SUBST(ENABLE_JAVA)
|
---|
47 |
|
---|
48 | dnl AC_MSG_CHECKING(to see if architecture is 64-bit)
|
---|
49 | dnl arch_64bit=no
|
---|
50 | dnl case "$host_cpu" in
|
---|
51 | dnl x86_64) arch_64bit=yes ;;
|
---|
52 | dnl esac
|
---|
53 | if test -z "$ARCH_DEP_FLAGS" ; then
|
---|
54 | ARCH_DEP_FLAGS=
|
---|
55 | fi
|
---|
56 | AC_SUBST(ARCH_DEP_FLAGS)
|
---|
57 |
|
---|
58 | dnl
|
---|
59 | dnl disable compilation of accent folding stuff for mgpp (and one day mg)
|
---|
60 | dnl
|
---|
61 | AC_ARG_ENABLE(accentfold, [ --disable-accentfold Disable Accent Folding for MGPP], ENABLE_ACCENTFOLD=$enableval, ENABLE_ACCENTFOLD=yes)
|
---|
62 | if test $ENABLE_ACCENTFOLD = "yes" -o $ENABLE_ACCENTFOLD = "1" ; then
|
---|
63 | ENABLE_ACCENTFOLD=1
|
---|
64 | AC_DEFINE(ENABLE_ACCENTFOLD,[])
|
---|
65 | else
|
---|
66 | ENABLE_ACCENTFOLD=0
|
---|
67 | fi
|
---|
68 | AC_SUBST(ENABLE_ACCENTFOLD)
|
---|
69 |
|
---|
70 |
|
---|
71 | dnl Checks for programs.
|
---|
72 | AC_PROG_CXX
|
---|
73 | AC_PROG_AWK
|
---|
74 | AC_PROG_YACC
|
---|
75 | AC_PROG_CC
|
---|
76 | AC_PROG_INSTALL
|
---|
77 | AC_PROG_LN_S
|
---|
78 | AC_PROG_MAKE_SET
|
---|
79 | AC_PROG_RANLIB
|
---|
80 | if test $ENABLE_JAVA = "1" ; then
|
---|
81 | AC_PROG_JAVA
|
---|
82 | AC_PROG_JAVAC
|
---|
83 | fi
|
---|
84 |
|
---|
85 | dnl Checks for typedefs, structures, and compiler characteristics.
|
---|
86 | AC_AIX
|
---|
87 | AC_ISC_POSIX
|
---|
88 | AC_MINIX
|
---|
89 | fp_C_PROTOTYPES
|
---|
90 | AC_C_CONST
|
---|
91 | AC_TYPE_OFF_T
|
---|
92 | AC_TYPE_SIZE_T
|
---|
93 | AC_HEADER_TIME
|
---|
94 | AC_STRUCT_TM
|
---|
95 |
|
---|
96 | dnl
|
---|
97 | dnl look for unac package if not in standard location
|
---|
98 | dnl
|
---|
99 | dnl is it ok to use `pwd` like this??
|
---|
100 | AC_ARG_WITH(unac, [ --with-unac=dir Use local unac library and headers], UNAC_DIR=$withval, UNAC_DIR="`pwd`/../packages/unac")
|
---|
101 | AC_DEFINE_UNQUOTED(UNAC_DIR, "$UNAC_DIR")
|
---|
102 | AC_SUBST(UNAC_DIR)
|
---|
103 |
|
---|
104 | dnl
|
---|
105 | dnl look for libiconv package if not in standard location
|
---|
106 | dnl
|
---|
107 | #AC_ARG_WITH(unac, [ --with-libiconv-prefix=dir Use local libiconv library], LIBICONV_DIR=$withval)
|
---|
108 | #AC_DEFINE_UNQUOTED(LIBICONV_DIR, "$LIBICONV_DIR")
|
---|
109 | #AC_SUBST(LIBICONV_DIR)
|
---|
110 |
|
---|
111 |
|
---|
112 | dnl --- This should be in the stdc checking -----------------
|
---|
113 | if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
|
---|
114 | dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
|
---|
115 | dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
|
---|
116 | dnl XOPEN extensions (like popen).
|
---|
117 | dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
|
---|
118 | dnl needs. So drop back to -Xa
|
---|
119 | AC_TRY_COMPILE(
|
---|
120 | [#include <stdio.h>
|
---|
121 | ], [ FILE *rubbish = popen("yes", "r"); ],,
|
---|
122 | [CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
|
---|
123 | fi
|
---|
124 | dnl ----------------------
|
---|
125 |
|
---|
126 |
|
---|
127 | dnl Checks for libraries.
|
---|
128 | dnl Replace `main' with a function in -lg:
|
---|
129 | AC_CHECK_LIB(g, main)
|
---|
130 | dnl Replace `main' with a function in -lm:
|
---|
131 | AC_CHECK_LIB(m, main)
|
---|
132 | dnl Replace `main' with a function in -lstdc++:
|
---|
133 | dnl AC_CHECK_LIB(stdc++, main)
|
---|
134 | dnl Replace `main' with a function in -lcrypt:
|
---|
135 | AC_CHECK_LIB(crypt, main)
|
---|
136 | #if test $ENABLE_ACCENTFOLD = 1; then
|
---|
137 | #AC_HAVE_LIBRARY(iconv)
|
---|
138 | #fi
|
---|
139 |
|
---|
140 |
|
---|
141 | dnl Checks for header files.
|
---|
142 | AC_HEADER_DIRENT
|
---|
143 | AC_HEADER_STDC
|
---|
144 | AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h)
|
---|
145 | AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
|
---|
146 | AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
|
---|
147 | AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
|
---|
148 |
|
---|
149 | dnl Checks for library functions.
|
---|
150 | AC_FUNC_ALLOCA
|
---|
151 | AC_PROG_GCC_TRADITIONAL
|
---|
152 | AC_TYPE_SIGNAL
|
---|
153 | AC_FUNC_VPRINTF
|
---|
154 | AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
|
---|
155 | AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
|
---|
156 |
|
---|
157 |
|
---|
158 | dnl see if gettext is in libc. (try the textdomain() function).
|
---|
159 | AC_CHECK_FUNC(textdomain, AC_DEFINE(ENABLE_NLS ,1) )
|
---|
160 |
|
---|
161 | # we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
|
---|
162 | # a non-standard Path
|
---|
163 | # is there a better way to do this??
|
---|
164 | AC_MSG_CHECKING(for OS to set JNI options)
|
---|
165 | # set defaults
|
---|
166 | JNIINC=""
|
---|
167 | JNIPREFIX="lib"
|
---|
168 | JNISUFFIX="so"
|
---|
169 | JNICFLAGS=""
|
---|
170 | JNILDFLAGS="-shared"
|
---|
171 |
|
---|
172 | if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
|
---|
173 | AC_MSG_RESULT(Darwin)
|
---|
174 | JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
|
---|
175 | JNISUFFIX="jnilib"
|
---|
176 | JNILDFLAGS="-dynamiclib -fno-common -single_module -framework JavaVM"
|
---|
177 | fi
|
---|
178 | if test "`(uname -s) 2> /dev/null`" = 'SunOS'; then
|
---|
179 | AC_MSG_RESULT(Solaris)
|
---|
180 | JNIINC="-I\$(JAVA_HOME)/include/solaris "
|
---|
181 | fi
|
---|
182 | if test "`(uname -s) 2> /dev/null`" = 'Linux'; then
|
---|
183 | AC_MSG_RESULT(Linux)
|
---|
184 | JNIINC="-I\$(JAVA_HOME)/include/linux -I\$(JAVA_HOME)/include "
|
---|
185 | fi
|
---|
186 |
|
---|
187 | if test "x$crossOS" != "x" ; then
|
---|
188 | if test "$crossOS" = "windows" ; then
|
---|
189 | JNIINC="-I../../java-windows-include/win32 -I../../java-windows-include "
|
---|
190 | JNICFLAGS="-shared -Wall -D_JNI_IMPLEMENTATION_ -Wl,--kill-at"
|
---|
191 | JNIPREFIX=""
|
---|
192 | JNISUFFIX="dll"
|
---|
193 | fi
|
---|
194 | fi
|
---|
195 |
|
---|
196 | AC_SUBST(JNIINC)
|
---|
197 | AC_SUBST(JNIPREFIX)
|
---|
198 | AC_SUBST(JNISUFFIX)
|
---|
199 | AC_SUBST(JNICFLAGS)
|
---|
200 | AC_SUBST(JNILDFLAGS)
|
---|
201 |
|
---|
202 | # *** Custom checking (based on GNU tar configure.in) ***
|
---|
203 | # ---------------------------------------------------------------------------
|
---|
204 | AC_MSG_CHECKING(for HP-UX needing gmalloc)
|
---|
205 | if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
|
---|
206 | AC_MSG_RESULT(yes)
|
---|
207 | AC_LIBOBJ(gmalloc)
|
---|
208 | AC_DEFINE(HAVE_VALLOC)
|
---|
209 | else
|
---|
210 | AC_MSG_RESULT(no)
|
---|
211 | AC_CHECK_FUNCS(valloc)
|
---|
212 | fi
|
---|
213 |
|
---|
214 | fp_WITH_DMALLOC
|
---|
215 | fp_WITH_REGEX
|
---|
216 | fp_WITH_GNU_READLINE
|
---|
217 |
|
---|
218 | # text for endianness
|
---|
219 | AC_C_BIGENDIAN
|
---|
220 |
|
---|
221 | # ---------------------------------------------------------------------------
|
---|
222 | if test "$ac_cv_func_alloca" = 'no'; then
|
---|
223 | dnl support functions for alloca.c
|
---|
224 | AC_LIBOBJ(xmalloc)
|
---|
225 | AC_LIBOBJ(error)
|
---|
226 | fi
|
---|
227 |
|
---|
228 |
|
---|
229 | # ---------------------------------------------------------------------------
|
---|
230 | # see if the user wants to override use of long long
|
---|
231 | AC_ARG_ENABLE(override-longlong,
|
---|
232 | [ --enable-override-longlong
|
---|
233 | overide use of long long with GCC],
|
---|
234 | AC_DEFINE(DISABLE_LONG_LONG))
|
---|
235 |
|
---|
236 |
|
---|
237 | # ---------------------------------------------------------------------------
|
---|
238 |
|
---|
239 | AC_OUTPUT([Makefile text/Makefile lib/Makefile
|
---|
240 | jni/Makefile java/org/greenstone/mgpp/Makefile],
|
---|
241 | [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
|
---|