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