source: other-projects/trunk/gs2build-extra/configure.in@ 15819

Last change on this file since 15819 was 15819, checked in by ak19, 16 years ago

Dr Bainbridge updated the configure and makefiles for GS3 gs2build with 1. COMP32bitFlag stuff and 2. CPP -> CXX stuff

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