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