Annotation of parser3/configure.ac, revision 1.70

1.48      moko        1: dnl Autoconf initialization
1.1       moko        2: AC_PREREQ(2.59)
1.69      moko        3: AC_INIT(parser, 3.5.2b)
1.1       moko        4: AC_CONFIG_SRCDIR(README)
1.68      moko        5: AC_CONFIG_MACRO_DIRS(src/lib/ltdl/m4)
1.1       moko        6: 
                      7: 
1.14      moko        8: dnl Automake Initialization
1.1       moko        9: AM_INIT_AUTOMAKE
                     10: 
                     11: 
                     12: dnl Expand srcdir
                     13: P3S=`cd $srcdir/src ; pwd`
                     14: AC_SUBST(P3S)
                     15: 
                     16: 
                     17: dnl Parser version update
                     18: AC_CANONICAL_HOST
                     19: AC_DEFINE_UNQUOTED(PARSER_VERSION,"$VERSION (compiled on $host)",parser version)
                     20: 
                     21: AC_SUBST(host_os)
                     22: case $host_os in
                     23:   *cygwin* ) AC_DEFINE(CYGWIN,,using cygwin building environment);;
                     24: esac
                     25: 
                     26: 
                     27: dnl Checks for programs
                     28: AC_PROG_INSTALL
                     29: AC_PROG_AWK
                     30: 
                     31: AC_PROG_YACC
                     32: if test "$YACC" != "bison -y"; then
                     33:        AC_MSG_WARN(to regenerate Parser grammar YOU WOULD NEED BISON)
                     34: else
                     35:        AC_MSG_CHECKING(bison version)
                     36:        oldIFS=$IFS; IFS=.
                     37:        set `bison -V | sed -e 's/^GNU Bison version //' -e 's/^bison (GNU Bison) //' -e 's/$/./'`
                     38:        IFS=$oldIFS
                     39:        if test "$1" = "1" -a "$2" -lt "25"; then
                     40:                AC_MSG_WARN(Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2).)
                     41:        fi
                     42:        AC_MSG_RESULT($1.$2 (ok))
                     43: fi
                     44: 
                     45: AC_PROG_CXX
                     46: AC_PROG_CC
                     47: 
                     48: dnl most tests should be compiled with C compiler [especially qsort test]
1.68      moko       49: AC_LANG([C])
1.1       moko       50: 
                     51: 
                     52: dnl Dll extension
                     53: AC_MSG_CHECKING(for dynamic-link library extension)
                     54: case "$host_os" in
                     55:   *cygwin* ) dll_extension=dll;;
                     56:   * ) dll_extension=so
                     57: esac
                     58: AC_MSG_RESULT($dll_extension)
                     59: AC_SUBST(dll_extension)
                     60: 
                     61: 
                     62: dnl Misc arguments
                     63: AC_ARG_WITH(build-warnings, [  --with-build-warnings   to enable build-time compiler warnings if gcc is used],
                     64:        AC_MSG_WARN(enabling compiler warnings)
1.64      moko       65:        CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2 -Wextra -Wall -Wno-parentheses"
1.1       moko       66: )
                     67: 
1.15      moko       68: AC_ARG_WITH(coverage, [  --with-coverage         to enable gcov code coverage support],
1.9       moko       69:        AC_MSG_WARN(enabling gcov support)
                     70:        CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
                     71:        CXXFLAGS=`echo "$XXCFLAGS" | $SED -e 's/-O[0-9]*//g'`
                     72:        CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
                     73:        CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
                     74:        LDFLAGS="$LDFLAGS -lgcov"
                     75: )
                     76: 
1.15      moko       77: AC_ARG_WITH(profiler, [  --with-profiler         to enable gprof code profiler support],
1.9       moko       78:        AC_MSG_WARN(enabling gprof support)
1.24      moko       79:        CFLAGS="$CFLAGS -O0 -pg -g"
                     80:        CXXFLAGS="$CXXFLAGS -O0 -pg -g"
1.9       moko       81: )
                     82: 
1.1       moko       83: AC_ARG_WITH(assertions, [  --with-assertions       to enable assertions],
                     84:        AC_MSG_WARN(enabling assertions)
                     85: ,
                     86:        AC_DEFINE(NDEBUG,,assertions disabled)
                     87: )
                     88: 
