Annotation of parser3/configure.in, revision 1.68

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

E-mail: