Annotation of parser3/configure.in, revision 1.92

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

E-mail: