source: trunk/gsdl/configure.in@ 3631

Last change on this file since 3631 was 3631, checked in by cvs_anon, 21 years ago

Added langaction stuff

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 10.0 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(lib/text_t.h)
3AC_CONFIG_HEADER(config.h)
4
5PACKAGE=gsdl
6VERSION=2.1
7AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
8AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
9AC_SUBST(PACKAGE)
10AC_SUBST(VERSION)
11
12dnl
13dnl Set use of fast cgi
14dnl
15USE_FASTCGI=0
16if test USE_FASTCGI = 1; then
17AC_DEFINE(USE_FASTCGI)
18AC_SUBST(USE_FASTCGI)
19fi
20
21dnl
22dnl Set use of langaction
23dnl
24dnl USE_LANGACTION=0
25if test USE_LANGACTION = 1; then
26AC_DEFINE(USE_LANGACTION)
27AC_SUBST(USE_LANGACTION)
28fi
29
30dnl
31dnl Set use of corba
32dnl
33AC_ARG_ENABLE(corba, [ --enable-corba Enable CORBA support], USE_CORBA=1, USE_CORBA=0)
34AC_DEFINE_UNQUOTED(USE_CORBA, $USE_CORBA)
35AC_SUBST(USE_CORBA)
36
37AC_ARG_WITH(micodir, [ --with-micodir Use installed MICO directory], MICO_DIR=$enableval, MICO_DIR="default")
38AC_DEFINE_UNQUOTED(MICO_DIR, "$MICO_DIR")
39AC_SUBST(MICO_DIR)
40
41dnl
42dnl Set use of z39.50
43dnl
44AC_ARG_ENABLE(z3950, [ --enable-z3950 Enable Z39.50 client support], USE_Z3950=1, USE_Z3950=0)
45if test USE_Z3950 = 1; then
46AC_DEFINE(USE_Z3950, $USE_Z3950)
47AC_SUBST(USE_Z3950)
48fi
49
50dnl
51dnl look for libgdbm if not in standard location
52dnl
53AC_ARG_WITH(gdbm, [ --with-gdbm=dir Use local gdbm library and headers], gdbmdir=$withval)
54
55dnl Checks for programs.
56LDFLAGS=
57dnl only set CFLAGS if not already set in environment
58if test -z "$CFLAGS"; then
59CFLAGS=-O2
60fi
61AC_SUBST(CFLAGS)
62
63AC_PROG_CC
64AC_PROG_CXX
65AC_PROG_AWK
66AC_PROG_YACC
67dnl get $target_cpu, $target_vendor, and $target_os
68dnl (as well as host_*)
69AC_CANONICAL_SYSTEM
70dnl do we actually want this? It adds a prefix based on host, system etc
71dnl AC_ARG_PROGRAM
72AC_PROG_INSTALL
73AC_PROG_LN_S
74AC_PROG_MAKE_SET
75AC_PROG_RANLIB
76
77#moved CORBA MICO directory test to get version of MICO
78if test $USE_CORBA = 1; then
79
80if test $MICO_DIR = "default"; then
81#do something
82MICO_INC="-I packages/mico/mico/include"
83else
84#build the micotest program
85MICO_INC= ""
86if test $MICO_DIR != yes; then
87MICO_INC="-I $MICO_DIR"
88fi
89fi
90
91#get MICO_VER value
92sh -c "$CC -c micotest.cpp -o micotest.o $MICO_INC 2>&1" > /dev/null
93sh -c "$CC -o micotest micotest.o -lstdc++ 2>&1" > /dev/null
94MICO_VER=`./micotest` || MICO_VER=2.3.5
95sh -c "rm micotest"
96sh -c "rm micotest.o"
97
98#do test of MICO_VER
99if test MICO_VER != 0; then
100AC_DEFINE(MICO_VER)
101AC_SUBST(MICO_VER)
102fi
103#end USE_CORBA test
104fi
105
106dnl Checks for typedefs, structures, and compiler characteristics.
107AC_AIX
108AC_ISC_POSIX
109AC_MINIX
110fp_C_PROTOTYPES
111AC_C_CONST
112AC_TYPE_OFF_T
113AC_TYPE_SIZE_T
114AC_HEADER_TIME
115AC_STRUCT_TM
116
117dnl --- This should be in the stdc checking -----------------
118if test "$ac_cv_prog_cc_stdc" = '-Xc'; then
119dnl The Pyramids running SMP_DC.OSx on MIPS r3000 chips with
120dnl /usr/opt/cc3.11/bin/cc treat -Xc as full ANSI mode - no POSIX or
121dnl XOPEN extensions (like popen).
122dnl Unfortunately -D_{XOPEN,POSIX}_SOURCE can't provide all that mg
123dnl needs. So drop back to -Xa
124AC_TRY_COMPILE(
125[#include <stdio.h>
126], [ FILE *rubbish = popen("yes", "r"); ],,
127[CC="`echo $CC | sed 's/-Xc/-Xa/'`" ac_cv_prog_cc_stdc='-Xa'])
128fi
129dnl ----------------------
130
131
132dnl Checks for libraries.
133dnl Replace `main' with a function in -lg:
134AC_CHECK_LIB(g, main)
135dnl Replace `main' with a function in -lgdbm:
136AC_CHECK_LIB(gdbm, main)
137dnl Replace `main' with a function in -lm:
138AC_CHECK_LIB(m, main)
139dnl Replace `main' with a function in -lstdc++:
140AC_CHECK_LIB(stdc++, main)
141dnl Replace `main' with a function in -lcrypt:
142AC_CHECK_LIB(crypt, main)
143
144
145dnl Checks for header files.
146AC_HEADER_DIRENT
147AC_HEADER_STDC
148AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h unistd.h crypt.h string.h memory.h sys/procfs.h)
149AC_EGREP_HEADER(fread, stdio.h, AC_DEFINE(HAVE_FREAD_DECL))
150AC_EGREP_HEADER(fgetc, stdio.h, AC_DEFINE(HAVE_FGETC_DECL))
151AC_EGREP_HEADER(pr_brksize, sys/procfs.h, AC_DEFINE(HAVE_PR_BRKSIZE))
152
153dnl Checks for library functions.
154AC_FUNC_ALLOCA
155AC_PROG_GCC_TRADITIONAL
156AC_TYPE_SIGNAL
157AC_FUNC_VPRINTF
158AC_CHECK_FUNCS(ftime select strftime strtol getrusage times mallinfo setbuffer getpagesize strerror)
159AC_REPLACE_FUNCS(ftruncate strstr strcasecmp)
160
161
162# *** Custom checking (based on GNU tar configure.in) ***
163# ---------------------------------------------------------------------------
164AC_MSG_CHECKING(for HP-UX needing gmalloc)
165if test "`(uname -s) 2> /dev/null`" = 'HP-UX'; then
166 AC_MSG_RESULT(yes)
167 LIBOBJS="$LIBOBJS gmalloc.o"
168 AC_DEFINE(HAVE_VALLOC)
169else
170 AC_MSG_RESULT(no)
171 AC_CHECK_FUNCS(valloc)
172fi
173
174fp_WITH_DMALLOC
175fp_WITH_REGEX
176
177# ---------------------------------------------------------------------------
178if test "$ac_cv_func_alloca" = 'no'; then
179dnl support functions for alloca.c
180 LIBOBJS="$LIBOBJS xmalloc.o error.o"
181fi
182
183
184# ---------------------------------------------------------------------------
185
186dnl
187dnl Switch into C++
188dnl
189AC_LANG_CPLUSPLUS
190
191dnl
192dnl Check that the GDBM library is available
193dnl
194dnl check libgdbm manually, in case it's not in the standard location.
195
196AC_MSG_CHECKING(that the GDBM library is available)
197if test ! -z "$gdbmdir" ; then
198 # look in given directory for header file
199 if test -r $gdbmdir/include/gdbm.h ; then
200 GDBM_INCLUDE="-I$gdbmdir/include" ;
201 elif test -r $gdbmdir/gdbm.h ; then
202 GDBM_INCLUDE="-I$gdbmdir" ;
203 fi
204
205 # look in given directory for library
206 if test -r $gdbmdir/libgdbm.a ; then
207 GDBM_LIBPATH="-L$gdbmdir" ;
208 elif test -r $gdbmdir/lib/libgdbm.a ; then
209 GDBM_LIBPATH="-L$gdbmdir/lib" ;
210 elif test -r $gdbmdir/.libs/libgdbm.a ; then
211 GDBM_LIBPATH="-L$gdbmdir/.libs" ;
212 fi
213
214 if test ! -z "$GDBM_LIBPATH" -a ! -z "$GDBM_INCLUDE" ; then
215 AC_MSG_RESULT($gdbmdir) ;
216 else
217 AC_MSG_RESULT(can't find gdbm.h and libgdbm.a in $gdbmdir);
218 AC_MSG_CHECKING( looking for GDBM library in default locations)
219 fi
220fi
221
222# look in default path and in /usr/local
223if test -z "$GDBM_INCLUDE" ; then
224 # try in system directory
225 AC_TRY_COMPILE(
226 [#include <gdbm.h>
227],
228 [],
229 success=yes,
230 success=no
231 )
232
233 if test $success = "no"; then
234# last chance - look in /usr/local (eg FreeBSD)
235 GDBM_LIBPATH=-L/usr/local/lib
236 GDBM_INCLUDE=-I/usr/local/include
237 ac_save_CXXFLAGS="$CXXFLAGS"
238 ac_save_LIBS="$LIBS"
239 CXXFLAGS="$CXXFLAGS -I/usr/local/include"
240 LIBS="$LIBS -L/usr/local/lib -lgdbm"
241 AC_TRY_LINK(
242 [#include <gdbm.h>
243#include <stdio.h>
244 ],
245 [printf("%s",gdbm_version);],
246 success=/usr/local,
247 success=no
248 )
249 CXXFLAGS=$ac_save_CXXFLAGS
250 LIBS=$ac_save_LIBS
251 fi
252
253 AC_MSG_RESULT($success)
254 if test $success = "no"; then
255 AC_MSG_ERROR(GDBM Library not available - cannot install)
256 fi
257fi
258dnl I don't think anything actually checks this define, but...
259AC_DEFINE(HAVE_LIBGDBM , 1)
260
261AC_SUBST(GDBM_LIBPATH)
262AC_SUBST(GDBM_INCLUDE)
263
264dnl
265dnl Now check that Perl is actually around, and can be found
266dnl
267AC_MSG_CHECKING(that Perl 5 is available)
268success="no"
269pl_path="$PATH"
270IFS="${IFS= }"; pl_save_ifs="$IFS"; IFS=":"
271for pl_dir in $pl_path; do
272 test -z "$pl_dir" && pl_dir=.
273 if test -x $pl_dir/perl; then
274 success="yes"
275 break
276 fi
277done
278IFS="$pl_save_ifs"
279
280dnl
281dnl Perl actually can be run; now we see if it is version 5 by
282dnl running a sample script (which returns a "clean" version number
283dnl and then tests the result using expr. If perl errors in some
284dnl way (eg. broken Perl executable, missing script), we set a failure
285dnl value ("0") and then proceed as best we can
286dnl
287if test $success = "yes"; then
288try=`perl configtest.pl` || try="0"
289try=`expr $try \> 5.000`
290if test $try = "1"; then
291AC_MSG_RESULT("yes")
292else
293success="no"
294fi
295fi
296
297if test $success = "no"; then
298AC_MSG_RESULT("no")
299AC_MSG_ERROR("Perl 5 not available - cannot install")
300fi
301
302dnl
303dnl Check if the STL library has any known faults;
304dnl In GCC 2.7.2.x series, some STL library headers are missing
305dnl a file called "new" which is referred to by other headers
306dnl (eg. vector/vector.h); if this applies, then all use of the
307dnl STL will cause a compile fail, so we'd better let the user
308dnl know now, before things really go wrong!
309dnl
310success=no
311AC_MSG_CHECKING("whether STL library has known faults")
312
313dnl - first shot, try simple good old vector on its own
314AC_TRY_COMPILE(
315[#include <vector>
316],
317[],
318success=yes,
319)
320
321dnl - try using the .h equivalent
322if test $success = "no"; then
323AC_TRY_COMPILE(
324[#include <vector.h>
325],
326[],
327success="yes",
328)
329fi
330
331dnl - now try for the objectspace headers
332if test $success = "no"; then
333AC_TRY_COMPILE(
334[#include <ospace\\std\\vector>
335],
336[],
337success="yes",
338)
339fi
340
341if test $success = yes; then
342AC_MSG_RESULT("no")
343else
344AC_MSG_RESULT("yes")
345AC_MSG_ERROR("STL Broken - Obtain newer version of GNU C Compiler")
346fi
347
348gsdlos=`uname | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
349# check for running bash under cygwin
350 if test "`echo $gsdlos | sed 's/cygwin//'`" != "$gsdlos" ;
351 then
352 gsdlos=windows
353 fi
354AC_SUBST(gsdlos)
355
356# ---------------------------------------------------------------------------
357if test "$ac_cv_func_alloca" = 'no'; then
358dnl support functions for alloca.c
359 LIBOBJS="$LIBOBJS xmalloc.o error.o"
360fi
361
362# ---------------------------------------------------------------------------
363
364dnl
365dnl Locate all children of the modules folder
366dnl
367moduleDirs=""
368MODULEDIRS=""
369for x in `find modules -mindepth 1 -maxdepth 2`; do
370 if test -d "$x"; then
371 d="$x/Makefile.in"
372 if test -e "$d"; then
373dnl echo $d
374 moduleDirs="$moduleDirs $x/Makefile"
375 MODULEDIRS="$MODULEDIRS $x"
376 fi
377 fi
378done
379echo "Making$moduleDirs in modules directory"
380AC_SUBST(MODULEDIRS)
381
382# ---------------------------------------------------------------------------
383dnl for Darwin, as our packages don't (yet) correctly guess our system type.
384ac_configure_args="$ac_configure_args --host=$host --target=$target"
385AC_CONFIG_SUBDIRS(packages)
386
387# the list of folders in the src folder
388srclist="src/mgpp/lib/Makefile src/mgpp/text/Makefile src/mgpp/Makefile \
389 src/hashfile/Makefile src/colservr/Makefile src/recpt/Makefile src/txt2db/Makefile \
390 src/db2txt/Makefile src/getpw/Makefile src/phind/generate/Makefile"
391
392AC_OUTPUT(packages/Makefile packages/mg/Makefile packages/mg/src/text/Makefile packages/mg/src/images/Makefile
393 packages/mg/src/scripts/Makefile packages/mg/lib/Makefile
394 lib/Makefile Makefile $srclist $moduleDirs)
395
396
Note: See TracBrowser for help on using the repository browser.