Annotation of parser3/configure.in, revision 1.47

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