Annotation of parser3/configure.in, revision 1.62.2.5.2.2

1.1       paf         1: dnl Process this file with autoconf to produce a configure script.
                      2: AC_INIT(README)
1.59      paf         3: AC_PREREQ(2.57)
                      4: 
1.22      paf         5: AM_INIT_AUTOMAKE(parser, 3.0.HEAD, nodefine)
1.1       paf         6: 
1.8       paf         7: dnl expand srcdir
1.14      paf         8: P3S=`cd $srcdir/src ; pwd`
1.1       paf         9: AC_SUBST(P3S)
                     10: 
                     11: PARSER_VERSION=$VERSION
1.8       paf        12: echo "/* automatically generated by configure */" > $srcdir/src/include/pa_version.h.new
                     13: echo "/* edit configure.in to change version number */" >> $srcdir/src/include/pa_version.h.new
                     14: echo "#define PARSER_VERSION \"$PARSER_VERSION\"" >> $srcdir/src/include/pa_version.h.new
                     15: cmp $srcdir/src/include/pa_version.h.new $srcdir/src/include/pa_version.h >/dev/null 2>&1
1.1       paf        16: if test $? -ne 0 ; then
1.62.2.3  paf        17:        rm -f $srcdir/src/include/pa_version.h && mv $srcdir/src/include/pa_version.h.new $srcdir/src/include/pa_version.h && \
                     18:        echo Updated $srcdir/src/include/pa_version.h
1.1       paf        19: else
1.8       paf        20:        rm -f $srcdir/src/include/pa_version.h.new
1.1       paf        21: fi
                     22: 
1.58      paf        23: 
1.62.2.5.2.1  paf        24: 
1.41      paf        25: dnl AC_CANONICAL_SYSTEM
                     26: AC_CANONICAL_HOST
                     27: AC_SUBST(host_os)
1.62.2.2  paf        28: case $host_os in
                     29:   *cygwin* ) AC_DEFINE(CYGWIN,,using cygwin building environment);;
                     30: esac
1.41      paf        31: 
                     32: dnl Checks for programs.
1.1       paf        33: AC_PROG_INSTALL
1.41      paf        34: AC_PROG_MAKE_SET
                     35: AC_PROG_RANLIB
                     36: AC_PROG_AWK
                     37: 
                     38: AC_PROG_YACC
                     39: if test "$YACC" != "bison -y"; then
1.62.2.3  paf        40:        AC_MSG_WARN(to regenerate Parser grammar YOU WOULD NEED BISON)
1.41      paf        41: else
1.62.2.3  paf        42:        AC_MSG_CHECKING(bison version)
                     43:        oldIFS=$IFS; IFS=.
                     44:        set `bison -V | sed -e 's/^GNU Bison version //' -e 's/^bison (GNU Bison) //' -e 's/$/./'`
                     45:        IFS=$oldIFS
                     46:        if test "$1" = "1" -a "$2" -lt "25"; then
                     47:                AC_MSG_WARN(Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2).)
                     48:        fi
                     49:        AC_MSG_RESULT($1.$2 (ok))
1.41      paf        50: fi
                     51: 
1.62      paf        52: AC_PROG_CXX
1.1       paf        53: AC_PROG_CC
1.62.2.5.2.1  paf        54: dnl most tests should be compiled with C compiler [especially qsort test]
                     55: AC_LANG_C 
                     56: AC_C_INLINE
1.1       paf        57: 
                     58: dnl Arguments
                     59: 
1.62.2.3  paf        60: AC_ARG_ENABLE(safe-mode, [  --disable-safe-mode          to enable reading and executing
1.56      paf        61:                           files belonging to group+user other then effective],
1.1       paf        62: [
1.62.2.3  paf        63:        SAFE_MODE=$enableval
1.1       paf        64: ]
                     65: )
1.56      paf        66: if test "$SAFE_MODE" = "no"; then
                     67:        AC_MSG_WARN(enabling reading of files belonging to group+user other then effective)
                     68: else
1.57      paf        69:        AC_DEFINE(PA_SAFE_MODE,,disabled reading of files belonging to group+user other then effective)
1.56      paf        70: fi
1.1       paf        71: 
1.62.2.3  paf        72: AC_ARG_ENABLE(execs, [  --disable-execs          to disable any execs
1.15      paf        73:                           (file::exec, file::cgi, unix mail:send)],
                     74: [
                     75: if test "$enableval" = "no"; then
1.16      paf        76:        AC_MSG_WARN(disabling file execs)
1.15      paf        77:        AC_DEFINE(NO_PA_EXECS,,pa_exec disabled)
1.16      paf        78: fi
                     79: ]
                     80: )
                     81: 
