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