Annotation of parser3/configure.ac, revision 1.79

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: 
1.71      moko      347: dnl RabbitMQ library argument
                    348: AC_ARG_WITH(amqp,[  --with-amqp=DIR         DIR is the directory where
                    349:                           RabbitMQ C library (librabbitmq) is installed],[
                    350:     AMQP=$withval
                    351: 
                    352:     if test -z "$AMQP" -o "$AMQP" = "yes"; then
                    353:         AMQP_INCLUDES=""
                    354:         AMQP_LIBS="-lrabbitmq"
                    355:         AC_MSG_WARN([--with-amqp value was not specified, hoping linker would find it])
                    356:     else
                    357:         AMQP_INCLUDES="-I$AMQP/include"
                    358:         if test -f $AMQP/lib/librabbitmq.la; then
                    359:             AMQP_LIBS="$AMQP/lib/librabbitmq.la"
                    360:         else
                    361:             AMQP_LIBS="-L$AMQP/lib -lrabbitmq"
                    362:         fi
                    363:     fi
                    364: 
                    365:     AC_MSG_CHECKING(for librabbitmq)
                    366:     SAVE_LIBS=$LIBS
                    367:     LIBS="$LIBS $AMQP_LIBS $AMQP_INCLUDES"
                    368:     PA_TRY_LINK([ #include <amqp.h> ],[ amqp_connection_state_t c = 0; ],
                    369:         AC_MSG_RESULT(yes)
                    370:     ,
                    371:         AC_MSG_RESULT(no)
                    372:         if test -z "$AMQP"; then
                    373:             AC_MSG_ERROR(please specify path to librabbitmq: --with-amqp=DIR)
                    374:         else
                    375:             AC_MSG_ERROR($AMQP does not seem to be valid librabbitmq installation directory)
                    376:         fi
                    377:     )
                    378:     LIBS=$SAVE_LIBS
1.79    ! moko      379: 
        !           380:     SAVE_CPPFLAGS=$CPPFLAGS
        !           381:     CPPFLAGS="$CPPFLAGS $AMQP_INCLUDES"
        !           382:     AC_CHECK_HEADER([amqp_ssl_socket.h],,[AC_DEFINE([WITHOUT_AMQP_SSL],,[librabbitmq without SSL support])])
        !           383:     CPPFLAGS=$SAVE_CPPFLAGS
        !           384: 
1.71      moko      385:     AC_DEFINE(WITH_AMQP,,has amqp)
                    386: ])
                    387: 
                    388: AC_SUBST(AMQP_INCLUDES)
                    389: AC_SUBST(AMQP_LIBS)
                    390: 
1.77      moko      391: 
                    392: dnl Redis library argument
                    393: AC_ARG_WITH(redis,[  --with-redis=DIR        DIR is the directory where
                    394:                           Redis C library (hiredis) is installed],[
                    395:     REDIS=$withval
                    396: 
                    397:     if test -z "$REDIS" -o "$REDIS" = "yes"; then
                    398:         REDIS_INCLUDES=""
                    399:         REDIS_LIBS="-lhiredis"
                    400:         AC_MSG_WARN([--with-redis value was not specified, hoping linker would find it])
                    401:     else
                    402:         REDIS_INCLUDES="-I$REDIS/include"
                    403:         if test -f $REDIS/lib/libhiredis.la; then
                    404:             REDIS_LIBS="$REDIS/lib/libhiredis.la"
                    405:         else
                    406:             REDIS_LIBS="-L$REDIS/lib -lhiredis"
                    407:         fi
                    408:     fi
                    409: 
                    410:     AC_MSG_CHECKING(for hiredis)
                    411:     SAVE_LIBS=$LIBS
                    412:     LIBS="$LIBS $REDIS_LIBS $REDIS_INCLUDES"
                    413:     PA_TRY_LINK([ #include <hiredis/hiredis.h> ],[ redisContext *c = redisConnect("", 0); ],
                    414:         AC_MSG_RESULT(yes)
                    415:     ,
                    416:         AC_MSG_RESULT(no)
                    417:         if test -z "$REDIS"; then
                    418:             AC_MSG_ERROR(please specify path to hiredis: --with-redis=DIR)
                    419:         else
                    420:             AC_MSG_ERROR($REDIS does not seem to be valid hiredis installation directory)
                    421:         fi
                    422:     )
                    423:     LIBS=$SAVE_LIBS
                    424:     AC_DEFINE(WITH_REDIS,,has redis)
                    425: ])
                    426: 
                    427: AC_SUBST(REDIS_INCLUDES)
                    428: AC_SUBST(REDIS_LIBS)
                    429: 
1.1       moko      430: dnl Sendmail argument
                    431: AC_ARG_WITH(sendmail,[  \"--with-sendmail=COMMAND\" forces this command to send mail.
                    432:                           example: \"--with-sendmail=/usr/sbin/sendmail -t\"
                    433:                           (makes parser ignore user-defined sendmail commands)],
                    434:        AC_DEFINE_UNQUOTED(PA_FORCED_SENDMAIL,"$withval",parser uses this command instead of user-defined sendmail commands)
                    435: )
                    436: 
                    437: 
                    438: dnl Apache module argument
                    439: AC_ARG_WITH(apache,[  --with-apache=FILE      FILE is the full path for APXS
                    440:                           builds apache DSO module using apxs],[
                    441:        APXS=$withval
                    442: 
                    443:        if test -z "$APXS" -o "$APXS" = "yes"; then
                    444:                APXS=`which apxs 2>/dev/null`
                    445:                if test -z "$APXS"; then
                    446:                        APXS=`which apxs2 2>/dev/null`
                    447:                fi
                    448:        fi
                    449: 
                    450:        APACHE=`$APXS -q TARGET 2>/dev/null`
                    451: 
                    452:        if test -z "$APACHE"; then
                    453:                AC_MSG_ERROR($APXS does not seem to be valid apache apxs utility path)
                    454:        fi
                    455: 
                    456:        APACHE_MAIN_INC=`$APXS -q INCLUDEDIR`
                    457:        APACHE_EXTRA_INC=`$APXS -q EXTRA_INCLUDES 2>/dev/null`
                    458:        APACHE_INC="-I$APACHE_MAIN_INC $APACHE_EXTRA_INC"
                    459:        APACHE_CFLAGS=`$APXS -q CFLAGS`
                    460: ])
                    461: AC_SUBST(APACHE)
                    462: AC_SUBST(APACHE_INC)
                    463: AC_SUBST(APACHE_CFLAGS)
                    464: AM_CONDITIONAL(COMPILE_APACHE_MODULE, test -n "$APACHE")
                    465: 
                    466: 
                    467: dnl Enable building of the convenience library
                    468: LT_CONFIG_LTDL_DIR(src/lib/ltdl)
                    469: LT_INIT(dlopen win32-dll no-pic)
                    470: LTDL_INIT
                    471: 
                    472: 
                    473: dnl Checks for typedefs, structures, and compiler characteristics
                    474: AC_C_BIGENDIAN(
                    475:        AC_DEFINE(PA_BIG_ENDIAN,,compile for sparc processor)
                    476: ,
                    477:        AC_DEFINE(PA_LITTLE_ENDIAN,,compile for intel processor or compatible)
                    478: ,
                    479:        AC_MSG_ERROR(word endianness not determined for some obscure reason)
                    480: )
                    481: 
                    482: AC_TYPE_SIZE_T
                    483: AC_TYPE_SSIZE_T
                    484: AC_TYPE_UINT8_T
                    485: AC_TYPE_UINT16_T
                    486: AC_TYPE_UINT32_T
                    487: AC_TYPE_UINT64_T
1.73      moko      488: AC_TYPE_INT64_T
1.1       moko      489: 
                    490: AC_STRUCT_DIRENT_D_TYPE
                    491: 
                    492: AC_SYS_LARGEFILE
                    493: 
                    494: dnl Checks for C header files
                    495: 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      496: 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      497: 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)
                    498: AC_CHECK_HEADERS(sys/socket.h netinet/in.h arpa/inet.h netdb.h)
                    499: 
                    500: 
                    501: dnl Checks for libraries
                    502: case "$host" in
                    503:   *-freebsd4*)
1.28      moko      504:          AC_DEFINE(FREEBSD4,,FreeBSD4.X target platform)
                    505:   ;;
                    506:   *-freebsd1*)
                    507:          AC_DEFINE(FREEBSD1X,,FreeBSD1X.X target platform)
1.1       moko      508:   ;;
                    509:   *-sunos5.6* | *-solaris2.6*)
                    510:          AC_CHECK_LIB(xnet, main)
                    511:   ;;
                    512:   *-sunos5* | *-solaris2*)
                    513:          AC_CHECK_LIB(socket, main)
                    514:          AC_CHECK_LIB(nsl, main)
                    515:   ;;
                    516:   *-nec-sysv4*)
                    517:          AC_CHECK_LIB(nsl, gethostbyname)
                    518:          AC_CHECK_LIB(socket, socket)
                    519:   ;;
                    520:   *-cygwin*)
                    521:          AC_DEFINE(WIN32,,Windows32 target platform)
                    522:   ;;
                    523: esac
                    524: 
                    525: AC_CHECK_LIB(m, sin)
                    526: AC_CHECK_LIB(crypt, crypt)
                    527: 
                    528: 
                    529: dnl Checks for functions
1.59      moko      530: AC_CHECK_FUNCS(flock fcntl lockf ftruncate fchmod)
1.66      moko      531: AC_CHECK_FUNCS(getrusage gettimeofday crypt sigsetjmp siglongjmp unsetenv syslog)
1.1       moko      532: 
                    533: 
                    534: dnl on some linux[seen on 2.4] it's a macro
                    535: PA_CHECK_SIGSETJMP
                    536: 
                    537: 
                    538: dnl see comment above
                    539: AC_LANG_PUSH(C++)
