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