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