1.19      moko      540: PA_CHECK_MATH_FUNCS_ONE_ARG(trunc round sign isfinite)
1.1       moko      541: AC_LANG_POP
                    542: 
                    543: 
                    544: dnl We require qsort(3)
                    545: AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.]))
                    546: 
                    547: 
                    548: dnl For build-in date implementation we need to know local offset from GMT
                    549: 
                    550: AC_LANG_PUSH(C++)
                    551: AC_MSG_CHECKING(for timezone variable)
1.68      moko      552: PA_TRY_COMPILE([#include <time.h>], [int test=timezone;], AC_DEFINE(HAVE_TIMEZONE) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
1.1       moko      553: AC_LANG_POP
                    554: 
                    555: AC_MSG_CHECKING(for tm_gmtoff in struct tm)
1.68      moko      556: 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      557: 
                    558: AC_MSG_CHECKING(for tm_tzadj in struct tm)
1.68      moko      559: 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      560: 
1.41      moko      561: AC_MSG_CHECKING(for gettid)
1.68      moko      562: PA_TRY_COMPILE([
1.41      moko      563: #include <sys/types.h>
                    564: #include <sys/syscall.h>
                    565: ], [uint tid=syscall(__NR_gettid);], AC_DEFINE(HAVE_GETTID) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
                    566: 
1.45      moko      567: AC_MSG_CHECKING(for TLS)
1.68      moko      568: PA_TRY_COMPILE([__thread int i=0;], [], AC_DEFINE(HAVE_TLS) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
1.45      moko      569: 
1.1       moko      570: AC_MSG_CHECKING(for 0..9999 year date range support)
1.68      moko      571: AC_RUN_IFELSE([AC_LANG_SOURCE([
1.1       moko      572: #include <string.h>
                    573: #include <time.h>
                    574: 
                    575: int main() {
                    576:        struct tm tmL,tmH;
                    577:        memset(&tmL, 0, sizeof(tmL));
                    578:        memset(&tmH, 0, sizeof(tmH));
                    579:        tmL.tm_year=-1900;
                    580:        tmL.tm_mon=-1;
                    581:        tmH.tm_year=9999-1900;
                    582:        tmH.tm_mon=12-1;
                    583:        tmH.tm_mday=31;
                    584:        return mktime(&tmL)==-1 || mktime(&tmH)==-1;
                    585: }
1.68      moko      586: ])], AC_DEFINE(PA_DATE64) AC_MSG_RESULT(yes), AC_MSG_RESULT(no), AC_MSG_RESULT(no))
1.1       moko      587: 
                    588: dnl Output header and makefiles
                    589: AH_TEMPLATE([HAVE_TIMEZONE],[Define if you have timezone external variable in <time.h>])
                    590: AH_TEMPLATE([HAVE_TM_GMTOFF],[Define if you have tm_gmtoff member of tm structure in <time.h>])
                    591: AH_TEMPLATE([HAVE_TM_TZADJ],[Define if you have tm_tzadj member of tm structure in <time.h>])
1.41      moko      592: AH_TEMPLATE([HAVE_GETTID],[Define if you have gettid()])
1.45      moko      593: AH_TEMPLATE([HAVE_TLS],[Define if you have Thread-Local Storage])
1.1       moko      594: AH_TEMPLATE([PA_DATE64],[Define if you have 0..9999 year date range support])
                    595: 
1.68      moko      596: AC_CONFIG_HEADERS(src/include/pa_config_auto.h)
1.1       moko      597: 
1.68      moko      598: AC_CONFIG_FILES([
                    599:        Makefile
                    600:        src/Makefile
                    601:        src/types/Makefile
                    602:        src/classes/Makefile
                    603:        src/include/Makefile
                    604:        src/main/Makefile
                    605:        src/sql/Makefile
                    606:        src/lib/Makefile
                    607:        src/lib/gd/Makefile
                    608:        src/lib/smtp/Makefile
                    609:        src/lib/gc/Makefile
1.1       moko      610:        src/lib/gc/include/Makefile
1.68      moko      611:        src/lib/pcre/Makefile
1.1       moko      612:        src/lib/cord/Makefile
                    613:        src/lib/cord/include/Makefile
                    614:        src/lib/cord/include/private/Makefile
                    615:        src/lib/md5/Makefile
                    616:        src/lib/sdbm/Makefile
                    617:        src/lib/sdbm/pa-include/Makefile
                    618:        src/lib/json/Makefile
                    619:        src/lib/curl/Makefile
                    620:        src/lib/punycode/Makefile
                    621:        src/lib/memcached/Makefile
                    622:        src/targets/Makefile
                    623:        src/targets/cgi/Makefile
                    624:        src/targets/apache/Makefile
                    625:        src/targets/isapi/Makefile
                    626:        etc/Makefile
                    627:        etc/parser3.charsets/Makefile
1.68      moko      628:        etc/auto.p])
                    629: AC_OUTPUT

E-mail: