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