Annotation of parser3/configure.in, revision 1.55

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