1.37      moko       89: AC_ARG_WITH(sjlj-exceptions, [  --with-sjlj-exceptions  to enable simple 'throw' from dynamic library],
1.1       moko       90:        AC_DEFINE(PA_WITH_SJLJ_EXCEPTIONS,,one can throw from dynamic library)
                     91: )
                     92: 
                     93: 
1.37      moko       94: AC_ARG_WITH(system-cfg, [  --with-system-cfg=FILE  to specify system-wide auto.p],
                     95:        AC_DEFINE_UNQUOTED(SYSTEM_CONFIG_FILE,"$withval",system-wide auto.p)
1.35      moko       96: )
                     97: 
                     98: 
1.1       moko       99: dnl Safe mode argument
                    100: AC_ARG_ENABLE(safe-mode, [  --disable-safe-mode          to enable reading and executing
                    101:                           files belonging to group+user other then effective],
                    102: [
                    103:        SAFE_MODE=$enableval
                    104: ]
                    105: )
                    106: 
                    107: if test "$SAFE_MODE" = "no"; then
                    108:        AC_MSG_WARN(enabling reading of files belonging to group+user other then effective)
                    109: else
                    110:        AC_DEFINE(PA_SAFE_MODE,,disabled reading of files belonging to group+user other then effective)
                    111: fi
                    112: 
                    113: 
                    114: dnl Disable execs argument
                    115: AC_ARG_ENABLE(execs, [  --disable-execs          to disable any execs
                    116:                           (file::exec, file::cgi, unix mail:send)],
                    117: [
                    118: if test "$enableval" = "no"; then
                    119:        AC_MSG_WARN(disabling file execs)
                    120:        AC_DEFINE(NO_PA_EXECS,,pa_exec disabled)
                    121: fi
                    122: ]
                    123: )
                    124: 
                    125: 
                    126: dnl String stream argument
1.28      moko      127: AC_ARG_ENABLE(stringstream, [  --disable-stringstream to disable stringstream usage.
                    128:                           when disabled table.save uses more memory, but more compilers are supported],
1.1       moko      129: [
                    130: if test "$enableval" = "no"; then
                    131:        AC_MSG_WARN(disabling stringstream usage)
                    132:        AC_DEFINE(NO_STRINGSTREAM,,stringstream disabled)
                    133: fi
                    134: ]
                    135: )
                    136: 
                    137: 
                    138: dnl GC argument
1.35      moko      139: AC_ARG_WITH(gc,[  --with-gc[=DIR]           DIR is the directory where
1.1       moko      140:                           Boehm garbage collecting library is installed],[
                    141: 
                    142:        GC=$withval
                    143:        GC_LIBS="$GC/libgc.la"
                    144: 
                    145:        if test -f $GC_LIBS; then
                    146:                GC_OK="yes"
                    147:        else
                    148:                GC_LIBS="-L$GC -lgc"
                    149:        fi
                    150: 
                    151:        if test "$GC" = "yes"; then
                    152:                GC=""
                    153:                GC_LIBS="-lgc"
                    154:                AC_MSG_WARN([--with-gc value was not specified, hoping linker would find it])
                    155:        fi
                    156: ],[
                    157:        GC_LIBS="-lgc"
                    158:        AC_MSG_WARN([--with-gc was not specified, hoping linker would find it])
                    159: ])
                    160: 
                    161: if test -z "$GC_OK"; then
                    162:        AC_MSG_CHECKING(for libgc)
                    163:        SAVE_LIBS=$LIBS
                    164:        LIBS="$LIBS $GC_LIBS"
1.68      moko      165:        PA_TRY_LINK([ extern int GC_dont_gc; ],[ GC_dont_gc=0; ],
1.1       moko      166:                AC_MSG_RESULT(yes)
                    167:        ,
                    168:                AC_MSG_RESULT(no)
                    169:                if test -z "$GC"; then
1.35      moko      170:                        AC_MSG_ERROR(please specify path to libgc: --with-gc=DIR)
1.1       moko      171:                else
                    172:                        AC_MSG_ERROR($GC does not seem to be valid libgc installation directory)
                    173:                fi
                    174:        )
                    175:        LIBS=$SAVE_LIBS
                    176: fi
                    177: 
                    178: AC_SUBST(GC_LIBS)
                    179: 
                    180: 
                    181: dnl PCRE argument
