Annotation of parser3/configure.in, revision 1.59

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