Annotation of parser3/configure.in, revision 1.60

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)
1.60    ! paf       388: 
        !           389: dnl detecting which libraries are needed to dynamic open
        !           390: AC_LTDL_DLLIB
1.10      paf       391: AC_SUBST(LIBADD_DL)
                    392: 
                    393: if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
                    394:  LIBS_SAVE="$LIBS"
                    395:  LIBS="$LIBS $LIBADD_DL"
                    396:  AC_CHECK_FUNCS(dlerror)
                    397:  LIBS="$LIBS_SAVE"
                    398: fi
1.1       paf       399: 
                    400: dnl Checks for typedefs, structures, and compiler characteristics.
                    401: 
                    402: AC_TYPE_SIZE_T
1.34      paf       403: dnl gmime
                    404: AC_CHECK_TYPE(off_t, long)
                    405: AC_CHECK_TYPE(ssize_t, int)
                    406: 
1.1       paf       407: 
                    408: dnl Checks for header files.
                    409: 
1.10      paf       410: AC_HEADER_TIME
                    411: 
1.1       paf       412: AC_CHECK_HEADERS(
1.48      paf       413: signal.h \
1.1       paf       414: unistd.h \
                    415: process.h \
                    416: stddef.h \
                    417: stdarg.h \
                    418: fcntl.h \
                    419: sys/stat.h \
                    420: io.h \
                    421: stdio.h \
                    422: errno.h \
                    423: ctype.h \
                    424: math.h \
1.35      paf       425: crypt.h \
1.3       paf       426: time.h sys/time.h \
1.1       paf       427: stdlib.h \
                    428: string.h \
                    429: direct.h \
                    430: setjmp.h \
                    431: memory.h \
                    432: new \
                    433: sys/file.h \
                    434: sys/locking.h \
1.3       paf       435: sys/types.h \
1.5       paf       436: sys/select.h \
1.39      paf       437: sys/resource.h \
1.49      paf       438: winsock.h \
                    439: sys/socket.h \
                    440: netinet/in.h \
                    441: arpa/inet.h \
                    442: netdb.h
1.1       paf       443: )
                    444: 
                    445: dnl Checks for libraries.
                    446: 
                    447: dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
                    448: case "$host" in
                    449:   *-sunos5.6* | *-solaris2.6*)
                    450:       AC_CHECK_LIB(xnet, main)
                    451:   ;;
                    452:   *-sunos5* | *-solaris2*)
                    453:       AC_CHECK_LIB(socket, main)
                    454:       AC_CHECK_LIB(nsl, main)
                    455:   ;;
                    456:   *-nec-sysv4*)
                    457:       AC_CHECK_LIB(nsl, gethostbyname)
                    458:       AC_CHECK_LIB(socket, socket)
                    459:   ;;
                    460:   *-cygwin*)
                    461:       AC_DEFINE(WIN32,,Windows32 target platform)
                    462:       AC_CHECK_LIB(wsock32, socket)
                    463:   ;;
1.24      paf       464: # never tested this, only theoretically by letter from demos about parser2 build
1.25      paf       465:   *-hpux*)
1.24      paf       466:       AC_CHECK_LIB(nsl, main)
                    467:   ;;
1.1       paf       468: esac
                    469: 
                    470: AC_CHECK_LIB(m, sin)
                    471: 
1.35      paf       472: AC_CHECK_LIB(crypt, crypt)
                    473: 
1.1       paf       474: dnl Checks for functions.
                    475: 
                    476: AC_CHECK_FUNCS(
                    477: trunc \
                    478: round \
                    479: sign \
                    480: flock \
                    481: _locking \
1.7       paf       482: fcntl \
1.4       paf       483: lockf \
1.53      paf       484: ftruncate \
1.35      paf       485: getrusage \
1.47      paf       486: gettimeofday \
1.49      paf       487: crypt \
                    488: sigsetjmp siglongjmp
1.1       paf       489: )
1.3       paf       490: 
                    491: dnl We require qsort(3) and select(2).
                    492: 
                    493: AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.]))
                    494: AC_CHECK_FUNCS(select, , AC_MSG_ERROR([No select library function.]))
