1 | dnl Process this file with autoconf to produce a configure script.
|
---|
2 | dnl Use autoconf-2.59 or later... it might not work anymore with
|
---|
3 | dnl the older 2.1x versions - jrm21 12/2004
|
---|
4 | AC_INIT()
|
---|
5 | AC_CONFIG_HEADER(config.h)
|
---|
6 |
|
---|
7 | PACKAGE=gsdl
|
---|
8 | VERSION=2.82-svn
|
---|
9 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
|
---|
10 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
|
---|
11 | AC_SUBST(PACKAGE)
|
---|
12 | AC_SUBST(VERSION)
|
---|
13 |
|
---|
14 | dnl
|
---|
15 | dnl Set use of fast cgi
|
---|
16 | dnl
|
---|
17 | USE_FASTCGI=0
|
---|
18 | if test USE_FASTCGI = 1; then
|
---|
19 | AC_DEFINE(USE_FASTCGI)
|
---|
20 | AC_SUBST(USE_FASTCGI)
|
---|
21 | fi
|
---|
22 |
|
---|
23 | dnl
|
---|
24 | dnl Set use of langaction
|
---|
25 | dnl
|
---|
26 | dnl USE_LANGACTION=0
|
---|
27 | if test USE_LANGACTION = 1; then
|
---|
28 | AC_DEFINE(USE_LANGACTION)
|
---|
29 | AC_SUBST(USE_LANGACTION)
|
---|
30 | fi
|
---|
31 |
|
---|
32 | dnl
|
---|
33 | dnl Set use of corba
|
---|
34 | dnl
|
---|
35 | AC_ARG_ENABLE(corba, [ --enable-corba Enable CORBA support], USE_CORBA=1, USE_CORBA=0)
|
---|
36 | AC_DEFINE_UNQUOTED(USE_CORBA, $USE_CORBA)
|
---|
37 | AC_SUBST(USE_CORBA)
|
---|
38 |
|
---|
39 | AC_ARG_WITH(micodir, [ --with-micodir Use installed MICO directory], MICO_DIR=$enableval, MICO_DIR="default")
|
---|
40 | AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR")
|
---|
41 | AC_SUBST(MICO_DIR)
|
---|
42 |
|
---|
43 | dnl
|
---|
44 | dnl Set use of z39.50
|
---|
45 | dnl
|
---|
46 | AC_ARG_ENABLE(z3950, [ --enable-z3950 Enable Z39.50 client support], USE_Z3950=1, USE_Z3950=0)
|
---|
47 | if test USE_Z3950 = 1; then
|
---|
48 | AC_DEFINE(USE_Z3950, $USE_Z3950)
|
---|
49 | AC_SUBST(USE_Z3950)
|
---|
50 | fi
|
---|
51 |
|
---|
52 | dnl
|
---|
53 | dnl Set use of yaz - now compiled by default even when z3950 support not required
|
---|
54 | dnl
|
---|
55 | AC_ARG_ENABLE(yaz, [ --disable-yaz Disable YAZ compilation], USE_YAZ=0, USE_YAZ=1)
|
---|
56 | dnl if test USE_YAZ = 1; then
|
---|
57 | AC_DEFINE(USE_YAZ, $USE_YAZ)
|
---|
58 | AC_SUBST(USE_YAZ)
|
---|
59 | dnl fi
|
---|
60 |
|
---|
61 |
|
---|
62 | dnl disable compilation of accent folding stuff for mgpp (and one day mg)
|
---|
63 | dnl
|
---|
64 | AC_ARG_ENABLE(accentfold, [ --disable-accentfold Disable Accent Folding for MGPP], ENABLE_ACCENTFOLD=0, ENABLE_ACCENTFOLD=1)
|
---|
65 | AC_DEFINE(ENABLE_ACCENTFOLD, $ENABLE_ACCENTFOLD)
|
---|
66 | AC_SUBST(ENABLE_ACCENTFOLD)
|
---|
67 |
|
---|
68 |
|
---|
69 | dnl
|
---|
70 | dnl disable compilation of accent folding stuff for mgpp (and one day mg)
|
---|
71 | dnl
|
---|
72 | AC_ARG_ENABLE(accentfold, [ --disable-accentfold Disable Accent Folding for\
|
---|
73 | MGPP], ENABLE_ACCENTFOLD=0, ENABLE_ACCENTFOLD=1)
|
---|
74 | AC_DEFINE(ENABLE_ACCENTFOLD, $ENABLE_ACCENTFOLD)
|
---|
75 | AC_SUBST(ENABLE_ACCENTFOLD)
|
---|
76 |
|
---|
77 | dnl
|
---|
78 | dnl Set use of JDBM (enabled by default)
|
---|
79 | dnl
|
---|
80 | dnl
|
---|
81 | dnl Set use of JDBM (enabled by default)
|
---|
82 | dnl
|
---|
83 | AC_ARG_ENABLE(jdbm, [ --disable-jdbm Disable JDBM compilation], ENABLE_JDBM=$enableval, ENABLE_JDBM=yes)
|
---|
84 | if test $ENABLE_JDBM = "yes" -o $ENABLE_JDBM = "1" ; then
|
---|
85 | ENABLE_JDBM=1
|
---|
86 | AC_DEFINE(ENABLE_JDBM,[])
|
---|
87 | else
|
---|
88 | ENABLE_JDBM=0
|
---|
89 | fi
|
---|
90 | AC_SUBST(ENABLE_JDBM)
|
---|
91 |
|
---|
92 |
|
---|
93 | dnl
|
---|
94 | dnl Set use of SQLite (enabled by default)
|
---|
95 | dnl
|
---|
96 | AC_ARG_ENABLE(sqlite, [ --disable-sqlite Disable SQLite support], USE_SQLITE=0, USE_SQLITE=1)
|
---|
97 | AC_DEFINE(USE_SQLITE, $USE_SQLITE)
|
---|
98 | AC_SUBST(USE_SQLITE)
|
---|
99 |
|
---|
100 | dnl
|
---|
101 | dnl Set compilation of JNI parts of MG and MGPP indexers (disabled by default, which is GS2's default behaviour)
|
---|
102 | dnl
|
---|
103 | AC_ARG_ENABLE(jni, [ --enable-jni Enable JNI compilation], ENABLE_JNI=$enableval, ENABLE_JNI=no)
|
---|
104 | if test $ENABLE_JNI = "yes" -o $ENABLE_JNI = "1" ; then
|
---|
105 | ENABLE_JNI=1
|
---|
106 | AC_DEFINE(ENABLE_JNI,[])
|
---|
107 | else
|
---|
108 | ENABLE_JNI=0
|
---|
109 | fi
|
---|
110 | AC_SUBST(ENABLE_JNI)
|
---|
111 |
|
---|
112 | dnl
|
---|
113 | dnl Set compilation of MG (enabled by default)
|
---|
114 | dnl
|
---|
115 | AC_ARG_ENABLE(mg, [ --disable-mg Disable MG compilation], ENABLE_MG=$enableval, ENABLE_MG=yes)
|
---|
116 | if test $ENABLE_MG = "yes" -o $ENABLE_MG = "1" ; then
|
---|
117 | ENABLE_MG=1
|
---|
118 | AC_DEFINE(ENABLE_MG,[])
|
---|
119 | else
|
---|
120 | ENABLE_MG=0
|
---|
121 | fi
|
---|
122 | AC_SUBST(ENABLE_MG)
|
---|
123 |
|
---|
124 | dnl
|
---|
125 | dnl Set compilation of MGPP (enabled by default)
|
---|
126 | dnl
|
---|
127 | AC_ARG_ENABLE(mgpp, [ --disable-mgpp Disable MGPP compilation], ENABLE_MGPP=$enableval, ENABLE_MGPP=yes)
|
---|
128 | if test $ENABLE_MGPP = "yes" -o $ENABLE_MGPP = "1" ; then
|
---|
129 | ENABLE_MGPP=1
|
---|
130 | AC_DEFINE(ENABLE_MGPP,[])
|
---|
131 | else
|
---|
132 | ENABLE_MGPP=0
|
---|
133 | fi
|
---|
134 | AC_SUBST(ENABLE_MGPP)
|
---|
135 |
|
---|
136 | dnl
|
---|
137 | dnl Set compilation of lucene (enabled by default)
|
---|
138 | dnl
|
---|
139 | AC_ARG_ENABLE(lucene, [ --disable-lucene Disable Lucene compilation], ENABLE_LUCENE=$enableval, ENABLE_LUCENE=yes)
|
---|
140 | if test $ENABLE_LUCENE = "yes" -o $ENABLE_LUCENE = "1" ; then
|
---|
141 | ENABLE_LUCENE=1
|
---|
142 | AC_DEFINE(ENABLE_LUCENE, [])
|
---|
143 | else
|
---|
144 | ENABLE_LUCENE=0
|
---|
145 | fi
|
---|
146 | AC_SUBST(ENABLE_LUCENE)
|
---|
147 |
|
---|
148 |
|
---|
149 |
|
---|
150 | dnl Checks for programs.
|
---|
151 | LDFLAGS=$LDFLAGS
|
---|
152 | AC_SUBST(LDFLAGS)
|
---|
153 | dnl only set CFLAGS if not already set in environment
|
---|
154 | if test -z "$CFLAGS"; then
|
---|
155 | CFLAGS=-O2
|
---|
156 | fi
|
---|
157 | AC_SUBST(CFLAGS)
|
---|
158 |
|
---|
159 |
|
---|
160 | AC_PROG_CC
|
---|
161 | AC_PROG_CXX
|
---|
162 | AC_PROG_AWK
|
---|
163 | AC_PROG_YACC
|
---|
164 | dnl get $target_cpu, $target_vendor, and $target_os
|
---|
165 | dnl (as well as host_*)
|
---|
166 | AC_CANONICAL_SYSTEM
|
---|
167 | dnl do we actually want this? It adds a prefix based on host, system etc
|
---|
168 | dnl AC_ARG_PROGRAM
|
---|
169 | AC_PROG_INSTALL
|
---|
170 | AC_PROG_LN_S
|
---|
171 | AC_PROG_MAKE_SET
|
---|
172 | AC_PROG_RANLIB
|
---|
173 |
|
---|
174 | AC_MSG_CHECKING(to see if architecture is 64-bit)
|
---|
175 | arch_64bit=no
|
---|
176 | case "$host_cpu" in
|
---|
177 | x86_64) arch_64bit=yes ;;
|
---|
178 | esac
|
---|
179 |
|
---|
180 | if test "$arch_64bit" = yes; then
|
---|
181 | AC_MSG_RESULT(yes)
|
---|
182 | if test -z "$COMPAT32BITFLAGS" ; then
|
---|
183 | COMPAT32BITFLAGS="-m32"
|
---|
184 | fi
|
---|
185 | else
|
---|
186 | AC_MSG_RESULT(no)
|
---|
187 | if test -z "$COMPAT32BITFLAGS" ; then
|
---|
188 | COMPAT32BITFLAGS=
|
---|
189 | fi
|
---|
190 | fi
|
---|
191 | export COMPAT32BITFLAGS
|
---|
192 | AC_SUBST(COMPAT32BITFLAGS)
|
---|
193 |
|
---|
194 |
|
---|
195 | #moved CORBA MICO directory test to get version of MICO
|
---|
196 | if test $USE_CORBA = 1; then
|
---|
197 |
|
---|
198 | if test $MICO_DIR = "default"; then
|
---|
199 | #do something
|
---|
200 | MICO_INC="-I packages/mico/mico/include"
|
---|
201 | else
|
---|
202 | #build the micotest program
|
---|
203 | MICO_INC= ""
|
---|
204 | if test $MICO_DIR != yes; then
|
---|
205 | MICO_INC="-I $MICO_DIR"
|
---|
206 | fi
|
---|
207 | fi
|
---|
208 |
|
---|
209 | #get MICO_VER value
|
---|
210 | sh -c "$CC -c micotest.cpp -o micotest.o $MICO_INC 2>&1" > /dev/null
|
---|
211 | sh -c "$CC -o micotest micotest.o -lstdc++ 2>&1" > /dev/null
|
---|
212 | MICO_VER=`./micotest` || MICO_VER=2.3.5
|
---|
213 | sh -c "rm micotest"
|
---|
214 | sh -c "rm micotest.o"
|
---|
215 |
|
---|
216 | #do test of MICO_VER
|
---|
217 | if test MICO_VER != 0; then
|
---|
218 | AC_DEFINE(MICO_VER)
|
---|
219 | AC_SUBST(MICO_VER)
|
---|
220 | fi
|
---|
221 | #end USE_CORBA test
|
---|
222 | fi
|
---|
223 |
|
---|
224 | dnl Checks for typedefs, structures, and compiler characteristics.
|
---|
225 | AC_AIX
|
---|
226 | AC_ISC_POSIX
|
---|
227 | AC_MINIX
|
---|
228 | fp_C_PROTOTYPES
|
---|
229 | AC_C_CONST
|
---|
230 | AC_TYPE_OFF_T
|
---|
231 | AC_TYPE_SIZE_T
|
---|
232 | AC_HEADER_TIME
|
---|
233 | AC_STRUCT_TM
|
---|
234 |
|
---|
235 | dnl --- This should be in the stdc checking -----------------
|
---|
236 | if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
|
---|
237 | dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
|
---|
238 | dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
|
---|
239 | dnl XOPEN extensions (like popen).
|
---|
240 | dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
|
---|
241 | dnl needs. So drop back to -Xa
|
---|
242 | AC_TRY_COMPILE(
|
---|
243 | [#include <stdio.h>
|
---|
244 | ], [ FILE *rubbish = popen("yes", "r"); ],,
|
---|
245 | [CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
|
---|
246 | fi
|
---|
247 | dnl ----------------------
|
---|
248 |
|
---|
249 |
|
---|
250 | dnl Checks for libraries.
|
---|
251 | dnl check for -lg:
|
---|
252 | AC_HAVE_LIBRARY(g)
|
---|
253 | dnl check for -lm:
|
---|
254 | AC_HAVE_LIBRARY(m)
|
---|
255 | dnl check for -lcrypt:
|
---|
256 | AC_HAVE_LIBRARY(crypt)
|
---|
257 | if test $ENABLE_ACCENTFOLD = 1; then
|
---|
258 | AC_HAVE_LIBRARY(iconv)
|
---|
259 | fi
|
---|
260 |
|
---|
261 | dnl Checks for header files.
|
---|
262 | AC_HEADER_DIRENT
|
---|
263 | AC_HEADER_STDC
|
---|
264 | AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h sys/stat.h)
|
---|
265 | AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
|
---|
266 | AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
|
---|
267 | AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
|
---|
268 |
|
---|
269 | dnl Checks for library functions.
|
---|
270 | AC_FUNC_ALLOCA
|
---|
271 | AC_PROG_GCC_TRADITIONAL
|
---|
272 | AC_TYPE_SIGNAL
|
---|
273 | AC_FUNC_VPRINTF
|
---|
274 | AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
|
---|
275 | AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
|
---|
276 |
|
---|
277 | dnl see if gettext is in libc. (try the textdomain() function).
|
---|
278 | AC_CHECK_FUNC(textdomain, AC_DEFINE(ENABLE_NLS ,1) )
|
---|
279 |
|
---|
280 | # *** Custom checking (based on GNU tar configure.in) ***
|
---|
281 | # ---------------------------------------------------------------------------
|
---|
282 | AC_MSG_CHECKING(for HP-UX needing gmalloc)
|
---|
283 | if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
|
---|
284 | AC_MSG_RESULT(yes)
|
---|
285 | AC_LIBOBJ([gmalloc])
|
---|
286 | AC_DEFINE(HAVE_VALLOC)
|
---|
287 | else
|
---|
288 | AC_MSG_RESULT(no)
|
---|
289 | AC_CHECK_FUNCS(valloc)
|
---|
290 | fi
|
---|
291 |
|
---|
292 | # we cannot generate static libraries under Darwin
|
---|
293 | AC_MSG_CHECKING(for Apple MacOS X/Darwin)
|
---|
294 | if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
|
---|
295 | AC_MSG_RESULT(yes)
|
---|
296 | STATIC=""
|
---|
297 | else
|
---|
298 | AC_MSG_RESULT(no)
|
---|
299 | STATIC="-static "
|
---|
300 | fi
|
---|
301 | AC_SUBST(STATIC)
|
---|
302 |
|
---|
303 | fp_WITH_DMALLOC
|
---|
304 | fp_WITH_REGEX
|
---|
305 |
|
---|
306 | # ---------------------------------------------------------------------------
|
---|
307 | if test "$ac_cv_func_alloca" = 'no'; then
|
---|
308 | dnl support functions for alloca.c
|
---|
309 | AC_LIBOBJ([xmalloc])
|
---|
310 | AC_LIBOBJ([error])
|
---|
311 | fi
|
---|
312 |
|
---|
313 |
|
---|
314 | # ---------------------------------------------------------------------------
|
---|
315 |
|
---|
316 | dnl
|
---|
317 | dnl Switch into C++
|
---|
318 | dnl
|
---|
319 | AC_LANG_CPLUSPLUS
|
---|
320 |
|
---|
321 | dnl
|
---|
322 | dnl Check if the STL library has any known faults;
|
---|
323 | dnl In GCC 2.7.2.x series, some STL library headers are missing
|
---|
324 | dnl a file called "new" which is referred to by other headers
|
---|
325 | dnl (eg. vector/vector.h); if this applies, then all use of the
|
---|
326 | dnl STL will cause a compile fail, so we'd better let the user
|
---|
327 | dnl know now, before things really go wrong!
|
---|
328 | dnl
|
---|
329 | success=no
|
---|
330 | AC_MSG_CHECKING("whether STL library has known faults")
|
---|
331 |
|
---|
332 | dnl - first shot, try simple good old vector on its own
|
---|
333 | AC_TRY_COMPILE(
|
---|
334 | [#include <vector>
|
---|
335 | ],
|
---|
336 | [],
|
---|
337 | success=yes,
|
---|
338 | )
|
---|
339 |
|
---|
340 | dnl - try using the .h equivalent
|
---|
341 | if test $success = "no"; then
|
---|
342 | AC_TRY_COMPILE(
|
---|
343 | [#include <vector.h>
|
---|
344 | ],
|
---|
345 | [],
|
---|
346 | success="yes",
|
---|
347 | )
|
---|
348 | fi
|
---|
349 |
|
---|
350 | dnl - now try for the objectspace headers
|
---|
351 | if test $success = "no"; then
|
---|
352 | AC_TRY_COMPILE(
|
---|
353 | [#include <ospace\\std\\vector>
|
---|
354 | ],
|
---|
355 | [],
|
---|
356 | success="yes",
|
---|
357 | )
|
---|
358 | fi
|
---|
359 |
|
---|
360 | if test $success = yes; then
|
---|
361 | AC_MSG_RESULT("no")
|
---|
362 | else
|
---|
363 | AC_MSG_RESULT("yes")
|
---|
364 | AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
|
---|
365 | fi
|
---|
366 |
|
---|
367 | gsdlos=`uname | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
|
---|
368 | # check for running bash under cygwin
|
---|
369 | if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ;
|
---|
370 | then
|
---|
371 | gsdlos=windows
|
---|
372 | fi
|
---|
373 | AC_SUBST(gsdlos)
|
---|
374 |
|
---|
375 | # check for endianness
|
---|
376 | AC_C_BIGENDIAN
|
---|
377 | # ---------------------------------------------------------------------------
|
---|
378 | if test "$ac_cv_func_alloca" = 'no'; then
|
---|
379 | dnl support functions for alloca.c
|
---|
380 | AC_LIBOBJ([xmalloc.o])
|
---|
381 | AC_LIBOBJ([error])
|
---|
382 | fi
|
---|
383 |
|
---|
384 | # ---------------------------------------------------------------------------
|
---|
385 |
|
---|
386 | dnl
|
---|
387 | dnl Locate all children of the modules folder
|
---|
388 | dnl
|
---|
389 | moduleDirs=""
|
---|
390 | MODULEDIRS=""
|
---|
391 | if test -d modules ; then
|
---|
392 | for x in `find modules -mindepth 1 -maxdepth 2`; do
|
---|
393 | if test -d "$x"; then
|
---|
394 | d="$x/Makefile.in"
|
---|
395 | if test -e "$d"; then
|
---|
396 | dnl echo $d
|
---|
397 | moduleDirs="$moduleDirs $x/Makefile"
|
---|
398 | MODULEDIRS="$MODULEDIRS $x"
|
---|
399 | fi
|
---|
400 | fi
|
---|
401 | done
|
---|
402 | echo "Making $moduleDirs in modules directory"
|
---|
403 | AC_SUBST(MODULEDIRS)
|
---|
404 | fi
|
---|
405 |
|
---|
406 |
|
---|
407 | # ---------------------------------------------------------------------------
|
---|
408 | dnl for Darwin, as our packages don't (yet) correctly guess our system type.
|
---|
409 | dnl not needed any more?
|
---|
410 | dnl ac_configure_args="$ac_configure_args --build=$build --target=$target"
|
---|
411 |
|
---|
412 | # indexers needs a bindir option to get the binaries into the right place
|
---|
413 | gsdlprefix=`pwd`
|
---|
414 | ac_configure_args="$ac_configure_args --bindir=$gsdlprefix/bin/$gsdlos "
|
---|
415 | AC_CONFIG_SUBDIRS(common-src runtime-src)
|
---|
416 |
|
---|
417 | # the list of folders in the src folder
|
---|
418 | srclist="common-src/Makefile \
|
---|
419 | runtime-src/Makefile"
|
---|
420 |
|
---|
421 | AC_OUTPUT(Makefile $srclist $moduleDirs)
|
---|
422 |
|
---|
423 |
|
---|