1.56      paf        82: 
1.20      paf        83: srccharsetsdir=$srcdir/etc/parser3.charsets
1.19      paf        84: CHARSETS_REQUESTED="windows-1251"
                     85: AC_ARG_WITH(charsets, [  --with-charsets=CHARSET[,CHARSET,...]  Enables charsets in root config (windows-1251,
                     86:                           windows-1250 windows-1257 koi8-r; Default is windows-1251)],
                     87: [CHARSETS_REQUESTED=`echo $withval | sed -e 's/,/ /g'`])
                     88: 
1.20      paf        89: # Checking whether all requested charsets have corresponding .cfg files
                     90: for c in $CHARSETS_REQUESTED; do
                     91:        if test \! -f $srccharsetsdir/$c.cfg; then
                     92:                AC_MSG_ERROR(bad charset requested "$c" - file $srccharsetsdir/$c.cfg not found)
                     93:        fi
                     94: done
                     95: 
                     96: # Switching on commentcharset_XXX='#'
1.19      paf        97: AC_DEFUN(PA_SUBSTCHARSET, [
                     98:        commentcharset_$2='#'
1.20      paf        99:        for c in $CHARSETS_REQUESTED; do
1.19      paf       100:                if test "$1" = "$c"; then
1.56      paf       101:                        AC_MSG_WARN(enabling charset $1)
1.20      paf       102:                        commentcharset_$2=
1.19      paf       103:                fi
                    104:        done
                    105:        AC_SUBST(commentcharset_$2)
                    106: ])
                    107: PA_SUBSTCHARSET(windows-1251,windows1251)
                    108: PA_SUBSTCHARSET(windows-1250,windows1250)
                    109: PA_SUBSTCHARSET(windows-1257,windows1257)
                    110: PA_SUBSTCHARSET(koi8-r,koi8r)
                    111: 
                    112: 
1.40      paf       113: AC_MSG_CHECKING(for dynamic-link library extension)
                    114: case "$host_os" in
                    115: hpux9* | hpux10* | hpux11*)
1.62.2.3  paf       116:        dll_extension=sl
                    117:        ;;
1.40      paf       118: cygwin)
1.62.2.3  paf       119:        dll_extension=dll
                    120:        ;;
1.40      paf       121: *)
1.62.2.3  paf       122:        dll_extension=so
1.40      paf       123: esac
                    124: AC_MSG_RESULT($dll_extension)
                    125: AC_SUBST(dll_extension)
                    126: 
1.19      paf       127: AC_ARG_WITH(mysql-client,[  --with-mysql-client=mysqlclientlib?withparams
                    128:                           MySQL client dynamic library to root config],
                    129:        mysql_client=$withval
                    130: ,
                    131:        AC_MSG_CHECKING(for mysql client)
                    132:        for lib in \
1.40      paf       133:                /usr/local/lib/mysql/libmysqlclient.$dll_extension \
                    134:                /usr/local/lib/libmysqlclient.$dll_extension \
                    135:                /usr/lib/libmysqlclient.$dll_extension; do
1.19      paf       136:                if test -f $lib; then mysql_client=$lib; fi
                    137:        done
                    138: 
                    139:        if test -z "$mysql_client"; then
                    140:                mysql_client="-configure could not guess-"
1.62      paf       141:                AC_MSG_RESULT(could not guess)
1.19      paf       142:        else
                    143:                AC_MSG_RESULT($mysql_client)
                    144:        fi
                    145: 
                    146: )
                    147: AC_SUBST(mysql_client)
                    148: 
                    149: AC_ARG_WITH(pgsql-client,[  --with-pgsql-client=pgsqlclientlib?withparams
                    150:                           PgSQL client dynamic library to root config],
                    151:        mysql_client=$withval
                    152: ,
                    153:        AC_MSG_CHECKING(for pgsql client)
                    154:        for lib in \
1.40      paf       155:                /usr/local/pgsql/lib/libpq.$dll_extension \
                    156:                /usr/local/lib/libpq.$dll_extension \
                    157:                /usr/lib/libpq.$dll_extension; do
1.19      paf       158:                if test -f $lib; then pgsql_client=$lib; fi
                    159:        done
                    160: 
                    161:        if test -z "$pgsql_client"; then
                    162:                pgsql_client="-configure could not guess-"
1.62      paf       163:                AC_MSG_RESULT(could not guess)
1.19      paf       164:        else
                    165:                AC_MSG_RESULT($pgsql_client)
                    166:        fi
                    167: 
                    168: )
                    169: AC_SUBST(pgsql_client)
                    170: 
                    171: AC_ARG_WITH(oracle-client,[  --with-oracle-client=oracleclientlib?withparams
                    172:                           Oracle client dynamic library],
                    173:        oracle_client=$withval
                    174: ,
                    175:        AC_MSG_CHECKING(for oracle client)
1.40      paf       176:        lib=$ORACLE_HOME/lib/libclntsh.$dll_extension
1.19      paf       177:        if test -f $lib; then oracle_client=$lib; fi
                    178: 
                    179:        if test -z "$oracle_client"; then
                    180:                oracle_client="-configure could not guess-"
1.62      paf       181:                AC_MSG_RESULT(could not guess)
1.19      paf       182:        else
                    183:                oracle_client="$oracle_client?ORACLE_HOME=$ORACLE_HOME&ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data"
                    184:                AC_MSG_RESULT($oracle_client)
                    185:        fi
                    186: 
                    187: )
                    188: AC_SUBST(oracle_client)
                    189: 
                    190: 