1.35      moko      182: AC_ARG_WITH(pcre,[  --with-pcre=DIR         DIR is the directory where
1.1       moko      183:                           PCRE library is installed],[
                    184:        PCRE=$withval
                    185: 
                    186:        if test "$PCRE" = "yes"; then
                    187:                PCRE=""
                    188:                AC_MSG_WARN([--with-pcre value was not specified, hoping linker would find it])
1.55      moko      189:        else
                    190:                PCRE_INCLUDES="-I$PCRE/include"
                    191: 
                    192:                if test -f $PCRE/include/pcre.h -a -f $PCRE/lib/libpcre.la; then
                    193:                        PCRE_OK="yes"
                    194:                        PCRE_LIBS="$PCRE/lib/libpcre.la"
                    195:                else
                    196:                        if test -f $PCRE/include/pcre2.h -a -f $PCRE/lib/libpcre2-8.la; then
                    197:                                PCRE_OK="yes"
                    198:                                PCRE_LIBS="$PCRE/lib/libpcre2-8.la"
                    199:                                AC_DEFINE(HAVE_PCRE2,,PCRE2 is available)
                    200:                        else
                    201:                                PCRE_LIBS="-L$PCRE/lib"
                    202:                        fi
                    203:                fi
1.1       moko      204:        fi
                    205: ],[
                    206:        AC_MSG_WARN([--with-pcre was not specified, hoping linker would find it])
                    207: ])
                    208: 
                    209: if test -z "$PCRE_OK"; then
1.55      moko      210:        AC_MSG_CHECKING(for pcre2)
                    211:        SAVE_LIBS=$LIBS
                    212:        LIBS="$LIBS $PCRE_LIBS $PCRE_INCLUDES -lpcre2-8"
1.68      moko      213:        PA_TRY_LINK([ #define PCRE2_CODE_UNIT_WIDTH 8
1.55      moko      214: #include <pcre2.h> ],[ void *v=pcre2_general_context_create(0,0,0); ],
                    215:                AC_MSG_RESULT(yes)
                    216:                PCRE_LIBS="$PCRE_LIBS -lpcre2-8"
                    217:                AC_DEFINE(HAVE_PCRE2,,PCRE2 is available)
                    218:                PCRE_OK="yes"
                    219:        ,
                    220:                AC_MSG_RESULT(no)
                    221:        )
                    222:        LIBS=$SAVE_LIBS
                    223: fi
                    224: 
                    225: if test -z "$PCRE_OK"; then
                    226:        AC_MSG_CHECKING(for pcre)
                    227:        PCRE_LIBS="$PCRE_LIBS -lpcre"
1.1       moko      228:        SAVE_LIBS=$LIBS
                    229:        LIBS="$LIBS $PCRE_LIBS $PCRE_INCLUDES"
1.68      moko      230:        PA_TRY_LINK([ #include <pcre.h> ],[ const char *v=pcre_version(); ],
1.1       moko      231:                AC_MSG_RESULT(yes)
                    232:        ,
                    233:                AC_MSG_RESULT(no)
                    234:                if test -z "$PCRE"; then
1.35      moko      235:                        AC_MSG_ERROR(please specify path to PCRE: --with-pcre=DIR)
1.1       moko      236:                else
                    237:                        AC_MSG_ERROR($PCRE does not seem to be valid PCRE installation directory)
                    238:                fi
                    239:        )
                    240:        LIBS=$SAVE_LIBS
                    241: fi
                    242: 
                    243: AC_SUBST(PCRE_INCLUDES)
                    244: AC_SUBST(PCRE_LIBS)
                    245: 
                    246: 
                    247: dnl XML/XSLT argument
1.35      moko      248: AC_ARG_WITH(xml,[  --with-xml=DIR          DIR is the directory where
1.1       moko      249:                           Gnome XML libraries are installed],[
                    250: 
                    251:        XML=$withval
                    252:        XML_LIBS="-lxml2 -lxslt -lexslt"
                    253: 
                    254:        if test -z "$XML" -o "$XML" = "yes"; then
                    255:                XML=""
                    256:                XML_INCLUDES="-I/usr/include/libxml2"
                    257:                AC_MSG_WARN([--with-xml value was not specified, hoping linker would find it])
                    258:        else
                    259:                XML_INCLUDES="-I$XML/include -I$XML/include/libxml2"
1.24      moko      260:                XML_LIBS="-L$XML/lib $XML_LIBS"
1.1       moko      261: 
                    262:                if test -f $XML/include/libxslt/xslt.h -a -f $XML/lib/libxml2.la \
                    263:                        -a -f $XML/lib/libxslt.la -a -f $XML/lib/libexslt.la; then
                    264:                        XML_LIBS="$XML/lib/libxml2.la $XML/lib/libxslt.la $XML/lib/libexslt.la"
                    265:                        XML_OK="yes"
                    266:                fi
                    267:        fi
                    268: 
                    269:        if test -z "$XML_OK"; then
                    270:                AC_MSG_CHECKING(for xml)
                    271:                SAVE_LIBS=$LIBS
                    272:                LIBS="$LIBS $XML_LIBS $XML_INCLUDES"
1.68      moko      273:                PA_TRY_LINK([ #include <libxslt/xslt.h> ],[ const char *v=xsltEngineVersion; ],
1.1       moko      274:                        AC_MSG_RESULT(yes)
                    275:                ,
                    276:                        AC_MSG_RESULT(no)
                    277:                        if test -z "$XML"; then
1.35      moko      278:                                AC_MSG_ERROR(please specify path to Gnome XML libraries: --with-xml=DIR)
1.1       moko      279:                        else
                    280:                                AC_MSG_ERROR($XML does not seem to be valid Gnome XML installation directory)
                    281:                        fi
                    282:                )
                    283:                LIBS=$SAVE_LIBS
                    284:        fi
                    285:        AC_DEFINE(XML,,xml-abled parser)
                    286: ])
                    287: 
                    288: AC_SUBST(XML_INCLUDES)
                    289: AC_SUBST(XML_LIBS)
                    290: 
                    291: 
                    292: dnl Mail receive argument
1.35      moko      293: AC_ARG_WITH(mailreceive,[  --with-mailreceive=DIR  is the directory where
1.1       moko      294:                           Gnome MIME library is installed],[
                    295:        MIME=$withval
                    296:        GLIB="glib-2.0"
                    297:        GMIME="gmime-2.4"
                    298: 
                    299:        if test -z "$MIME" -o "$MIME" = "yes"; then
                    300:                MIME=""
                    301:                MIME_INCLUDES=`pkg-config --cflags $GMIME 2>/dev/null`
                    302:                MIME_LIBS=`pkg-config --libs $GMIME 2>/dev/null`
1.26      moko      303:                if test -z "$MIME_LIBS"; then
                    304:                        GMIME="gmime-3.0"
                    305:                        MIME_INCLUDES=`pkg-config --cflags $GMIME 2>/dev/null`
                    306:                        MIME_LIBS=`pkg-config --libs $GMIME 2>/dev/null`
                    307:                fi
1.1       moko      308:                AC_MSG_WARN([--with-mailreceive value was not specified, hoping linker would find Gnome MIME library])
                    309:        else
                    310:                MIME_INCLUDES="-I$MIME/include/$GMIME"
                    311:                MIME_LIBS="-l$GMIME"
                    312:                if test -f $MIME/include/$GMIME/gmime/gmime.h -a -f $MIME/lib/lib$GMIME.la; then
                    313:                        MIME_LIBS="$MIME/lib/lib$GMIME.la"
                    314:                        if test -f $MIME/lib/lib$GLIB.la; then
                    315:                                MIME_INCLUDES="$MIME_INCLUDES -I$MIME/include/$GLIB -I$MIME/lib/$GLIB/include"
                    316:                        else
                    317:                                GLIB_INCLUDES=`pkg-config --cflags $GLIB 2>/dev/null`
                    318:                                MIME_INCLUDES="$MIME_INCLUDES $GLIB_INCLUDES"
                    319:                        fi
                    320:                        MIME_OK="yes"
                    321:                fi
                    322:        fi
                    323: 
                    324:        if test -z "$MIME_OK"; then
                    325:                AC_MSG_CHECKING(for mime)
                    326:                SAVE_LIBS=$LIBS
                    327:                LIBS="$LIBS $MIME_LIBS $MIME_INCLUDES"
1.68      moko      328:                PA_TRY_LINK([ #include <gmime/gmime.h> ],[ guint v=gmime_major_version; ],
1.1       moko      329:                        AC_MSG_RESULT(yes)
                    330:                ,
                    331:                        AC_MSG_RESULT(no)
                    332:                        if test -z "$MIME"; then
1.35      moko      333:                                AC_MSG_ERROR(please specify path to Gnome MIME library: --with-mailreceive=DIR)
1.1       moko      334:                        else
                    335:                                AC_MSG_ERROR($MIME does not seem to be valid Gnome MIME installation directory)
                    336:                        fi
                    337:                )
                    338:                LIBS=$SAVE_LIBS
                    339:        fi
                    340:        AC_DEFINE(WITH_MAILRECEIVE,,has \$mail:received)
                    341: ])
                    342: 
                    343: AC_SUBST(MIME_INCLUDES)
                    344: AC_SUBST(MIME_LIBS)
                    345: 
                    346: 
                    347: dnl Sendmail argument
                    348: AC_ARG_WITH(sendmail,[  \"--with-sendmail=COMMAND\" forces this command to send mail.
                    349:                           example: \"--with-sendmail=/usr/sbin/sendmail -t\"
                    350:                           (makes parser ignore user-defined sendmail commands)],
                    351:        AC_DEFINE_UNQUOTED(PA_FORCED_SENDMAIL,"$withval",parser uses this command instead of user-defined sendmail commands)
                    352: )
                    353: 
                    354: 
                    355: dnl Apache module argument
                    356: AC_ARG_WITH(apache,[  --with-apache=FILE      FILE is the full path for APXS
                    357:                           builds apache DSO module using apxs],[
                    358:        APXS=$withval
                    359: 
                    360:        if test -z "$APXS" -o "$APXS" = "yes"; then
                    361:                APXS=`which apxs 2>/dev/null`
                    362:                if test -z "$APXS"; then
                    363:                        APXS=`which apxs2 2>/dev/null`
                    364:                fi
                    365:        fi
                    366: 
                    367:        APACHE=`$APXS -q TARGET 2>/dev/null`
                    368: 
                    369:        if test -z "$APACHE"; then
                    370:                AC_MSG_ERROR($APXS does not seem to be valid apache apxs utility path)
                    371:        fi
                    372: 
                    373:        APACHE_MAIN_INC=`$APXS -q INCLUDEDIR`
                    374:        APACHE_EXTRA_INC=`$APXS -q EXTRA_INCLUDES 2>/dev/null`
                    375:        APACHE_INC="-I$APACHE_MAIN_INC $APACHE_EXTRA_INC"
                    376:        APACHE_CFLAGS=`$APXS -q CFLAGS`
                    377: ])
                    378: AC_SUBST(APACHE)
                    379: AC_SUBST(APACHE_INC)
                    380: AC_SUBST(APACHE_CFLAGS)
                    381: AM_CONDITIONAL(COMPILE_APACHE_MODULE, test -n "$APACHE")
                    382: 
                    383: 
                    384: dnl Enable building of the convenience library
                    385: LT_CONFIG_LTDL_DIR(src/lib/ltdl)
                    386: LT_INIT(dlopen win32-dll no-pic)
                    387: LTDL_INIT
                    388: 
                    389: 
                    390: dnl Checks for typedefs, structures, and compiler characteristics
                    391: AC_C_BIGENDIAN(
                    392:        AC_DEFINE(PA_BIG_ENDIAN,,compile for sparc processor)
                    393: ,
                    394:        AC_DEFINE(PA_LITTLE_ENDIAN,,compile for intel processor or compatible)
                    395: ,
                    396:        AC_MSG_ERROR(word endianness not determined for some obscure reason)
                    397: )
                    398: 
                    399: AC_TYPE_SIZE_T
                    400: AC_TYPE_SSIZE_T
                    401: AC_TYPE_UINT8_T
                    402: AC_TYPE_UINT16_T
                    403: AC_TYPE_UINT32_T
                    404: AC_TYPE_UINT64_T
                    405: 
                    406: AC_STRUCT_DIRENT_D_TYPE
                    407: 
                    408: AC_SYS_LARGEFILE
                    409: 
                    410: dnl Checks for C header files
                    411: AC_CHECK_HEADERS(stdio.h sys/types.h sys/stat.h stdlib.h stddef.h memory.h string.h strings.h inttypes.h stdint.h unistd.h)
1.68      moko      412: AC_CHECK_HEADERS(time.h sys/time.h assert.h limits.h ctype.h math.h process.h stdarg.h setjmp.h signal.h pthread.h)
1.1       moko      413: AC_CHECK_HEADERS(errno.h dirent.h fcntl.h io.h sys/file.h sys/locking.h sys/select.h sys/resource.h sys/wait.h)
                    414: AC_CHECK_HEADERS(sys/socket.h netinet/in.h arpa/inet.h netdb.h)
                    415: 
                    416: 
                    417: dnl Checks for libraries
                    418: case "$host" in
                    419:   *-freebsd4*)
1.28      moko      420:          AC_DEFINE(FREEBSD4,,FreeBSD4.X target platform)
                    421:   ;;
                    422:   *-freebsd1*)
                    423:          AC_DEFINE(FREEBSD1X,,FreeBSD1X.X target platform)
1.1       moko      424:   ;;
                    425:   *-sunos5.6* | *-solaris2.6*)
                    426:          AC_CHECK_LIB(xnet, main)
                    427:   ;;
                    428:   *-sunos5* | *-solaris2*)
                    429:          AC_CHECK_LIB(socket, main)
                    430:          AC_CHECK_LIB(nsl, main)
                    431:   ;;
                    432:   *-nec-sysv4*)
                    433:          AC_CHECK_LIB(nsl, gethostbyname)
                    434:          AC_CHECK_LIB(socket, socket)
                    435:   ;;
                    436:   *-cygwin*)
                    437:          AC_DEFINE(WIN32,,Windows32 target platform)
                    438:   ;;
                    439: esac
                    440: 
                    441: AC_CHECK_LIB(m, sin)
                    442: AC_CHECK_LIB(crypt, crypt)
                    443: 
                    444: 
                    445: dnl Checks for functions
