Annotation of parser3/configure.in, revision 1.62.2.4

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