1.15      paf       191: 
1.9       paf       192: AC_ARG_WITH(pathlink,[  --with-pathlink=LKEY    put dynamic libraries paths to binary
1.1       paf       193:                           using linker key (-R, -rpath-link)],
                    194:        LD_PATHLINK=$withval
                    195: )
1.62.2.3  paf       196: AC_ARG_WITH(dynamic-stdcpp, [  --with-dynamic-stdcpp   link libstdc++ dynamically
                    197:                           by default, libstdc++ is linked statically],[
                    198:        AC_MSG_WARN(libstdc++ will be linked dynamically: this is probably incompatible with other platforms)
                    199:        # this is for apache, it's linked with gcc and need to know
                    200:        # and it would not harm linking with c++ toolchain
1.62.2.4  paf       201:        CPP_LIBS="-lstdc++"
1.62.2.3  paf       202: ],[
1.62.2.4  paf       203:        CPP_LIBS="-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic"
1.62.2.3  paf       204: ])
1.62.2.4  paf       205: AC_SUBST(CPP_LIBS)
1.55      paf       206: 
1.38      paf       207: AC_ARG_WITH(sjlj-exceptions,[  --with-sjlj-exceptions  enable simple 'throw' from dynamic library],
                    208:        AC_DEFINE(PA_WITH_SJLJ_EXCEPTIONS,,one can throw from dynamic library)
                    209: )
1.1       paf       210: 
1.62.2.5.2.1  paf       211: GC_LIB_NAME=gc
                    212: AC_ARG_WITH(shared-gc,[  --with-shared-gc[=D]      D is the directory where
                    213:                           Boehm garbage collecting library is installed (shared lib)],[
                    214:        GC_LIBS="-L$withval -l$GC_LIB_NAME"
                    215: ])
                    216: AC_ARG_WITH(static-gc,[  --with-static-gc[=D]      D is the directory where
                    217:                           Boehm garbage collecting library is installed (static lib)],[
                    218:        GC_LIBS="-L$withval -Wl,-Bstatic -l$GC_LIB_NAME -Wl,-Bdynamic"
                    219: ])
                    220: if test -z "$GC_LIBS"; then
                    221:        #undefined? use any found in system
                    222:        GC_LIBS="-l$GC_LIB_NAME"
                    223:        AC_MSG_WARN([neither --with-shared/static-gc were specified, hoping linker would find it])
                    224: fi
                    225: 
                    226: AC_MSG_CHECKING(for libgc)
                    227: SAVE_LIBS=$LIBS
                    228: LIBS="$LIBS $GC_LIBS"
                    229: AC_TRY_LINK([
                    230:        extern int GC_dont_gc;
                    231: ],[
                    232:        GC_dont_gc=0;
                    233: ],
                    234:        AC_MSG_RESULT(yes)
                    235: ,
                    236:        AC_MSG_RESULT(no)
                    237:        AC_MSG_ERROR(please specify path to libgc: --with-shared-gc OR --with-static-gc)
                    238: )
                    239: AC_SUBST(GC_LIBS)
                    240: LIBS=$SAVE_LIBS
                    241: 