1.59      moko      446: AC_CHECK_FUNCS(flock fcntl lockf ftruncate fchmod)
1.66      moko      447: AC_CHECK_FUNCS(getrusage gettimeofday crypt sigsetjmp siglongjmp unsetenv syslog)
1.1       moko      448: 
                    449: 
                    450: dnl on some linux[seen on 2.4] it's a macro
                    451: PA_CHECK_SIGSETJMP
                    452: 
                    453: 
                    454: dnl see comment above
                    455: AC_LANG_PUSH(C++)
1.19      moko      456: PA_CHECK_MATH_FUNCS_ONE_ARG(trunc round sign isfinite)
1.1       moko      457: AC_LANG_POP
                    458: 
                    459: 
                    460: dnl We require qsort(3)
                    461: AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.]))
                    462: 
                    463: 
                    464: dnl For build-in date implementation we need to know local offset from GMT
                    465: 
                    466: AC_LANG_PUSH(C++)
                    467: AC_MSG_CHECKING(for timezone variable)
1.68      moko      468: PA_TRY_COMPILE([#include <time.h>], [int test=timezone;], AC_DEFINE(HAVE_TIMEZONE) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
1.1       moko      469: AC_LANG_POP
                    470: 
                    471: AC_MSG_CHECKING(for tm_gmtoff in struct tm)
1.68      moko      472: PA_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff=0;], AC_DEFINE(HAVE_TM_GMTOFF) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
1.1       moko      473: 
                    474: AC_MSG_CHECKING(for tm_tzadj in struct tm)
1.68      moko      475: PA_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj=0;], AC_DEFINE(HAVE_TM_TZADJ) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
1.1       moko      476: 
1.41      moko      477: AC_MSG_CHECKING(for gettid)
1.68      moko      478: PA_TRY_COMPILE([
1.41      moko      479: #include <sys/types.h>
                    480: #include <sys/syscall.h>
                    481: ], [uint tid=syscall(__NR_gettid);], AC_DEFINE(HAVE_GETTID) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
                    482: 
1.45      moko      483: AC_MSG_CHECKING(for TLS)
1.68      moko      484: PA_TRY_COMPILE([__thread int i=0;], [], AC_DEFINE(HAVE_TLS) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
1.45      moko      485: 
1.1       moko      486: AC_MSG_CHECKING(for 0..9999 year date range support)
1.68      moko      487: AC_RUN_IFELSE([AC_LANG_SOURCE([
1.1       moko      488: #include <string.h>
                    489: #include <time.h>
                    490: 
                    491: int main() {
                    492:        struct tm tmL,tmH;
                    493:        memset(&tmL, 0, sizeof(tmL));
                    494:        memset(&tmH, 0, sizeof(tmH));
                    495:        tmL.tm_year=-1900;
                    496:        tmL.tm_mon=-1;
                    497:        tmH.tm_year=9999-1900;
                    498:        tmH.tm_mon=12-1;
                    499:        tmH.tm_mday=31;
                    500:        return mktime(&tmL)==-1 || mktime(&tmH)==-1;
                    501: }
1.68      moko      502: ])], AC_DEFINE(PA_DATE64) AC_MSG_RESULT(yes), AC_MSG_RESULT(no), AC_MSG_RESULT(no))
1.1       moko      503: 
                    504: dnl Output header and makefiles
                    505: AH_TEMPLATE([HAVE_TIMEZONE],[Define if you have timezone external variable in <time.h>])
                    506: AH_TEMPLATE([HAVE_TM_GMTOFF],[Define if you have tm_gmtoff member of tm structure in <time.h>])
                    507: AH_TEMPLATE([HAVE_TM_TZADJ],[Define if you have tm_tzadj member of tm structure in <time.h>])
1.41      moko      508: AH_TEMPLATE([HAVE_GETTID],[Define if you have gettid()])
1.45      moko      509: AH_TEMPLATE([HAVE_TLS],[Define if you have Thread-Local Storage])
1.1       moko      510: AH_TEMPLATE([PA_DATE64],[Define if you have 0..9999 year date range support])
                    511: 
1.68      moko      512: AC_CONFIG_HEADERS(src/include/pa_config_auto.h)
1.1       moko      513: 
1.68      moko      514: AC_CONFIG_FILES([
                    515:        Makefile
                    516:        src/Makefile
                    517:        src/types/Makefile
                    518:        src/classes/Makefile
                    519:        src/include/Makefile
                    520:        src/main/Makefile
                    521:        src/sql/Makefile
                    522:        src/lib/Makefile
                    523:        src/lib/gd/Makefile
                    524:        src/lib/smtp/Makefile
                    525:        src/lib/gc/Makefile
1.1       moko      526:        src/lib/gc/include/Makefile
1.68      moko      527:        src/lib/pcre/Makefile
1.1       moko      528:        src/lib/cord/Makefile
                    529:        src/lib/cord/include/Makefile
                    530:        src/lib/cord/include/private/Makefile
                    531:        src/lib/md5/Makefile
                    532:        src/lib/sdbm/Makefile
                    533:        src/lib/sdbm/pa-include/Makefile
                    534:        src/lib/json/Makefile
                    535:        src/lib/curl/Makefile
                    536:        src/lib/punycode/Makefile
                    537:        src/lib/memcached/Makefile
                    538:        src/targets/Makefile
                    539:        src/targets/cgi/Makefile
                    540:        src/targets/apache/Makefile
                    541:        src/targets/isapi/Makefile
                    542:        etc/Makefile
                    543:        etc/parser3.charsets/Makefile
1.68      moko      544:        etc/auto.p])
                    545: AC_OUTPUT

E-mail: