Annotation of parser3/configure.in, revision 1.58

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