1.1       paf       495: 
1.46      paf       496: dnl For correct mail receiving we need to know local offset from GMT
                    497: dnl it be timezone+(daylight?60*60*sign(timezone):0)
                    498: dnl or it can be tm.tm_gmtoff
                    499: dnl or it can be tm.tm_tzadj
                    500: 
                    501: AC_MSG_CHECKING(for timezone variable)
                    502: AC_TRY_COMPILE([#include <time.h>],        
                    503: [
                    504: time_t test=timezone;
                    505: ],                                         
                    506: AC_DEFINE(HAVE_TIMEZONE)                  
                    507: AC_MSG_RESULT(yes),                        
                    508: AC_MSG_RESULT(no))                         
                    509: 
                    510: AC_MSG_CHECKING(for daylight variable)
                    511: AC_TRY_COMPILE([#include <time.h>],        
                    512: [
                    513: int test=daylight;
                    514: ],                                         
                    515: AC_DEFINE(HAVE_DAYLIGHT)              
                    516: AC_MSG_RESULT(yes),                        
                    517: AC_MSG_RESULT(no))                         
                    518: 
                    519: AC_MSG_CHECKING(for tm_gmtoff in struct tm)
                    520: AC_TRY_COMPILE([#include <time.h>],        
                    521: [struct tm tm;                             
                    522: tm.tm_gmtoff=0;                            
                    523: ],                                         
                    524: AC_DEFINE(HAVE_TM_GMTOFF)                  
                    525: AC_MSG_RESULT(yes),                        
                    526: AC_MSG_RESULT(no))                         
                    527: 
                    528: AC_MSG_CHECKING(for tm_tzadj in struct tm)
                    529: AC_TRY_COMPILE([#include <time.h>],        
                    530: [struct tm tm;                             
                    531: tm.tm_tzadj=0;                            
                    532: ],                                         
                    533: AC_DEFINE(HAVE_TM_TZADJ)                  
                    534: AC_MSG_RESULT(yes),                        
                    535: AC_MSG_RESULT(no))                         
                    536: 
                    537: 
1.1       paf       538: AC_MSG_CHECKING(whether compiler supports pragma pack)
                    539: AC_TRY_COMPILE(
                    540: #pragma pack(1)
1.28      paf       541: struct _1_byte {
1.1       paf       542:        char c;
1.28      paf       543: };
1.1       paf       544: #pragma pack()
1.28      paf       545: ,,[
1.1       paf       546:     AC_MSG_RESULT(yes)
                    547:        AC_DEFINE(HAVE_PRAGMA_PACK,,compiler supports pragma pack)
                    548: ],             
                    549:     AC_MSG_RESULT(no)
                    550: )
                    551: 
                    552: AC_MSG_CHECKING(for set_new_handler)
                    553: AC_TRY_COMPILE(
                    554: #ifdef HAVE_NEW
                    555: #include <new>
                    556: #endif
                    557: void failed_new() {}
                    558: ,
                    559: std::set_new_handler(failed_new);
                    560: ,[
                    561:     AC_MSG_RESULT(yes)
                    562:        AC_DEFINE(HAVE_SET_NEW_HANDLER,,library has set_new_handler func)
                    563: ],             
                    564:     AC_MSG_RESULT(no)
                    565: )
                    566: 
                    567: 
                    568: dnl AC_ARG_ENABLE(db, [  --enable-db             to enable 'hashfile' parser class],
                    569: dnl [
                    570: dnl if test "$enableval" != "no"; then
                    571: dnl AC_CHECK_HEADERS(db.h)
                    572: dnl AC_CHECK_LIB(db, __db_open)
                    573: dnl fi
                    574: dnl ]
                    575: dnl )
1.17      paf       576: 
1.1       paf       577: 
                    578: dnl Apache libs
1.10      paf       579: APACHE_LIBS="$LIBS $LIBADD_DL"
1.9       paf       580: dnl append stdc++ to libs list commented
                    581: dnl 1. because binary seem to work without it
                    582: dnl purpose of this: remove strange name dependance
                    583: dnl for linker creates reference not for libstc++.xx but
                    584: dnl for something specific to local system,
                    585: dnl thus reducing binary compatibility
                    586: dnl 2. for same reason linker of targets/cgi/parser3 changed to
                    587: dnl "C" compiler from "C++" compiler
                    588: dnl AC_CHECK_LIB(stdc++, __builtin_new,
                    589: dnl    APACHE_LIBS="$APACHE_LIBS -lstdc++"
                    590: dnl )
1.1       paf       591: AC_SUBST(APACHE_LIBS)
                    592: 
                    593: 
                    594: dnl install directories
                    595: 
                    596: # expand apostrophed
1.6       paf       597: e_prefix=$prefix
                    598: test "x$e_prefix" = xNONE && e_prefix=$ac_default_prefix
                    599: 
1.1       paf       600: e_sysconfdir=$sysconfdir
1.6       paf       601: test "$e_sysconfdir" = "\${prefix}/etc" && e_sysconfdir="${e_prefix}/etc"
1.1       paf       602: 
                    603: dnl these are used to fill in etc/parser3.conf
                    604: 
                    605: charsetsdir=$e_sysconfdir/parser3.charsets
                    606: AC_SUBST(charsetsdir)
                    607: 
                    608: # expand apostrophed
                    609: e_libdir=$libdir
                    610: if test "$e_libdir" = "\${exec_prefix}/lib"; then
                    611: 
                    612:     # Let make expand exec_prefix.
                    613:     e_exec_prefix=$exec_prefix
1.12      paf       614:     test "x$e_exec_prefix" = xNONE && e_exec_prefix=$e_prefix
1.1       paf       615: 
                    616:     # expand apostrophed
                    617:     test "$e_libdir" = "\${exec_prefix}/lib" && e_libdir="${e_exec_prefix}/lib"
                    618: fi
                    619: 
                    620: sqldriversdir=$e_libdir
                    621: AC_SUBST(sqldriversdir)
                    622: 
                    623: 
1.58      paf       624: dnl Output header and makefiles
                    625: 
                    626: AH_TEMPLATE([HAVE_DLD],[Define if you have the GNU dld library])
                    627: 
                    628: AH_TEMPLATE([HAVE_LIBDL],
                    629:        [Define if you have the libdl library or equivalent.])
                    630: 
                    631: AH_TEMPLATE([HAVE_SHL_LOAD],
                    632:        [Define if you have the shl_load function. ])
                    633: 
                    634: 
                    635: AH_TEMPLATE([size_t],
                    636:        [Define to `unsigned int' if <sys/types.h> does not define.])
                    637: 
                    638: AH_TEMPLATE([ssize_t],
                    639:        [Define to `int' if <sys/types.h> does not define.])
                    640: 
                    641: AH_TEMPLATE([HAVE_DAYLIGHT],
                    642:        [Define if you have daylight external variable in <time.h>])
                    643: 
                    644: AH_TEMPLATE([HAVE_TIMEZONE],
                    645:        [Define if you have timezone external variable in <time.h>])
                    646: 
                    647: AH_TEMPLATE([HAVE_TM_GMTOFF],
                    648:        [Define if you have tm_gmtoff member of tm structure in <time.h>])
                    649: 
                    650: AH_TEMPLATE([HAVE_TM_TZADJ],
                    651:        [Define if you have tm_tzadj member of tm structure in <time.h>])
                    652: 
1.1       paf       653: 
                    654: AM_CONFIG_HEADER(src/include/pa_config_auto.h)
1.51      paf       655: 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: