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