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.x-svn |
---|
9 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") |
---|
10 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION") |
---|
11 | AC_SUBST(PACKAGE) |
---|
12 | AC_SUBST(VERSION) |
---|
13 | |
---|
14 | |
---|
15 | dnl |
---|
16 | dnl Set use of fast cgi |
---|
17 | dnl |
---|
18 | USE_FASTCGI=0 |
---|
19 | if test USE_FASTCGI = 1; then |
---|
20 | AC_DEFINE(USE_FASTCGI) |
---|
21 | AC_SUBST(USE_FASTCGI) |
---|
22 | fi |
---|
23 | |
---|
24 | dnl |
---|
25 | dnl Set use of langaction |
---|
26 | dnl |
---|
27 | dnl USE_LANGACTION=0 |
---|
28 | if test USE_LANGACTION = 1; then |
---|
29 | AC_DEFINE(USE_LANGACTION) |
---|
30 | AC_SUBST(USE_LANGACTION) |
---|
31 | fi |
---|
32 | |
---|
33 | dnl |
---|
34 | dnl Set use of corba |
---|
35 | dnl |
---|
36 | AC_ARG_ENABLE(corba, [ --enable-corba Enable CORBA support], USE_CORBA=$enableval, USE_CORBA=no) |
---|
37 | if test $USE_CORBA = "yes" -o $USE_CORBA = "1" ; then |
---|
38 | USE_CORBA=1 |
---|
39 | AC_DEFINE(USE_CORBA,[]) |
---|
40 | else |
---|
41 | USE_CORBA=0 |
---|
42 | fi |
---|
43 | AC_SUBST(USE_CORBA) |
---|
44 | |
---|
45 | AC_ARG_WITH(micodir, [ --with-micodir Use installed MICO directory], MICO_DIR=$withval, MICO_DIR="default") |
---|
46 | AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR") |
---|
47 | AC_SUBST(MICO_DIR) |
---|
48 | |
---|
49 | dnl |
---|
50 | dnl Disable all Java compilation |
---|
51 | dnl |
---|
52 | AC_ARG_ENABLE(java, [ --disable-java Disable Java compilation], ENABLE_JAVA=$enableval, ENABLE_JAVA=yes) |
---|
53 | if test $ENABLE_JAVA = "yes" -o $ENABLE_JAVA = "1" ; then |
---|
54 | ENABLE_JAVA=1 |
---|
55 | if test "x$JAVA_HOME" != "x" ; then |
---|
56 | echo "Detected JAVA_HOME is set, however this will not be used during compilation" |
---|
57 | echo "To control the version of 'javac' and 'java' set environment variables JAVAC" |
---|
58 | echo "and JAVA respectively" |
---|
59 | export JAVA_HOME= |
---|
60 | fi |
---|
61 | else |
---|
62 | ENABLE_JAVA=0 |
---|
63 | fi |
---|
64 | AC_SUBST(ENABLE_JAVA) |
---|
65 | |
---|
66 | dnl |
---|
67 | dnl Set use of z39.50 |
---|
68 | dnl |
---|
69 | AC_ARG_ENABLE(z3950, [ --enable-z3950 Enable Z39.50 client support], USE_Z3950=$enableval, USE_Z3950=no) |
---|
70 | if test $USE_Z3950 = "yes" -o $USE_Z3950 = "1" ; then |
---|
71 | USE_Z3950=1 |
---|
72 | AC_DEFINE(USE_Z3950,[]) |
---|
73 | else |
---|
74 | USE_Z3950=0 |
---|
75 | fi |
---|
76 | AC_SUBST(USE_Z3950) |
---|
77 | |
---|
78 | dnl |
---|
79 | dnl Set use of yaz - now compiled by default even when z3950 support not required |
---|
80 | dnl |
---|
81 | AC_ARG_ENABLE(yaz, [ --disable-yaz Disable YAZ compilation], USE_YAZ=$enableval, USE_YAZ=yes) |
---|
82 | if test $USE_YAZ = "yes" -o $USE_YAZ = "1" ; then |
---|
83 | USE_YAZ=1 |
---|
84 | AC_DEFINE(USE_YAZ,[]) |
---|
85 | else |
---|
86 | USE_YAZ=0 |
---|
87 | fi |
---|
88 | AC_SUBST(USE_YAZ) |
---|
89 | |
---|
90 | dnl |
---|
91 | dnl Set use of wvware (enabled by default) |
---|
92 | dnl |
---|
93 | AC_ARG_ENABLE(wvware, [ --disable-wvware Disable wvWare compilation], USE_WVWARE=$enableval, USE_WVWARE=yes) |
---|
94 | if test $USE_WVWARE = "yes" -o $USE_WVWARE = "1" ; then |
---|
95 | USE_WVWARE=1 |
---|
96 | AC_DEFINE(USE_WVWARE,[]) |
---|
97 | else |
---|
98 | USE_WVWARE=0 |
---|
99 | fi |
---|
100 | AC_SUBST(USE_WVWARE) |
---|
101 | |
---|
102 | dnl |
---|
103 | dnl Set use of JDBM (enabled by default) |
---|
104 | dnl |
---|
105 | AC_ARG_ENABLE(jdbm, [ --disable-jdbm Disable JDBM compilation], USE_JDBM=$enableval, USE_JDBM=yes) |
---|
106 | if test $ENABLE_JAVA = "1" -a \( $USE_JDBM = "yes" -o $USE_JDBM = "1" \) ; then |
---|
107 | USE_JDBM=1 |
---|
108 | AC_DEFINE(USE_JDBM,[]) |
---|
109 | else |
---|
110 | USE_JDBM=0 |
---|
111 | fi |
---|
112 | AC_SUBST(USE_JDBM) |
---|
113 | |
---|
114 | dnl |
---|
115 | dnl Set use of GDBM (enabled by default) |
---|
116 | dnl |
---|
117 | AC_ARG_ENABLE(gdbm, [ --disable-gdbm Disable GDBM compilation], USE_GDBM=$enableval, USE_GDBM=yes) |
---|
118 | if test $USE_GDBM = "yes" -o $USE_GDBM = "1" ; then |
---|
119 | USE_GDBM=1 |
---|
120 | AC_DEFINE(USE_GDBM,[]) |
---|
121 | else |
---|
122 | USE_GDBM=0 |
---|
123 | fi |
---|
124 | AC_SUBST(USE_GDBM) |
---|
125 | |
---|
126 | dnl |
---|
127 | dnl disable compilation of accent folding stuff for mgpp (and one day mg) |
---|
128 | dnl |
---|
129 | AC_ARG_ENABLE(accentfold, [ --disable-accentfold Disable Accent Folding for MGPP], ENABLE_ACCENTFOLD=$enableval, ENABLE_ACCENTFOLD=yes) |
---|
130 | if test $ENABLE_ACCENTFOLD = "yes" -o $ENABLE_ACCENTFOLD = "1" ; then |
---|
131 | ENABLE_ACCENTFOLD=1 |
---|
132 | AC_DEFINE(ENABLE_ACCENTFOLD,[]) |
---|
133 | else |
---|
134 | ENABLE_ACCENTFOLD=0 |
---|
135 | fi |
---|
136 | AC_SUBST(ENABLE_ACCENTFOLD) |
---|
137 | |
---|
138 | dnl |
---|
139 | dnl Set use of SQLite (enabled by default) |
---|
140 | dnl |
---|
141 | AC_ARG_ENABLE(sqlite, [ --disable-sqlite Disable SQLite support], USE_SQLITE=$enableval, USE_SQLITE=yes) |
---|
142 | if test $USE_SQLITE = "yes" -o $USE_SQLITE = "1" ; then |
---|
143 | USE_SQLITE=1 |
---|
144 | AC_DEFINE(USE_SQLITE,[]) |
---|
145 | else |
---|
146 | USE_SQLITE=0 |
---|
147 | fi |
---|
148 | AC_SUBST(USE_SQLITE) |
---|
149 | |
---|
150 | dnl |
---|
151 | dnl Set use of RSS (enabled by default) |
---|
152 | dnl |
---|
153 | AC_ARG_ENABLE(rss, [ --disable-rss Disable RSS support], USE_RSS=$enableval, USE_RSS=yes) |
---|
154 | if test $USE_RSS = "yes" -o $USE_RSS = "1" ; then |
---|
155 | USE_RSS=1 |
---|
156 | AC_DEFINE(USE_RSS,[]) |
---|
157 | else |
---|
158 | USE_RSS=0 |
---|
159 | fi |
---|
160 | AC_SUBST(USE_RSS) |
---|
161 | |
---|
162 | |
---|
163 | dnl |
---|
164 | dnl Set use of Apache httpd (disabled by default) |
---|
165 | dnl |
---|
166 | if test -d runtime-src; then |
---|
167 | AC_ARG_ENABLE(apache-httpd, [ --enable-apache-httpd Enable Apache httpd support], USE_APACHE_HTTPD=$enableval, USE_APACHE_HTTPD=no) |
---|
168 | if test $USE_APACHE_HTTPD = "yes" -o $USE_APACHE_HTTPD = "1" ; then |
---|
169 | USE_APACHE_HTTPD=1 |
---|
170 | AC_DEFINE(USE_APACHE_HTTPD,[]) |
---|
171 | else |
---|
172 | USE_APACHE_HTTPD=0 |
---|
173 | fi |
---|
174 | AC_SUBST(USE_APACHE_HTTPD) |
---|
175 | fi |
---|
176 | |
---|
177 | dnl |
---|
178 | dnl Set compilation of JNI parts of MG and MGPP indexers (disabled by default, which is GS2's default behaviour) |
---|
179 | dnl |
---|
180 | AC_ARG_ENABLE(jni, [ --enable-jni Enable JNI compilation], ENABLE_JNI=$enableval, ENABLE_JNI=no) |
---|
181 | if test $ENABLE_JAVA = "1" -a \( $ENABLE_JNI = "yes" -o $ENABLE_JNI = "1" \) ; then |
---|
182 | ENABLE_JNI=1 |
---|
183 | AC_DEFINE(ENABLE_JNI,[]) |
---|
184 | else |
---|
185 | ENABLE_JNI=0 |
---|
186 | fi |
---|
187 | AC_SUBST(ENABLE_JNI) |
---|
188 | |
---|
189 | dnl |
---|
190 | dnl Set compilation of MG (enabled by default) |
---|
191 | dnl |
---|
192 | AC_ARG_ENABLE(mg, [ --disable-mg Disable MG compilation], ENABLE_MG=$enableval, ENABLE_MG=yes) |
---|
193 | if test $ENABLE_MG = "yes" -o $ENABLE_MG = "1" ; then |
---|
194 | ENABLE_MG=1 |
---|
195 | AC_DEFINE(ENABLE_MG,[]) |
---|
196 | else |
---|
197 | ENABLE_MG=0 |
---|
198 | fi |
---|
199 | AC_SUBST(ENABLE_MG) |
---|
200 | |
---|
201 | |
---|
202 | dnl |
---|
203 | dnl Set compilation of MGPP (enabled by default) |
---|
204 | dnl |
---|
205 | AC_ARG_ENABLE(mgpp, [ --disable-mgpp Disable MGPP compilation], ENABLE_MGPP=$enableval, ENABLE_MGPP=yes) |
---|
206 | if test $ENABLE_MGPP = "yes" -o $ENABLE_MGPP = "1" ; then |
---|
207 | ENABLE_MGPP=1 |
---|
208 | AC_DEFINE(ENABLE_MGPP,[]) |
---|
209 | else |
---|
210 | ENABLE_MGPP=0 |
---|
211 | fi |
---|
212 | AC_SUBST(ENABLE_MGPP) |
---|
213 | |
---|
214 | dnl |
---|
215 | dnl Set compilation of lucene (enabled by default) |
---|
216 | dnl |
---|
217 | AC_ARG_ENABLE(lucene, [ --disable-lucene Disable Lucene compilation], ENABLE_LUCENE=$enableval, ENABLE_LUCENE=yes) |
---|
218 | if test $ENABLE_JAVA = "1" -a \( $ENABLE_LUCENE = "yes" -o $ENABLE_LUCENE = "1" \) ; then |
---|
219 | ENABLE_LUCENE=1 |
---|
220 | AC_DEFINE(ENABLE_LUCENE,[]) |
---|
221 | else |
---|
222 | ENABLE_LUCENE=0 |
---|
223 | fi |
---|
224 | AC_SUBST(ENABLE_LUCENE) |
---|
225 | |
---|
226 | |
---|
227 | dnl |
---|
228 | dnl Set compilation and/or sourcing of gnome-lib extension (disabled by default) |
---|
229 | dnl |
---|
230 | AC_ARG_ENABLE(gnome-lib-ext, [ --enable-gnome-lib-ext Enable the gnome-lib extension], ENABLE_GNOMELIB_EXT=1, ENABLE_GNOMELIB_EXT=0) |
---|
231 | if test -d ext/gnome-lib ; then |
---|
232 | AC_DEFINE(ENABLE_GNOMELIB_EXT, $ENABLE_GNOMELIB_EXT) |
---|
233 | elif test -f ext/gnome-lib-minimal/devel.bash ; then |
---|
234 | AC_DEFINE(ENABLE_GNOMELIB_EXT, $ENABLE_GNOMELIB_EXT) |
---|
235 | else |
---|
236 | # Running `svn` returns 127 if no svn is installed. It returns 1 if svn is installed, |
---|
237 | # since it suggests running svn --help. It returns 0 if running `svn --version` |
---|
238 | |
---|
239 | if test $ENABLE_GNOMELIB_EXT = 1; then |
---|
240 | svn --version |
---|
241 | result=$? |
---|
242 | if test $result = 0; then |
---|
243 | cd ext |
---|
244 | svn co http://svn.greenstone.org/gs2-extensions/gnome-lib/trunk/src gnome-lib |
---|
245 | cd .. |
---|
246 | AC_DEFINE(ENABLE_GNOMELIB_EXT, 1) |
---|
247 | else |
---|
248 | echo "**** WARNING: No gnome-lib or gnome-lib-minimal(/devel.bash) in gs2build/ext folder. Unable to check out gnome-lib. Disabling gnome-lib-ext." |
---|
249 | AC_DEFINE(ENABLE_GNOMELIB_EXT, 0) |
---|
250 | fi |
---|
251 | fi |
---|
252 | fi |
---|
253 | AC_SUBST(ENABLE_GNOMELIB_EXT) |
---|
254 | |
---|
255 | |
---|
256 | dnl Checks for programs. |
---|
257 | LDFLAGS=$LDFLAGS |
---|
258 | AC_SUBST(LDFLAGS) |
---|
259 | dnl only set CFLAGS if not already set in environment |
---|
260 | if test -z "$CFLAGS"; then |
---|
261 | CFLAGS=-O2 |
---|
262 | fi |
---|
263 | AC_SUBST(CFLAGS) |
---|
264 | |
---|
265 | |
---|
266 | AC_PROG_CC |
---|
267 | AC_PROG_CXX |
---|
268 | AC_PROG_AWK |
---|
269 | AC_PROG_YACC |
---|
270 | dnl get $target_cpu, $target_vendor, and $target_os |
---|
271 | dnl (as well as host_*) |
---|
272 | AC_CANONICAL_SYSTEM |
---|
273 | dnl do we actually want this? It adds a prefix based on host, system etc |
---|
274 | dnl AC_ARG_PROGRAM |
---|
275 | AC_PROG_INSTALL |
---|
276 | AC_PROG_LN_S |
---|
277 | AC_PROG_MAKE_SET |
---|
278 | AC_PROG_RANLIB |
---|
279 | |
---|
280 | AC_MSG_CHECKING(to see if architecture is 64-bit) |
---|
281 | arch_64bit=no |
---|
282 | case "$host_cpu" in |
---|
283 | x86_64) arch_64bit=yes ;; |
---|
284 | esac |
---|
285 | |
---|
286 | if test "$arch_64bit" = yes; then |
---|
287 | AC_MSG_RESULT(yes) |
---|
288 | if test -z "$ARCH_DEP_FLAGS" ; then |
---|
289 | ARCH_DEP_FLAGS=-fPIC |
---|
290 | fi |
---|
291 | else |
---|
292 | AC_MSG_RESULT(no) |
---|
293 | if test -z "$ARCH_DEP_FLAGS" ; then |
---|
294 | ARCH_DEP_FLAGS= |
---|
295 | fi |
---|
296 | fi |
---|
297 | |
---|
298 | export ARCH_DEP_FLAGS |
---|
299 | AC_SUBST(ARCH_DEP_FLAGS) |
---|
300 | |
---|
301 | |
---|
302 | #moved CORBA MICO directory test to get version of MICO |
---|
303 | if test $USE_CORBA = 1; then |
---|
304 | |
---|
305 | if test $MICO_DIR = "default"; then |
---|
306 | #do something |
---|
307 | MICO_INC="-I packages/mico/mico/include" |
---|
308 | else |
---|
309 | #build the micotest program |
---|
310 | MICO_INC= "" |
---|
311 | if test $MICO_DIR != yes; then |
---|
312 | MICO_INC="-I $MICO_DIR" |
---|
313 | fi |
---|
314 | fi |
---|
315 | |
---|
316 | #get MICO_VER value |
---|
317 | sh -c "$CC -c micotest.cpp -o micotest.o $MICO_INC 2>&1" > /dev/null |
---|
318 | sh -c "$CC -o micotest micotest.o -lstdc++ 2>&1" > /dev/null |
---|
319 | MICO_VER=`./micotest` || MICO_VER=2.3.5 |
---|
320 | sh -c "rm micotest" |
---|
321 | sh -c "rm micotest.o" |
---|
322 | |
---|
323 | #do test of MICO_VER |
---|
324 | if test MICO_VER != 0; then |
---|
325 | AC_DEFINE(MICO_VER) |
---|
326 | AC_SUBST(MICO_VER) |
---|
327 | fi |
---|
328 | #end USE_CORBA test |
---|
329 | fi |
---|
330 | |
---|
331 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
332 | AC_AIX |
---|
333 | AC_ISC_POSIX |
---|
334 | AC_MINIX |
---|
335 | fp_C_PROTOTYPES |
---|
336 | AC_C_CONST |
---|
337 | AC_TYPE_OFF_T |
---|
338 | AC_TYPE_SIZE_T |
---|
339 | AC_HEADER_TIME |
---|
340 | AC_STRUCT_TM |
---|
341 | |
---|
342 | dnl --- This should be in the stdc checking ----------------- |
---|
343 | if test "$ac_cv_prog_cc_stdc" = '-Xc'; then |
---|
344 | dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with |
---|
345 | dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or |
---|
346 | dnl XOPEN extensions (like popen). |
---|
347 | dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg |
---|
348 | dnl needs. So drop back to -Xa |
---|
349 | AC_TRY_COMPILE( |
---|
350 | [#include <stdio.h> |
---|
351 | ], [ FILE *rubbish = popen("yes", "r"); ],, |
---|
352 | [CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa']) |
---|
353 | fi |
---|
354 | dnl ---------------------- |
---|
355 | |
---|
356 | |
---|
357 | dnl Checks for libraries. |
---|
358 | dnl check for -lg: |
---|
359 | AC_HAVE_LIBRARY(g) |
---|
360 | dnl check for -lm: |
---|
361 | AC_HAVE_LIBRARY(m) |
---|
362 | dnl check for -lcrypt: |
---|
363 | AC_HAVE_LIBRARY(crypt) |
---|
364 | #if test $ENABLE_ACCENTFOLD = 1; then |
---|
365 | #AC_HAVE_LIBRARY(iconv) |
---|
366 | #fi |
---|
367 | |
---|
368 | dnl Checks for header files. |
---|
369 | AC_HEADER_DIRENT |
---|
370 | AC_HEADER_STDC |
---|
371 | AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h sys/stat.h) |
---|
372 | AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL)) |
---|
373 | AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL)) |
---|
374 | AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE)) |
---|
375 | |
---|
376 | dnl Checks for library functions. |
---|
377 | AC_FUNC_ALLOCA |
---|
378 | AC_PROG_GCC_TRADITIONAL |
---|
379 | AC_TYPE_SIGNAL |
---|
380 | AC_FUNC_VPRINTF |
---|
381 | AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror) |
---|
382 | AC_REPLACE_FUNCS(ftruncate strstr strcasecmp) |
---|
383 | |
---|
384 | dnl see if gettext is in libc. (try the textdomain() function). |
---|
385 | AC_CHECK_FUNC(textdomain, AC_DEFINE(ENABLE_NLS ,1) ) |
---|
386 | |
---|
387 | # *** Custom checking (based on GNU tar configure.in) *** |
---|
388 | # --------------------------------------------------------------------------- |
---|
389 | AC_MSG_CHECKING(for HP-UX needing gmalloc) |
---|
390 | if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then |
---|
391 | AC_MSG_RESULT(yes) |
---|
392 | AC_LIBOBJ([gmalloc]) |
---|
393 | AC_DEFINE(HAVE_VALLOC) |
---|
394 | else |
---|
395 | AC_MSG_RESULT(no) |
---|
396 | AC_CHECK_FUNCS(valloc) |
---|
397 | fi |
---|
398 | |
---|
399 | # we cannot generate static libraries under Darwin |
---|
400 | AC_MSG_CHECKING(for Apple MacOS X/Darwin) |
---|
401 | if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then |
---|
402 | AC_MSG_RESULT(yes) |
---|
403 | STATIC="" |
---|
404 | else |
---|
405 | AC_MSG_RESULT(no) |
---|
406 | STATIC="-static " |
---|
407 | fi |
---|
408 | AC_SUBST(STATIC) |
---|
409 | |
---|
410 | fp_WITH_DMALLOC |
---|
411 | fp_WITH_REGEX |
---|
412 | |
---|
413 | # --------------------------------------------------------------------------- |
---|
414 | if test "$ac_cv_func_alloca" = 'no'; then |
---|
415 | dnl support functions for alloca.c |
---|
416 | AC_LIBOBJ([xmalloc]) |
---|
417 | AC_LIBOBJ([error]) |
---|
418 | fi |
---|
419 | |
---|
420 | |
---|
421 | # --------------------------------------------------------------------------- |
---|
422 | |
---|
423 | dnl |
---|
424 | dnl Switch into C++ |
---|
425 | dnl |
---|
426 | AC_LANG_CPLUSPLUS |
---|
427 | |
---|
428 | dnl |
---|
429 | dnl Now check that Perl is actually around, and can be found |
---|
430 | dnl |
---|
431 | AC_MSG_CHECKING(that Perl 5 is available) |
---|
432 | success="no" |
---|
433 | pl_path="$PATH" |
---|
434 | IFS="${IFS= }"; pl_save_ifs="$IFS"; IFS=":" |
---|
435 | for pl_dir in $pl_path; do |
---|
436 | test -z "$pl_dir" && pl_dir=. |
---|
437 | if test -x $pl_dir/perl; then |
---|
438 | success="yes" |
---|
439 | break |
---|
440 | fi |
---|
441 | done |
---|
442 | IFS="$pl_save_ifs" |
---|
443 | |
---|
444 | dnl |
---|
445 | dnl Perl actually can be run; now we see if it is version 5 by |
---|
446 | dnl running a sample script (which returns a "clean" version number |
---|
447 | dnl and then tests the result using expr. If perl errors in some |
---|
448 | dnl way (eg. broken Perl executable, missing script), we set a failure |
---|
449 | dnl value ("0") and then proceed as best we can |
---|
450 | dnl |
---|
451 | if test $success = "yes"; then |
---|
452 | try=`perl configtest.pl` || try="0" |
---|
453 | try=`expr $try \> 5.000` |
---|
454 | if test $try = "1"; then |
---|
455 | AC_MSG_RESULT("yes") |
---|
456 | else |
---|
457 | success="no" |
---|
458 | fi |
---|
459 | fi |
---|
460 | |
---|
461 | if test $success = "no"; then |
---|
462 | AC_MSG_RESULT("no") |
---|
463 | AC_MSG_ERROR("Perl 5 not available - cannot install") |
---|
464 | fi |
---|
465 | |
---|
466 | dnl |
---|
467 | dnl Check if the STL library has any known faults; |
---|
468 | dnl In GCC 2.7.2.x series, some STL library headers are missing |
---|
469 | dnl a file called "new" which is referred to by other headers |
---|
470 | dnl (eg. vector/vector.h); if this applies, then all use of the |
---|
471 | dnl STL will cause a compile fail, so we'd better let the user |
---|
472 | dnl know now, before things really go wrong! |
---|
473 | dnl |
---|
474 | success=no |
---|
475 | AC_MSG_CHECKING("whether STL library has known faults") |
---|
476 | |
---|
477 | dnl - first shot, try simple good old vector on its own |
---|
478 | AC_TRY_COMPILE( |
---|
479 | [#include <vector> |
---|
480 | ], |
---|
481 | [], |
---|
482 | success=yes, |
---|
483 | ) |
---|
484 | |
---|
485 | dnl - try using the .h equivalent |
---|
486 | if test $success = "no"; then |
---|
487 | AC_TRY_COMPILE( |
---|
488 | [#include <vector.h> |
---|
489 | ], |
---|
490 | [], |
---|
491 | success="yes", |
---|
492 | ) |
---|
493 | fi |
---|
494 | |
---|
495 | dnl - now try for the objectspace headers |
---|
496 | if test $success = "no"; then |
---|
497 | AC_TRY_COMPILE( |
---|
498 | [#include <ospace\\std\\vector> |
---|
499 | ], |
---|
500 | [], |
---|
501 | success="yes", |
---|
502 | ) |
---|
503 | fi |
---|
504 | |
---|
505 | if test $success = yes; then |
---|
506 | AC_MSG_RESULT("no") |
---|
507 | else |
---|
508 | AC_MSG_RESULT("yes") |
---|
509 | AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler") |
---|
510 | fi |
---|
511 | |
---|
512 | gsdlos=`uname | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` |
---|
513 | # check for running bash under cygwin |
---|
514 | if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ; |
---|
515 | then |
---|
516 | gsdlos=windows |
---|
517 | fi |
---|
518 | AC_SUBST(gsdlos) |
---|
519 | |
---|
520 | # check for endianness |
---|
521 | AC_C_BIGENDIAN |
---|
522 | # --------------------------------------------------------------------------- |
---|
523 | if test "$ac_cv_func_alloca" = 'no'; then |
---|
524 | dnl support functions for alloca.c |
---|
525 | AC_LIBOBJ([xmalloc.o]) |
---|
526 | AC_LIBOBJ([error]) |
---|
527 | fi |
---|
528 | |
---|
529 | # --------------------------------------------------------------------------- |
---|
530 | |
---|
531 | dnl |
---|
532 | dnl Locate all children of the modules folder |
---|
533 | dnl |
---|
534 | moduleDirs="" |
---|
535 | MODULEDIRS="" |
---|
536 | if test -d modules ; then |
---|
537 | for x in `find modules -mindepth 1 -maxdepth 2`; do |
---|
538 | if test -d "$x"; then |
---|
539 | d="$x/Makefile.in" |
---|
540 | if test -e "$d"; then |
---|
541 | dnl echo $d |
---|
542 | moduleDirs="$moduleDirs $x/Makefile" |
---|
543 | MODULEDIRS="$MODULEDIRS $x" |
---|
544 | fi |
---|
545 | fi |
---|
546 | done |
---|
547 | echo "Making $moduleDirs in modules directory" |
---|
548 | AC_SUBST(MODULEDIRS) |
---|
549 | fi |
---|
550 | |
---|
551 | |
---|
552 | #---------------------------------------------------------------------------- |
---|
553 | # GS2 uses this configure to set up gnome-lib env, GS3 uses the one in gs2build/build-src |
---|
554 | # For gnome-lib-minimal need to source its ./devel.bash before wvware can even be configured |
---|
555 | # For a gnome-lib that's already compiled, don't need to its source ./devel.bash to configure wvware |
---|
556 | # If a gnome-lib is not yet compiled, we compile it first with CASCADE-MAKE.sh |
---|
557 | # Need to make sure that the gnome-lib-minimal is not the cut-down gnome-lib-minimal (which contains |
---|
558 | # only the linux/lib subfolder) that's included with linux and mac binaries, because we can't compile |
---|
559 | # wvware with the cut-down one, only run wvware with it. The test for the cut-down version is that |
---|
560 | # it does not contain devel.bash. |
---|
561 | |
---|
562 | if test -f ext/gnome-lib-minimal/devel.bash; then |
---|
563 | echo "*** gnome-lib (minimal) detected. Sourcing the gnomelib env for configuring wvware..." |
---|
564 | cd ext/gnome-lib-minimal |
---|
565 | source ./devel.bash |
---|
566 | cd ../.. |
---|
567 | elif test -d ext/gnome-lib; then |
---|
568 | if test -d ext/gnome-lib/$gsdlos; then |
---|
569 | echo "*** gnome-lib already compiled up in ext/gnome-lib/$gsdlos" |
---|
570 | echo "*** Sourcing the gnomelib env for configuring wvware for GS2 (although it's not necessary)..." |
---|
571 | cd ext/gnome-lib |
---|
572 | source ./devel.bash |
---|
573 | cd ../.. |
---|
574 | else |
---|
575 | echo "*** Compiling up gnome-lib..." |
---|
576 | cd ext/gnome-lib |
---|
577 | ./CASCADE-MAKE.sh |
---|
578 | gnomestatus=$? |
---|
579 | if test $gnomestatus != 0; then |
---|
580 | echo "****************************************" |
---|
581 | echo "@@@ Failed to compile up gnomelib successfully" |
---|
582 | echo "****************************************" |
---|
583 | exit -1 |
---|
584 | fi |
---|
585 | cd ../.. |
---|
586 | fi |
---|
587 | fi |
---|
588 | |
---|
589 | # --------------------------------------------------------------------------- |
---|
590 | dnl for Darwin, as our packages don't (yet) correctly guess our system type. |
---|
591 | dnl not needed any more? |
---|
592 | dnl ac_configure_args="$ac_configure_args --build=$build --target=$target" |
---|
593 | |
---|
594 | # indexers needs a bindir option to get the binaries into the right place |
---|
595 | gsdlprefix=`pwd` |
---|
596 | ac_configure_args="$ac_configure_args --bindir=$gsdlprefix/bin/$gsdlos --libdir=$gsdlprefix/lib/$gsdlos" |
---|
597 | AC_CONFIG_SUBDIRS(common-src) |
---|
598 | AC_CONFIG_SUBDIRS(build-src) |
---|
599 | |
---|
600 | # the list of folders in the src folder |
---|
601 | srclist="common-src/Makefile \ |
---|
602 | build-src/Makefile" |
---|
603 | |
---|
604 | if test -d runtime-src; then |
---|
605 | AC_CONFIG_SUBDIRS(runtime-src) |
---|
606 | srclist="$srclist \ |
---|
607 | runtime-src/Makefile" |
---|
608 | fi |
---|
609 | |
---|
610 | AC_OUTPUT(Makefile $srclist $moduleDirs) |
---|
611 | |
---|
612 | |
---|