1.17      paf       242: 
1.9       paf       243: AC_ARG_WITH(glib-config,[  --with-glib-config=FILE FILE is glib library
                    244:                           configuration file (search for glib*-config)],
                    245:        GLIB_CONFIG=$withval
                    246: )
                    247: 
1.12      paf       248: AC_ARG_WITH(shared-xml,[  --with-shared-xml=D     D is the directory where
                    249:                           Gnome XML libraries are installed (shared libs)],[
1.62.2.3  paf       250:        GNOME_XML=$withval
                    251:        XMLBIN="$GNOME_XML/bin"
                    252:        XMLINC="$GNOME_XML/include"
                    253:        XMLLIB="$GNOME_XML/lib"
                    254: 
                    255:        if test \! -d $XMLBIN -o \! -d $XMLINC -o \! -d $XMLLIB; then
                    256:                AC_MSG_ERROR($GNOME_XML does not seem to be valid Gnome installation directory)
                    257:        fi
                    258: 
                    259:        AC_DEFINE(XML,,xml-abled parser (uses shared library))
                    260:        
                    261:        LIBXML2_SO_NAME=`cd $XMLLIB ; ls libxml2.?? libxml2.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                    262:        LIBGDOME_SO_NAME=`cd $XMLLIB ; ls libgdome.?? libgdome.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                    263:        LIBXSLT_SO_NAME=`cd $XMLLIB ; ls libxslt.?? libxslt.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                    264:        LIBEXSLT_SO_NAME=`cd $XMLLIB ; ls libexslt.?? libexslt.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                    265: 
                    266:        if test -z "$GLIB_CONFIG"; then
                    267:                GLIB_CONFIG=$XMLBIN/glib-config
                    268:                if test \! -x $GLIB_CONFIG; then
                    269:                        GLIB_CONFIG=glib-config
                    270:                fi
                    271:        fi
                    272:        GLIB_CFLAGS=`$GLIB_CONFIG --cflags`
                    273:        GLIB_LIBS=`$GLIB_CONFIG --libs`
                    274: 
                    275:        XML_INCLUDES="$GLIB_CFLAGS -I$XMLINC -I$XMLINC/libgdome -I$XMLINC/libxml2"
                    276:        XML_LIBS="$GLIB_LIBS -L$XMLLIB -l$LIBXML2_SO_NAME -l$LIBGDOME_SO_NAME -l$LIBXSLT_SO_NAME -l$LIBEXSLT_SO_NAME"
                    277:        if test \! -z "$LD_PATHLINK"; then
1.13      paf       278:        XML_LIBS="$XML_LIBS -Wl,$LD_PATHLINK -Wl,$XMLLIB"
1.62.2.3  paf       279:        fi
1.1       paf       280: ])
1.12      paf       281: AC_ARG_WITH(static-xml,[  --with-static-xml=D     D is the directory where
                    282:                           Gnome XML libraries are installed (static libs)],[
1.62.2.3  paf       283:        GNOME_XML=$withval
                    284:        XMLBIN="$GNOME_XML/bin"
                    285:        XMLINC="$GNOME_XML/include"
                    286:        XMLLIB="$GNOME_XML/lib"
                    287: 
                    288:        if test \! -d $XMLBIN -o \! -d $XMLINC -o \! -d $XMLLIB; then
                    289:                AC_MSG_ERROR($GNOME_XML does not seem to be valid Gnome installation directory)
                    290:        fi
                    291: 
                    292:        AC_DEFINE(XML,,xml-abled parser (uses static library))
                    293: 
                    294:        if test -z "$GLIB_CONFIG"; then
                    295:                GLIB_CONFIG=$XMLBIN/glib-config
                    296:                if test \! -x $GLIB_CONFIG; then
                    297:                        GLIB_CONFIG=glib-config
                    298:                fi
                    299:        fi
                    300:        GLIB_CFLAGS=`$GLIB_CONFIG --cflags`
1.13      paf       301: 
1.12      paf       302: dnl  '-L/usr/local/lib -lglib' -> /usr/local/lib
1.13      paf       303: changequote(, )dnl
1.62.2.3  paf       304:        GLIB_DIR=`$GLIB_CONFIG --libs | sed 's/.*-L\([^ ]*\).*/\1/'`
                    305:        GLIB_NAME=`$GLIB_CONFIG --libs | sed 's/.*-l\([^ ]*\).*/\1/'`
1.13      paf       306: changequote([, ])dnl
1.62.2.3  paf       307:        XML_INCLUDES="$GLIB_CFLAGS -I$XMLINC -I$XMLINC/libgdome -I$XMLINC/libxml2"
                    308:        XML_LIBS="$XMLLIB/libgdome.a $XMLLIB/libxslt.a $XMLLIB/libexslt.a $XMLLIB/libxml2.a $GLIB_DIR/lib$GLIB_NAME.a"
1.12      paf       309: ])
1.1       paf       310: AC_SUBST(XML_INCLUDES)
                    311: AC_SUBST(XML_LIBS)
1.33      paf       312: 
                    313: AC_ARG_WITH(shared-mailreceive,[  --with-shared-mailreceive=D is the directory where
1.62.2.3  paf       314:                           Gnome MIME library is installed (shared lib)],[
                    315:        GNOME_MIME=$withval
                    316:        MIMEBIN="$GNOME_MIME/bin"
                    317:        MIMEINC="$GNOME_MIME/include"
                    318:        MIMELIB="$GNOME_MIME/lib"
                    319: 
                    320:        if test \! -d $MIMEBIN -o \! -d $MIMEINC -o \! -d $MIMELIB; then
                    321:                AC_MSG_ERROR($GNOME_MIME does not seem to be valid Gnome installation directory)
                    322:        fi
                    323: 
                    324:        AC_DEFINE(WITH_MAILRECEIVE,,has \$mail:received (uses shared library))
                    325:        
                    326:        LIBMIME_SO_NAME=`cd $MIMELIB ; ls libgmime.?? libgmime.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
                    327: 
                    328:        if test -z "$GLIB_CONFIG"; then
                    329:                GLIB_CONFIG=$MIMEBIN/glib-config
                    330:                if test \! -x $GLIB_CONFIG; then
                    331:                        GLIB_CONFIG=glib-config
                    332:                fi
                    333:        fi
                    334:        GLIB_CFLAGS=`$GLIB_CONFIG --cflags`
                    335:        GLIB_LIBS=`$GLIB_CONFIG --libs`
                    336: 
                    337:        MIME_INCLUDES="$GLIB_CFLAGS -I$MIMEINC/gmime"
                    338:        MIME_LIBS="$GLIB_LIBS -L$MIMELIB -l$LIBMIME_SO_NAME"
                    339:        if test \! -z "$LD_PATHLINK"; then
1.33      paf       340:        MIME_LIBS="$MIME_LIBS -Wl,$LD_PATHLINK -Wl,$MIMELIB"
1.62.2.3  paf       341:        fi
1.33      paf       342: ])
                    343: AC_ARG_WITH(static-mailreceive,[  --with-static-mailreceive=D is the directory where
                    344:                           Gnome MIME library is installed (static lib)],[
1.62.2.3  paf       345:        GNOME_MIME=$withval
                    346:        MIMEBIN="$GNOME_MIME/bin"
                    347:        MIMEINC="$GNOME_MIME/include"
                    348:        MIMELIB="$GNOME_MIME/lib"
                    349: 
                    350:        if test \! -d $MIMEBIN -o \! -d $MIMEINC -o \! -d $MIMELIB; then
                    351:                AC_MSG_ERROR($GNOME_MIME does not seem to be valid Gnome installation directory)
                    352:        fi
                    353: 
                    354:        AC_DEFINE(WITH_MAILRECEIVE,,has \$mail:received (uses static library))
                    355: 
                    356:        if test -z "$GLIB_CONFIG"; then
                    357:                GLIB_CONFIG=$MIMEBIN/glib-config
                    358:                if test \! -x $GLIB_CONFIG; then
                    359:                        GLIB_CONFIG=glib-config
                    360:                fi
                    361:        fi
                    362:        GLIB_CFLAGS=`$GLIB_CONFIG --cflags`
1.33      paf       363: 
                    364: dnl  '-L/usr/local/lib -lglib' -> /usr/local/lib
                    365: changequote(, )dnl
1.62.2.3  paf       366:        GLIB_DIR=`$GLIB_CONFIG --libs | sed 's/.*-L\([^ ]*\).*/\1/'`
                    367:        GLIB_NAME=`$GLIB_CONFIG --libs | sed 's/.*-l\([^ ]*\).*/\1/'`
1.33      paf       368: changequote([, ])dnl
1.62.2.3  paf       369:        MIME_INCLUDES="$GLIB_CFLAGS -I$MIMEINC/gmime"
                    370:        MIME_LIBS="$MIMELIB/libgmime.a $GLIB_DIR/lib$GLIB_NAME.a"
1.33      paf       371: ])
                    372: AC_SUBST(MIME_INCLUDES)
                    373: AC_SUBST(MIME_LIBS)
1.18      paf       374: 
                    375: 
                    376: AC_ARG_WITH(sendmail,[  \"--with-sendmail=COMMAND\" forces this command to send mail.
                    377:                           example: \"--with-sendmail=/usr/sbin/sendmail -t\"
                    378:                           (makes parser ignore user-defined sendmail commands)],
                    379:        AC_DEFINE_UNQUOTED(PA_FORCED_SENDMAIL,"$withval",parser uses this command instead of user-defined sendmail commands)
                    380: )
                    381: 
1.14      paf       382: 
                    383: AC_ARG_WITH(apache13,[  --with-apache13=D       D is the Apache13 source distribution directory
                    384:                           builds library for apache_module using that dir
                    385:                           (do not add /src)],
                    386:        APACHE13=$withval
1.62.2.3  paf       387:        if test \! -f "$APACHE13/src/include/httpd.h"; then
                    388:                AC_MSG_ERROR($APACHE13 does not seem to be valid Apache13 source distribution directory)
                    389:        fi
1.14      paf       390: )
                    391: AC_SUBST(APACHE13)
                    392: AM_CONDITIONAL(COMPILE_APACHE13_MODULE, test -n "$APACHE13")
                    393: 
1.1       paf       394: 
                    395: dnl Enable building of the convenience library
                    396: dnl and set LIBLTDL accordingly
1.51      paf       397: AC_LIBLTDL_CONVENIENCE(src/lib/ltdl)
1.1       paf       398: dnl Substitute INCLTDL and LIBLTDL in the Makefiles
                    399: AC_SUBST(INCLTDL)
                    400: AC_SUBST(LIBLTDL)
                    401: 
                    402: dnl Configure libltdl
1.51      paf       403: AC_CONFIG_SUBDIRS(src/lib/ltdl)
1.60      paf       404: 
                    405: dnl detecting which libraries are needed to dynamic open
                    406: AC_LTDL_DLLIB
1.10      paf       407: AC_SUBST(LIBADD_DL)
1.1       paf       408: 
                    409: dnl Checks for typedefs, structures, and compiler characteristics.
                    410: 
                    411: AC_TYPE_SIZE_T
1.34      paf       412: dnl gmime
                    413: AC_CHECK_TYPE(off_t, long)
                    414: AC_CHECK_TYPE(ssize_t, int)
                    415: 
1.1       paf       416: 
1.62      paf       417: dnl Checks for C header files.
1.1       paf       418: 
1.10      paf       419: AC_HEADER_TIME
                    420: 
1.1       paf       421: AC_CHECK_HEADERS(
1.48      paf       422: signal.h \
1.1       paf       423: unistd.h \
                    424: process.h \
                    425: stddef.h \
                    426: stdarg.h \
                    427: fcntl.h \
                    428: sys/stat.h \
                    429: io.h \
                    430: stdio.h \
                    431: errno.h \
                    432: ctype.h \
                    433: math.h \
1.35      paf       434: crypt.h \
1.3       paf       435: time.h sys/time.h \
1.1       paf       436: string.h \
                    437: direct.h \
                    438: setjmp.h \
                    439: memory.h \
                    440: sys/file.h \
                    441: sys/locking.h \
1.3       paf       442: sys/types.h \
1.5       paf       443: sys/select.h \
1.39      paf       444: sys/resource.h \
1.49      paf       445: winsock.h \
                    446: sys/socket.h \
                    447: netinet/in.h \
                    448: arpa/inet.h \
                    449: netdb.h
1.1       paf       450: )
                    451: 
                    452: dnl Checks for libraries.
                    453: 
                    454: dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
                    455: case "$host" in
                    456:   *-sunos5.6* | *-solaris2.6*)
1.62.2.3  paf       457:          AC_CHECK_LIB(xnet, main)
1.1       paf       458:   ;;
                    459:   *-sunos5* | *-solaris2*)
1.62.2.3  paf       460:          AC_CHECK_LIB(socket, main)
                    461:          AC_CHECK_LIB(nsl, main)
1.1       paf       462:   ;;
                    463:   *-nec-sysv4*)
1.62.2.3  paf       464:          AC_CHECK_LIB(nsl, gethostbyname)
                    465:          AC_CHECK_LIB(socket, socket)
1.1       paf       466:   ;;
                    467:   *-cygwin*)
1.62.2.3  paf       468:          AC_DEFINE(WIN32,,Windows32 target platform)
                    469:          AC_CHECK_LIB(wsock32, socket)
1.1       paf       470:   ;;
1.24      paf       471: # never tested this, only theoretically by letter from demos about parser2 build
1.25      paf       472:   *-hpux*)
1.62.2.3  paf       473:          AC_CHECK_LIB(nsl, main)
1.24      paf       474:   ;;
1.1       paf       475: esac
                    476: 
                    477: AC_CHECK_LIB(m, sin)
                    478: 
1.35      paf       479: AC_CHECK_LIB(crypt, crypt)
                    480: 
1.1       paf       481: dnl Checks for functions.
                    482: 
                    483: AC_CHECK_FUNCS(
                    484: flock \
                    485: _locking \
1.7       paf       486: fcntl \
1.4       paf       487: lockf \
1.53      paf       488: ftruncate \
1.35      paf       489: getrusage \
1.47      paf       490: gettimeofday \
1.49      paf       491: crypt \
                    492: sigsetjmp siglongjmp
1.1       paf       493: )
1.3       paf       494: 
1.62.2.5.2.1  paf       495: dnl see comment above
                    496: AC_LANG_PUSH(C++)
                    497: PA_CHECK_MATH_FUNCS_ONE_ARG(
                    498: trunc \
                    499: round \
                    500: sign
                    501: )
                    502: AC_LANG_POP
                    503: 
1.3       paf       504: dnl We require qsort(3) and select(2).
                    505: 
                    506: AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.]))
                    507: AC_CHECK_FUNCS(select, , AC_MSG_ERROR([No select library function.]))
1.1       paf       508: 
1.46      paf       509: dnl For correct mail receiving we need to know local offset from GMT
                    510: dnl it be timezone+(daylight?60*60*sign(timezone):0)
                    511: dnl or it can be tm.tm_gmtoff
                    512: dnl or it can be tm.tm_tzadj
                    513: 
                    514: AC_MSG_CHECKING(for timezone variable)
1.62.2.3  paf       515: AC_TRY_COMPILE([#include <time.h>],            
1.46      paf       516: [
                    517: time_t test=timezone;
1.62.2.3  paf       518: ],                                                      
                    519: AC_DEFINE(HAVE_TIMEZONE)                                 
1.46      paf       520: AC_MSG_RESULT(yes),                        
                    521: AC_MSG_RESULT(no))                         
                    522: 
                    523: AC_MSG_CHECKING(for daylight variable)
1.62.2.3  paf       524: AC_TRY_COMPILE([#include <time.h>],            
1.46      paf       525: [
                    526: int test=daylight;
1.62.2.3  paf       527: ],                                                      
                    528: AC_DEFINE(HAVE_DAYLIGHT)                         
1.46      paf       529: AC_MSG_RESULT(yes),                        
                    530: AC_MSG_RESULT(no))                         
                    531: 
                    532: AC_MSG_CHECKING(for tm_gmtoff in struct tm)
1.62.2.3  paf       533: AC_TRY_COMPILE([#include <time.h>],            
                    534: [struct tm tm;                          
                    535: tm.tm_gmtoff=0;                                
                    536: ],                                                      
                    537: AC_DEFINE(HAVE_TM_GMTOFF)                                
1.46      paf       538: AC_MSG_RESULT(yes),                        
                    539: AC_MSG_RESULT(no))                         
                    540: 
                    541: AC_MSG_CHECKING(for tm_tzadj in struct tm)
1.62.2.3  paf       542: AC_TRY_COMPILE([#include <time.h>],            
                    543: [struct tm tm;                          
                    544: tm.tm_tzadj=0;                         
                    545: ],                                                      
                    546: AC_DEFINE(HAVE_TM_TZADJ)                                 
1.46      paf       547: AC_MSG_RESULT(yes),                        
                    548: AC_MSG_RESULT(no))                         
                    549: 
                    550: 
1.62.2.3  paf       551: dnl AC_ARG_ENABLE(db, [  --enable-db                    to enable 'hashfile' parser class],
1.1       paf       552: dnl [
                    553: dnl if test "$enableval" != "no"; then
                    554: dnl AC_CHECK_HEADERS(db.h)
                    555: dnl AC_CHECK_LIB(db, __db_open)
                    556: dnl fi
                    557: dnl ]
                    558: dnl )
1.17      paf       559: 
1.1       paf       560: dnl install directories
                    561: 
                    562: # expand apostrophed
1.6       paf       563: e_prefix=$prefix
                    564: test "x$e_prefix" = xNONE && e_prefix=$ac_default_prefix
                    565: 
1.1       paf       566: e_sysconfdir=$sysconfdir
1.6       paf       567: test "$e_sysconfdir" = "\${prefix}/etc" && e_sysconfdir="${e_prefix}/etc"
1.1       paf       568: 
                    569: dnl these are used to fill in etc/parser3.conf
                    570: 
                    571: charsetsdir=$e_sysconfdir/parser3.charsets
                    572: AC_SUBST(charsetsdir)
                    573: 
                    574: # expand apostrophed
                    575: e_libdir=$libdir
                    576: if test "$e_libdir" = "\${exec_prefix}/lib"; then
                    577: 
1.62.2.3  paf       578:        # Let make expand exec_prefix.
                    579:        e_exec_prefix=$exec_prefix
                    580:        test "x$e_exec_prefix" = xNONE && e_exec_prefix=$e_prefix
1.1       paf       581: 
1.62.2.3  paf       582:        # expand apostrophed
                    583:        test "$e_libdir" = "\${exec_prefix}/lib" && e_libdir="${e_exec_prefix}/lib"
1.1       paf       584: fi
                    585: 
                    586: sqldriversdir=$e_libdir
                    587: AC_SUBST(sqldriversdir)
                    588: 
                    589: 
1.58      paf       590: dnl Output header and makefiles
                    591: 
                    592: AH_TEMPLATE([HAVE_DLD],[Define if you have the GNU dld library])
                    593: 
                    594: AH_TEMPLATE([HAVE_LIBDL],
                    595:        [Define if you have the libdl library or equivalent.])
                    596: 
                    597: AH_TEMPLATE([HAVE_SHL_LOAD],
                    598:        [Define if you have the shl_load function. ])
                    599: 
                    600: 
                    601: AH_TEMPLATE([size_t],
                    602:        [Define to `unsigned int' if <sys/types.h> does not define.])
                    603: 
                    604: AH_TEMPLATE([ssize_t],
                    605:        [Define to `int' if <sys/types.h> does not define.])
                    606: 
                    607: AH_TEMPLATE([HAVE_DAYLIGHT],
                    608:        [Define if you have daylight external variable in <time.h>])
                    609: 
                    610: AH_TEMPLATE([HAVE_TIMEZONE],
                    611:        [Define if you have timezone external variable in <time.h>])
                    612: 
                    613: AH_TEMPLATE([HAVE_TM_GMTOFF],
                    614:        [Define if you have tm_gmtoff member of tm structure in <time.h>])
                    615: 
                    616: AH_TEMPLATE([HAVE_TM_TZADJ],
                    617:        [Define if you have tm_tzadj member of tm structure in <time.h>])
                    618: 
1.1       paf       619: 
                    620: AM_CONFIG_HEADER(src/include/pa_config_auto.h)
1.62.2.5.2.1  paf       621: AC_OUTPUT(Makefile src/Makefile src/types/Makefile src/classes/Makefile src/classes/gd/Makefile src/classes/smtp/Makefile src/include/Makefile src/main/Makefile src/sql/Makefile src/lib/Makefile src/lib/patches/Makefile src/lib/gc/Makefile src/lib/gc/include/Makefile src/lib/cord/Makefile src/lib/cord/include/Makefile src/lib/cord/include/private/Makefile src/lib/ltdl/Makefile src/lib/pcre/Makefile src/lib/md5/Makefile src/targets/Makefile src/targets/cgi/Makefile src/targets/apache13/Makefile src/targets/apache13/hook/Makefile src/targets/apache13/p3runConfigure src/targets/isapi/Makefile etc/Makefile etc/parser3.charsets/Makefile bin/Makefile bin/auto.p.dist)

E-mail: