Annotation of parser3/configure.ac, revision 1.85
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:
1.83 moko 62: dnl Checks for libraries
63: case "$host" in
64: *-freebsd4*)
65: AC_DEFINE(FREEBSD4,,FreeBSD4.X target platform)
66: ;;
67: *-freebsd1*)
68: AC_DEFINE(FREEBSD1X,,FreeBSD1X.X target platform)
69: ;;
70: *-sunos5.6* | *-solaris2.6*)
71: AC_CHECK_LIB(xnet, main)
72: ;;
73: *-sunos5* | *-solaris2*)
74: AC_CHECK_LIB(socket, main)
75: AC_CHECK_LIB(nsl, main)
76: ;;
77: *-nec-sysv4*)
78: AC_CHECK_LIB(nsl, gethostbyname)
79: AC_CHECK_LIB(socket, socket)
80: ;;
81: *-cygwin*)
82: AC_DEFINE(WIN32,,Windows32 target platform)
83: ;;
84: esac
85:
86: AC_CHECK_LIB(m, sin)
87: AC_CHECK_LIB(crypt, crypt)
88:
89:
1.1 moko 90: dnl Misc arguments
91: AC_ARG_WITH(build-warnings, [ --with-build-warnings to enable build-time compiler warnings if gcc is used],
92: AC_MSG_WARN(enabling compiler warnings)
1.64 moko 93: CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2 -Wextra -Wall -Wno-parentheses"
1.1 moko 94: )
95:
1.15 moko 96: AC_ARG_WITH(coverage, [ --with-coverage to enable gcov code coverage support],
1.9 moko 97: AC_MSG_WARN(enabling gcov support)
98: CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
99: CXXFLAGS=`echo "$XXCFLAGS" | $SED -e 's/-O[0-9]*//g'`
100: CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
101: CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
102: LDFLAGS="$LDFLAGS -lgcov"
103: )
104:
1.15 moko 105: AC_ARG_WITH(profiler, [ --with-profiler to enable gprof code profiler support],
1.9 moko 106: AC_MSG_WARN(enabling gprof support)
1.24 moko 107: CFLAGS="$CFLAGS -O0 -pg -g"
108: CXXFLAGS="$CXXFLAGS -O0 -pg -g"
1.9 moko 109: )
110:
1.1 moko 111: AC_ARG_WITH(assertions, [ --with-assertions to enable assertions],
112: AC_MSG_WARN(enabling assertions)
113: ,
114: AC_DEFINE(NDEBUG,,assertions disabled)
115: )
116:
1.37 moko 117: AC_ARG_WITH(sjlj-exceptions, [ --with-sjlj-exceptions to enable simple 'throw' from dynamic library],
1.1 moko 118: AC_DEFINE(PA_WITH_SJLJ_EXCEPTIONS,,one can throw from dynamic library)
119: )
120:
121:
1.37 moko 122: AC_ARG_WITH(system-cfg, [ --with-system-cfg=FILE to specify system-wide auto.p],
123: AC_DEFINE_UNQUOTED(SYSTEM_CONFIG_FILE,"$withval",system-wide auto.p)
1.35 moko 124: )
125:
126:
1.1 moko 127: dnl Safe mode argument
128: AC_ARG_ENABLE(safe-mode, [ --disable-safe-mode to enable reading and executing
129: files belonging to group+user other then effective],
130: [
131: SAFE_MODE=$enableval
132: ]
133: )
134:
135: if test "$SAFE_MODE" = "no"; then
136: AC_MSG_WARN(enabling reading of files belonging to group+user other then effective)
137: else
138: AC_DEFINE(PA_SAFE_MODE,,disabled reading of files belonging to group+user other then effective)
139: fi
140:
141:
142: dnl Disable execs argument
143: AC_ARG_ENABLE(execs, [ --disable-execs to disable any execs
144: (file::exec, file::cgi, unix mail:send)],
145: [
146: if test "$enableval" = "no"; then
147: AC_MSG_WARN(disabling file execs)
148: AC_DEFINE(NO_PA_EXECS,,pa_exec disabled)
149: fi
150: ]
151: )
152:
153:
154: dnl String stream argument
1.28 moko 155: AC_ARG_ENABLE(stringstream, [ --disable-stringstream to disable stringstream usage.
156: when disabled table.save uses more memory, but more compilers are supported],
1.1 moko 157: [
158: if test "$enableval" = "no"; then
159: AC_MSG_WARN(disabling stringstream usage)
160: AC_DEFINE(NO_STRINGSTREAM,,stringstream disabled)
161: fi
162: ]
163: )
164:
165:
166: dnl GC argument
1.35 moko 167: AC_ARG_WITH(gc,[ --with-gc[=DIR] DIR is the directory where
1.1 moko 168: Boehm garbage collecting library is installed],[
169:
170: GC=$withval
171: GC_LIBS="$GC/libgc.la"
172:
173: if test -f $GC_LIBS; then
174: GC_OK="yes"
175: else
176: GC_LIBS="-L$GC -lgc"
177: fi
178:
179: if test "$GC" = "yes"; then
180: GC=""
181: GC_LIBS="-lgc"
182: AC_MSG_WARN([--with-gc value was not specified, hoping linker would find it])
183: fi
184: ],[
185: GC_LIBS="-lgc"
186: AC_MSG_WARN([--with-gc was not specified, hoping linker would find it])
187: ])
188:
189: if test -z "$GC_OK"; then
190: AC_MSG_CHECKING(for libgc)
191: SAVE_LIBS=$LIBS
192: LIBS="$LIBS $GC_LIBS"
1.68 moko 193: PA_TRY_LINK([ extern int GC_dont_gc; ],[ GC_dont_gc=0; ],
1.1 moko 194: AC_MSG_RESULT(yes)
195: ,
196: AC_MSG_RESULT(no)
197: if test -z "$GC"; then
1.35 moko 198: AC_MSG_ERROR(please specify path to libgc: --with-gc=DIR)
1.1 moko 199: else
200: AC_MSG_ERROR($GC does not seem to be valid libgc installation directory)
201: fi
202: )
203: LIBS=$SAVE_LIBS
204: fi
205:
206: AC_SUBST(GC_LIBS)
207:
208:
209: dnl PCRE argument
1.35 moko 210: AC_ARG_WITH(pcre,[ --with-pcre=DIR DIR is the directory where
1.1 moko 211: PCRE library is installed],[
212: PCRE=$withval
213:
214: if test "$PCRE" = "yes"; then
215: PCRE=""
216: AC_MSG_WARN([--with-pcre value was not specified, hoping linker would find it])
1.55 moko 217: else
218: PCRE_INCLUDES="-I$PCRE/include"
219:
220: if test -f $PCRE/include/pcre.h -a -f $PCRE/lib/libpcre.la; then
221: PCRE_OK="yes"
222: PCRE_LIBS="$PCRE/lib/libpcre.la"
223: else
224: if test -f $PCRE/include/pcre2.h -a -f $PCRE/lib/libpcre2-8.la; then
225: PCRE_OK="yes"
226: PCRE_LIBS="$PCRE/lib/libpcre2-8.la"
227: AC_DEFINE(HAVE_PCRE2,,PCRE2 is available)
228: else
229: PCRE_LIBS="-L$PCRE/lib"
230: fi
231: fi
1.1 moko 232: fi
233: ],[
234: AC_MSG_WARN([--with-pcre was not specified, hoping linker would find it])
235: ])
236:
237: if test -z "$PCRE_OK"; then
1.55 moko 238: AC_MSG_CHECKING(for pcre2)
239: SAVE_LIBS=$LIBS
240: LIBS="$LIBS $PCRE_LIBS $PCRE_INCLUDES -lpcre2-8"
1.68 moko 241: PA_TRY_LINK([ #define PCRE2_CODE_UNIT_WIDTH 8
1.55 moko 242: #include <pcre2.h> ],[ void *v=pcre2_general_context_create(0,0,0); ],
243: AC_MSG_RESULT(yes)
244: PCRE_LIBS="$PCRE_LIBS -lpcre2-8"
245: AC_DEFINE(HAVE_PCRE2,,PCRE2 is available)
246: PCRE_OK="yes"
247: ,
248: AC_MSG_RESULT(no)
249: )
250: LIBS=$SAVE_LIBS
251: fi
252:
253: if test -z "$PCRE_OK"; then
254: AC_MSG_CHECKING(for pcre)
255: PCRE_LIBS="$PCRE_LIBS -lpcre"
1.1 moko 256: SAVE_LIBS=$LIBS
257: LIBS="$LIBS $PCRE_LIBS $PCRE_INCLUDES"
1.68 moko 258: PA_TRY_LINK([ #include <pcre.h> ],[ const char *v=pcre_version(); ],
1.1 moko 259: AC_MSG_RESULT(yes)
260: ,
261: AC_MSG_RESULT(no)
262: if test -z "$PCRE"; then
1.35 moko 263: AC_MSG_ERROR(please specify path to PCRE: --with-pcre=DIR)
1.1 moko 264: else
265: AC_MSG_ERROR($PCRE does not seem to be valid PCRE installation directory)
266: fi
267: )
268: LIBS=$SAVE_LIBS
269: fi
270:
271: AC_SUBST(PCRE_INCLUDES)
272: AC_SUBST(PCRE_LIBS)
273:
274:
275: dnl XML/XSLT argument
1.35 moko 276: AC_ARG_WITH(xml,[ --with-xml=DIR DIR is the directory where
1.1 moko 277: Gnome XML libraries are installed],[
278:
279: XML=$withval
280: XML_LIBS="-lxml2 -lxslt -lexslt"
281:
282: if test -z "$XML" -o "$XML" = "yes"; then
283: XML=""
284: XML_INCLUDES="-I/usr/include/libxml2"
285: AC_MSG_WARN([--with-xml value was not specified, hoping linker would find it])
286: else
287: XML_INCLUDES="-I$XML/include -I$XML/include/libxml2"
1.24 moko 288: XML_LIBS="-L$XML/lib $XML_LIBS"
1.1 moko 289:
290: if test -f $XML/include/libxslt/xslt.h -a -f $XML/lib/libxml2.la \
291: -a -f $XML/lib/libxslt.la -a -f $XML/lib/libexslt.la; then
292: XML_LIBS="$XML/lib/libxml2.la $XML/lib/libxslt.la $XML/lib/libexslt.la"
293: XML_OK="yes"
294: fi
295: fi
296:
297: if test -z "$XML_OK"; then
298: AC_MSG_CHECKING(for xml)
299: SAVE_LIBS=$LIBS
300: LIBS="$LIBS $XML_LIBS $XML_INCLUDES"
1.68 moko 301: PA_TRY_LINK([ #include <libxslt/xslt.h> ],[ const char *v=xsltEngineVersion; ],
1.1 moko 302: AC_MSG_RESULT(yes)
303: ,
304: AC_MSG_RESULT(no)
305: if test -z "$XML"; then
1.35 moko 306: AC_MSG_ERROR(please specify path to Gnome XML libraries: --with-xml=DIR)
1.1 moko 307: else
308: AC_MSG_ERROR($XML does not seem to be valid Gnome XML installation directory)
309: fi
310: )
311: LIBS=$SAVE_LIBS
312: fi
313: AC_DEFINE(XML,,xml-abled parser)
314: ])
315:
316: AC_SUBST(XML_INCLUDES)
317: AC_SUBST(XML_LIBS)
318:
319:
320: dnl Mail receive argument
1.35 moko 321: AC_ARG_WITH(mailreceive,[ --with-mailreceive=DIR is the directory where
1.1 moko 322: Gnome MIME library is installed],[
323: MIME=$withval
324: GLIB="glib-2.0"
325: GMIME="gmime-2.4"
326:
327: if test -z "$MIME" -o "$MIME" = "yes"; then
328: MIME=""
329: MIME_INCLUDES=`pkg-config --cflags $GMIME 2>/dev/null`
330: MIME_LIBS=`pkg-config --libs $GMIME 2>/dev/null`
1.26 moko 331: if test -z "$MIME_LIBS"; then
332: GMIME="gmime-3.0"
333: MIME_INCLUDES=`pkg-config --cflags $GMIME 2>/dev/null`
334: MIME_LIBS=`pkg-config --libs $GMIME 2>/dev/null`
335: fi
1.1 moko 336: AC_MSG_WARN([--with-mailreceive value was not specified, hoping linker would find Gnome MIME library])
337: else
338: MIME_INCLUDES="-I$MIME/include/$GMIME"
339: MIME_LIBS="-l$GMIME"
340: if test -f $MIME/include/$GMIME/gmime/gmime.h -a -f $MIME/lib/lib$GMIME.la; then
341: MIME_LIBS="$MIME/lib/lib$GMIME.la"
342: if test -f $MIME/lib/lib$GLIB.la; then
343: MIME_INCLUDES="$MIME_INCLUDES -I$MIME/include/$GLIB -I$MIME/lib/$GLIB/include"
344: else
345: GLIB_INCLUDES=`pkg-config --cflags $GLIB 2>/dev/null`
346: MIME_INCLUDES="$MIME_INCLUDES $GLIB_INCLUDES"
347: fi
348: MIME_OK="yes"
349: fi
350: fi
351:
352: if test -z "$MIME_OK"; then
353: AC_MSG_CHECKING(for mime)
354: SAVE_LIBS=$LIBS
355: LIBS="$LIBS $MIME_LIBS $MIME_INCLUDES"
1.68 moko 356: PA_TRY_LINK([ #include <gmime/gmime.h> ],[ guint v=gmime_major_version; ],
1.1 moko 357: AC_MSG_RESULT(yes)
358: ,
359: AC_MSG_RESULT(no)
360: if test -z "$MIME"; then
1.35 moko 361: AC_MSG_ERROR(please specify path to Gnome MIME library: --with-mailreceive=DIR)
1.1 moko 362: else
363: AC_MSG_ERROR($MIME does not seem to be valid Gnome MIME installation directory)
364: fi
365: )
366: LIBS=$SAVE_LIBS
367: fi
368: AC_DEFINE(WITH_MAILRECEIVE,,has \$mail:received)
369: ])
370:
371: AC_SUBST(MIME_INCLUDES)
372: AC_SUBST(MIME_LIBS)
373:
374:
1.71 moko 375: dnl RabbitMQ library argument
376: AC_ARG_WITH(amqp,[ --with-amqp=DIR DIR is the directory where
377: RabbitMQ C library (librabbitmq) is installed],[
378: AMQP=$withval
379:
380: if test -z "$AMQP" -o "$AMQP" = "yes"; then
381: AMQP_INCLUDES=""
382: AMQP_LIBS="-lrabbitmq"
383: AC_MSG_WARN([--with-amqp value was not specified, hoping linker would find it])
384: else
385: AMQP_INCLUDES="-I$AMQP/include"
386: if test -f $AMQP/lib/librabbitmq.la; then
387: AMQP_LIBS="$AMQP/lib/librabbitmq.la"
388: else
389: AMQP_LIBS="-L$AMQP/lib -lrabbitmq"
390: fi
391: fi
392:
393: AC_MSG_CHECKING(for librabbitmq)
394: SAVE_LIBS=$LIBS
1.83 moko 395: LIBS="$AMQP_LIBS $AMQP_INCLUDES $LIBS"
1.71 moko 396: PA_TRY_LINK([ #include <amqp.h> ],[ amqp_connection_state_t c = 0; ],
397: AC_MSG_RESULT(yes)
398: ,
399: AC_MSG_RESULT(no)
400: if test -z "$AMQP"; then
401: AC_MSG_ERROR(please specify path to librabbitmq: --with-amqp=DIR)
402: else
403: AC_MSG_ERROR($AMQP does not seem to be valid librabbitmq installation directory)
404: fi
405: )
406: LIBS=$SAVE_LIBS
1.79 moko 407:
408: SAVE_CPPFLAGS=$CPPFLAGS
409: CPPFLAGS="$CPPFLAGS $AMQP_INCLUDES"
1.85 ! moko 410: AC_CHECK_HEADER([amqp_ssl_socket.h],[AC_DEFINE([WITH_AMQP_SSL],,[librabbitmq with SSL support])])
1.79 moko 411: CPPFLAGS=$SAVE_CPPFLAGS
412:
1.71 moko 413: AC_DEFINE(WITH_AMQP,,has amqp)
414: ])
415:
416: AC_SUBST(AMQP_INCLUDES)
417: AC_SUBST(AMQP_LIBS)
418:
1.77 moko 419:
420: dnl Redis library argument
421: AC_ARG_WITH(redis,[ --with-redis=DIR DIR is the directory where
422: Redis C library (hiredis) is installed],[
423: REDIS=$withval
424:
425: if test -z "$REDIS" -o "$REDIS" = "yes"; then
426: REDIS_INCLUDES=""
427: REDIS_LIBS="-lhiredis"
428: AC_MSG_WARN([--with-redis value was not specified, hoping linker would find it])
1.85 ! moko 429:
! 430: dnl SSL is the separate hiredis_ssl library, the system one only: it brings OpenSSL as its dependency
! 431: AC_CHECK_HEADER([hiredis/hiredis_ssl.h],[
! 432: AC_DEFINE(WITH_REDIS_SSL,,hiredis with SSL support)
! 433: REDIS_LIBS="-lhiredis_ssl $REDIS_LIBS"
! 434: ],,[#include <hiredis/hiredis.h>])
1.77 moko 435: else
436: REDIS_INCLUDES="-I$REDIS/include"
1.81 moko 437: if test -f $REDIS/lib/libhiredis.a; then
438: REDIS_LIBS="$REDIS/lib/libhiredis.a"
1.77 moko 439: else
440: REDIS_LIBS="-L$REDIS/lib -lhiredis"
441: fi
442: fi
443:
444: AC_MSG_CHECKING(for hiredis)
445: SAVE_LIBS=$LIBS
1.83 moko 446: LIBS="$REDIS_LIBS $REDIS_INCLUDES $LIBS"
1.77 moko 447: PA_TRY_LINK([ #include <hiredis/hiredis.h> ],[ redisContext *c = redisConnect("", 0); ],
448: AC_MSG_RESULT(yes)
449: ,
450: AC_MSG_RESULT(no)
451: if test -z "$REDIS"; then
452: AC_MSG_ERROR(please specify path to hiredis: --with-redis=DIR)
453: else
454: AC_MSG_ERROR($REDIS does not seem to be valid hiredis installation directory)
455: fi
456: )
457: LIBS=$SAVE_LIBS
458: AC_DEFINE(WITH_REDIS,,has redis)
459: ])
460:
461: AC_SUBST(REDIS_INCLUDES)
462: AC_SUBST(REDIS_LIBS)
463:
1.1 moko 464: dnl Sendmail argument
465: AC_ARG_WITH(sendmail,[ \"--with-sendmail=COMMAND\" forces this command to send mail.
466: example: \"--with-sendmail=/usr/sbin/sendmail -t\"
467: (makes parser ignore user-defined sendmail commands)],
468: AC_DEFINE_UNQUOTED(PA_FORCED_SENDMAIL,"$withval",parser uses this command instead of user-defined sendmail commands)
469: )
470:
471:
472: dnl Apache module argument
473: AC_ARG_WITH(apache,[ --with-apache=FILE FILE is the full path for APXS
474: builds apache DSO module using apxs],[
475: APXS=$withval
476:
477: if test -z "$APXS" -o "$APXS" = "yes"; then
478: APXS=`which apxs 2>/dev/null`
479: if test -z "$APXS"; then
480: APXS=`which apxs2 2>/dev/null`
481: fi
482: fi
483:
484: APACHE=`$APXS -q TARGET 2>/dev/null`
485:
486: if test -z "$APACHE"; then
487: AC_MSG_ERROR($APXS does not seem to be valid apache apxs utility path)
488: fi
489:
490: APACHE_MAIN_INC=`$APXS -q INCLUDEDIR`
491: APACHE_EXTRA_INC=`$APXS -q EXTRA_INCLUDES 2>/dev/null`
492: APACHE_INC="-I$APACHE_MAIN_INC $APACHE_EXTRA_INC"
493: APACHE_CFLAGS=`$APXS -q CFLAGS`
494: ])
495: AC_SUBST(APACHE)
496: AC_SUBST(APACHE_INC)
497: AC_SUBST(APACHE_CFLAGS)
498: AM_CONDITIONAL(COMPILE_APACHE_MODULE, test -n "$APACHE")
499:
500:
501: dnl Enable building of the convenience library
502: LT_CONFIG_LTDL_DIR(src/lib/ltdl)
503: LT_INIT(dlopen win32-dll no-pic)
504: LTDL_INIT
505:
506:
507: dnl Checks for typedefs, structures, and compiler characteristics
508: AC_C_BIGENDIAN(
509: AC_DEFINE(PA_BIG_ENDIAN,,compile for sparc processor)
510: ,
511: AC_DEFINE(PA_LITTLE_ENDIAN,,compile for intel processor or compatible)
512: ,
513: AC_MSG_ERROR(word endianness not determined for some obscure reason)
514: )
515:
516: AC_TYPE_SIZE_T
517: AC_TYPE_SSIZE_T
518: AC_TYPE_UINT8_T
519: AC_TYPE_UINT16_T
520: AC_TYPE_UINT32_T
521: AC_TYPE_UINT64_T
1.73 moko 522: AC_TYPE_INT64_T
1.1 moko 523:
524: AC_STRUCT_DIRENT_D_TYPE
525:
526: AC_SYS_LARGEFILE
527:
528: dnl Checks for C header files
529: 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 530: 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 531: 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)
532: AC_CHECK_HEADERS(sys/socket.h netinet/in.h arpa/inet.h netdb.h)
533:
534:
535: dnl Checks for functions
1.59 moko 536: AC_CHECK_FUNCS(flock fcntl lockf ftruncate fchmod)
1.66 moko 537: AC_CHECK_FUNCS(getrusage gettimeofday crypt sigsetjmp siglongjmp unsetenv syslog)
1.1 moko 538:
539:
540: dnl on some linux[seen on 2.4] it's a macro
541: PA_CHECK_SIGSETJMP
542:
543:
544: dnl see comment above
545: AC_LANG_PUSH(C++)
1.19 moko 546: PA_CHECK_MATH_FUNCS_ONE_ARG(trunc round sign isfinite)
1.1 moko 547: AC_LANG_POP
548:
549:
550: dnl We require qsort(3)
551: AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.]))
552:
553:
554: dnl For build-in date implementation we need to know local offset from GMT
555:
556: AC_LANG_PUSH(C++)
557: AC_MSG_CHECKING(for timezone variable)
1.68 moko 558: PA_TRY_COMPILE([#include <time.h>], [int test=timezone;], AC_DEFINE(HAVE_TIMEZONE) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
1.1 moko 559: AC_LANG_POP
560:
561: AC_MSG_CHECKING(for tm_gmtoff in struct tm)
1.68 moko 562: 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 563:
564: AC_MSG_CHECKING(for tm_tzadj in struct tm)
1.68 moko 565: 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 566:
1.41 moko 567: AC_MSG_CHECKING(for gettid)
1.68 moko 568: PA_TRY_COMPILE([
1.41 moko 569: #include <sys/types.h>
570: #include <sys/syscall.h>
571: ], [uint tid=syscall(__NR_gettid);], AC_DEFINE(HAVE_GETTID) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
572:
1.45 moko 573: AC_MSG_CHECKING(for TLS)
1.68 moko 574: PA_TRY_COMPILE([__thread int i=0;], [], AC_DEFINE(HAVE_TLS) AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
1.45 moko 575:
1.1 moko 576: AC_MSG_CHECKING(for 0..9999 year date range support)
1.68 moko 577: AC_RUN_IFELSE([AC_LANG_SOURCE([
1.1 moko 578: #include <string.h>
579: #include <time.h>
580:
581: int main() {
582: struct tm tmL,tmH;
583: memset(&tmL, 0, sizeof(tmL));
584: memset(&tmH, 0, sizeof(tmH));
585: tmL.tm_year=-1900;
586: tmL.tm_mon=-1;
587: tmH.tm_year=9999-1900;
588: tmH.tm_mon=12-1;
589: tmH.tm_mday=31;
590: return mktime(&tmL)==-1 || mktime(&tmH)==-1;
591: }
1.68 moko 592: ])], AC_DEFINE(PA_DATE64) AC_MSG_RESULT(yes), AC_MSG_RESULT(no), AC_MSG_RESULT(no))
1.1 moko 593:
594: dnl Output header and makefiles
595: AH_TEMPLATE([HAVE_TIMEZONE],[Define if you have timezone external variable in <time.h>])
596: AH_TEMPLATE([HAVE_TM_GMTOFF],[Define if you have tm_gmtoff member of tm structure in <time.h>])
597: AH_TEMPLATE([HAVE_TM_TZADJ],[Define if you have tm_tzadj member of tm structure in <time.h>])
1.41 moko 598: AH_TEMPLATE([HAVE_GETTID],[Define if you have gettid()])
1.45 moko 599: AH_TEMPLATE([HAVE_TLS],[Define if you have Thread-Local Storage])
1.1 moko 600: AH_TEMPLATE([PA_DATE64],[Define if you have 0..9999 year date range support])
601:
1.68 moko 602: AC_CONFIG_HEADERS(src/include/pa_config_auto.h)
1.1 moko 603:
1.68 moko 604: AC_CONFIG_FILES([
605: Makefile
606: src/Makefile
607: src/types/Makefile
608: src/classes/Makefile
609: src/include/Makefile
610: src/main/Makefile
611: src/sql/Makefile
612: src/lib/Makefile
613: src/lib/gd/Makefile
614: src/lib/smtp/Makefile
615: src/lib/gc/Makefile
1.1 moko 616: src/lib/gc/include/Makefile
1.68 moko 617: src/lib/pcre/Makefile
1.1 moko 618: src/lib/cord/Makefile
619: src/lib/cord/include/Makefile
620: src/lib/cord/include/private/Makefile
621: src/lib/md5/Makefile
622: src/lib/sdbm/Makefile
623: src/lib/sdbm/pa-include/Makefile
624: src/lib/json/Makefile
625: src/lib/curl/Makefile
626: src/lib/punycode/Makefile
627: src/lib/memcached/Makefile
628: src/targets/Makefile
629: src/targets/cgi/Makefile
630: src/targets/apache/Makefile
631: src/targets/isapi/Makefile
632: etc/Makefile
633: etc/parser3.charsets/Makefile
1.68 moko 634: etc/auto.p])
635: AC_OUTPUT
E-mail: