Annotation of parser3/configure.in, revision 1.177
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
257: GMIME="gmime-2.4"
258:
259: if test -z "$MIME" -o "$MIME" = "yes"; then
260: MIME=""
261: MIME_INCLUDES=`pkg-config --cflags $GMIME 2>/dev/null`
262: MIME_LIBS=`pkg-config --libs $GMIME 2>/dev/null`
263: AC_MSG_WARN([--with-mailreceive value was not specified, hoping linker would find Gnome MIME library])
264: else
265: MIME_INCLUDES="-I$MIME/include/$GMIME -I$MIME/include/glib-2.0"
266: MIME_LIBS="-l$GMIME"
267: if test -f $MIME/include/$GMIME/gmime/gmime.h -a -f $MIME/lib/lib$GMIME.la; then
268: MIME_LIBS="$MIME/lib/lib$GMIME.la"
269: MIME_OK="yes"
270: fi
1.63 paf 271: fi
272:
1.176 moko 273: if test -z "$MIME_OK"; then
274: AC_MSG_CHECKING(for mime)
275: SAVE_LIBS=$LIBS
276: LIBS="$LIBS $MIME_LIBS $MIME_INCLUDES"
277: AC_TRY_LINK([ #include <gmime/gmime.h> ],[ guint v=gmime_major_version; ],
278: AC_MSG_RESULT(yes)
279: ,
280: AC_MSG_RESULT(no)
281: if test -z "$MIME"; then
282: AC_MSG_ERROR(please specify path to Gnome MIME library: --with-mailreceive=D)
283: else
284: AC_MSG_ERROR($MIME does not seem to be valid Gnome MIME installation directory)
1.91 paf 285: fi
1.176 moko 286: )
287: LIBS=$SAVE_LIBS
1.63 paf 288: fi
1.176 moko 289: AC_DEFINE(WITH_MAILRECEIVE,,has \$mail:received)
1.33 paf 290: ])
1.63 paf 291:
1.33 paf 292: AC_SUBST(MIME_INCLUDES)
293: AC_SUBST(MIME_LIBS)
1.18 paf 294:
295:
1.141 moko 296: dnl Sendmail argument
1.18 paf 297: AC_ARG_WITH(sendmail,[ \"--with-sendmail=COMMAND\" forces this command to send mail.
298: example: \"--with-sendmail=/usr/sbin/sendmail -t\"
299: (makes parser ignore user-defined sendmail commands)],
300: AC_DEFINE_UNQUOTED(PA_FORCED_SENDMAIL,"$withval",parser uses this command instead of user-defined sendmail commands)
301: )
302:
1.14 paf 303:
1.141 moko 304: dnl Apache module argument
1.164 moko 305: AC_ARG_WITH(apache,[ --with-apache=FILE FILE is the full path for APXS
1.131 moko 306: builds apache DSO module using apxs],[
307: APXS=$withval
308:
309: if test -z "$APXS" -o "$APXS" = "yes"; then
310: APXS=`which apxs 2>/dev/null`
1.157 moko 311: if test -z "$APXS"; then
312: APXS=`which apxs2 2>/dev/null`
313: fi
314: fi
1.131 moko 315:
316: APACHE=`$APXS -q TARGET 2>/dev/null`
317:
318: if test -z "$APACHE"; then
1.157 moko 319: AC_MSG_ERROR($APXS does not seem to be valid apache apxs utility path)
1.63 paf 320: fi
1.131 moko 321:
322: APACHE_MAIN_INC=`$APXS -q INCLUDEDIR`
323: APACHE_EXTRA_INC=`$APXS -q EXTRA_INCLUDES 2>/dev/null`
324: APACHE_INC="-I$APACHE_MAIN_INC $APACHE_EXTRA_INC"
325: APACHE_CFLAGS=`$APXS -q CFLAGS`
326: ])
327: AC_SUBST(APACHE)
328: AC_SUBST(APACHE_INC)
329: AC_SUBST(APACHE_CFLAGS)
330: AM_CONDITIONAL(COMPILE_APACHE_MODULE, test -n "$APACHE")
1.14 paf 331:
1.1 paf 332:
333: dnl Enable building of the convenience library
1.142 moko 334: LT_CONFIG_LTDL_DIR(src/lib/ltdl)
1.162 moko 335: LT_INIT(dlopen win32-dll no-pic)
1.142 moko 336: LTDL_INIT
1.1 paf 337:
1.60 paf 338:
1.1 paf 339: dnl Checks for typedefs, structures, and compiler characteristics.
1.79 paf 340: AC_C_BIGENDIAN(
341: AC_DEFINE(PA_BIG_ENDIAN,,compile for sparc processor)
342: ,
343: AC_DEFINE(PA_LITTLE_ENDIAN,,compile for intel processor or compatible)
344: ,
345: AC_MSG_ERROR(word endianness not determined for some obscure reason)
346: )
347:
1.1 paf 348: AC_TYPE_SIZE_T
1.141 moko 349:
1.142 moko 350:
1.62 paf 351: dnl Checks for C header files.
1.10 paf 352: AC_HEADER_TIME
353:
1.1 paf 354: AC_CHECK_HEADERS(
1.63 paf 355: assert.h \
1.48 paf 356: signal.h \
1.1 paf 357: unistd.h \
358: process.h \
359: stddef.h \
360: stdarg.h \
361: fcntl.h \
362: sys/stat.h \
363: io.h \
364: stdio.h \
365: errno.h \
366: ctype.h \
367: math.h \
1.35 paf 368: crypt.h \
1.3 paf 369: time.h sys/time.h \
1.1 paf 370: string.h \
371: direct.h \
372: setjmp.h \
373: memory.h \
1.140 moko 374: limits.h \
1.1 paf 375: sys/file.h \
376: sys/locking.h \
1.3 paf 377: sys/types.h \
1.5 paf 378: sys/select.h \
1.39 paf 379: sys/resource.h \
1.49 paf 380: winsock.h \
381: sys/socket.h \
382: netinet/in.h \
383: arpa/inet.h \
384: netdb.h
1.1 paf 385: )
386:
1.142 moko 387:
388: dnl Checks for libraries
389:
1.1 paf 390:
391: dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
392: case "$host" in
1.114 misha 393: *-freebsd4*)
394: AC_DEFINE(FREEBSD4,,FreeBSD4X target platform)
395: ;;
1.1 paf 396: *-sunos5.6* | *-solaris2.6*)
1.63 paf 397: AC_CHECK_LIB(xnet, main)
1.1 paf 398: ;;
399: *-sunos5* | *-solaris2*)
1.63 paf 400: AC_CHECK_LIB(socket, main)
401: AC_CHECK_LIB(nsl, main)
1.1 paf 402: ;;
403: *-nec-sysv4*)
1.63 paf 404: AC_CHECK_LIB(nsl, gethostbyname)
405: AC_CHECK_LIB(socket, socket)
1.1 paf 406: ;;
407: *-cygwin*)
1.63 paf 408: AC_DEFINE(WIN32,,Windows32 target platform)
409: AC_CHECK_LIB(wsock32, socket)
1.1 paf 410: ;;
411: esac
412:
413: AC_CHECK_LIB(m, sin)
1.35 paf 414: AC_CHECK_LIB(crypt, crypt)
415:
1.1 paf 416: dnl Checks for functions.
417:
418: AC_CHECK_FUNCS(
419: flock \
420: _locking \
1.7 paf 421: fcntl \
1.4 paf 422: lockf \
1.53 paf 423: ftruncate \
1.119 misha 424: fchmod \
1.35 paf 425: getrusage \
1.47 paf 426: gettimeofday \
1.49 paf 427: crypt \
1.80 paf 428: sigsetjmp \
1.94 misha 429: siglongjmp \
430: unsetenv
1.63 paf 431: )
432:
1.142 moko 433: dnl on some linux[seen on 2.4] it's a macro
1.63 paf 434: PA_CHECK_SIGSETJMP
435:
436: dnl see comment above
437: AC_LANG_PUSH(C++)
438: PA_CHECK_MATH_FUNCS_ONE_ARG(
439: trunc \
440: round \
441: sign
1.1 paf 442: )
1.63 paf 443: AC_LANG_POP
1.3 paf 444:
1.75 paf 445: dnl We require qsort(3)
1.3 paf 446:
447: AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.]))
1.1 paf 448:
1.46 paf 449: dnl For correct mail receiving we need to know local offset from GMT
450: dnl it be timezone+(daylight?60*60*sign(timezone):0)
1.176 moko 451: dnl or it can be tm.tm_gmtoff or it can be tm.tm_tzadj
1.46 paf 452:
453: AC_MSG_CHECKING(for timezone variable)
1.141 moko 454: AC_TRY_COMPILE([#include <time.h>],
1.46 paf 455: [
456: time_t test=timezone;
1.141 moko 457: ],
458: AC_DEFINE(HAVE_TIMEZONE)
459: AC_MSG_RESULT(yes),
460: AC_MSG_RESULT(no))
1.46 paf 461:
462: AC_MSG_CHECKING(for daylight variable)
1.141 moko 463: AC_TRY_COMPILE([#include <time.h>],
1.46 paf 464: [
465: int test=daylight;
1.141 moko 466: ],
467: AC_DEFINE(HAVE_DAYLIGHT)
468: AC_MSG_RESULT(yes),
469: AC_MSG_RESULT(no))
1.46 paf 470:
471: AC_MSG_CHECKING(for tm_gmtoff in struct tm)
1.141 moko 472: AC_TRY_COMPILE([#include <time.h>],
473: [struct tm tm;
474: tm.tm_gmtoff=0;
475: ],
476: AC_DEFINE(HAVE_TM_GMTOFF)
477: AC_MSG_RESULT(yes),
478: AC_MSG_RESULT(no))
1.46 paf 479:
480: AC_MSG_CHECKING(for tm_tzadj in struct tm)
1.141 moko 481: AC_TRY_COMPILE([#include <time.h>],
482: [struct tm tm;
483: tm.tm_tzadj=0;
484: ],
485: AC_DEFINE(HAVE_TM_TZADJ)
486: AC_MSG_RESULT(yes),
487: AC_MSG_RESULT(no))
488:
1.17 paf 489:
1.58 paf 490: dnl Output header and makefiles
491: AH_TEMPLATE([HAVE_DLD],[Define if you have the GNU dld library])
492:
493: AH_TEMPLATE([HAVE_LIBDL],
494: [Define if you have the libdl library or equivalent.])
495:
496: AH_TEMPLATE([HAVE_SHL_LOAD],
497: [Define if you have the shl_load function. ])
498:
499:
500: AH_TEMPLATE([size_t],
501: [Define to `unsigned int' if <sys/types.h> does not define.])
502:
503: AH_TEMPLATE([ssize_t],
504: [Define to `int' if <sys/types.h> does not define.])
505:
506: AH_TEMPLATE([HAVE_DAYLIGHT],
507: [Define if you have daylight external variable in <time.h>])
508:
509: AH_TEMPLATE([HAVE_TIMEZONE],
510: [Define if you have timezone external variable in <time.h>])
511:
512: AH_TEMPLATE([HAVE_TM_GMTOFF],
513: [Define if you have tm_gmtoff member of tm structure in <time.h>])
514:
515: AH_TEMPLATE([HAVE_TM_TZADJ],
516: [Define if you have tm_tzadj member of tm structure in <time.h>])
517:
1.1 paf 518:
519: AM_CONFIG_HEADER(src/include/pa_config_auto.h)
1.141 moko 520:
1.66 paf 521: AC_OUTPUT(
522: Makefile
523: src/Makefile
524: src/types/Makefile
525: src/classes/Makefile
526: src/include/Makefile
527: src/main/Makefile
528: src/sql/Makefile
529: src/lib/Makefile
1.71 paf 530: src/lib/gd/Makefile
531: src/lib/smtp/Makefile
1.66 paf 532: src/lib/gc/Makefile
533: src/lib/gc/include/Makefile
1.108 misha 534: src/lib/pcre/Makefile
1.66 paf 535: src/lib/cord/Makefile
536: src/lib/cord/include/Makefile
537: src/lib/cord/include/private/Makefile
538: src/lib/md5/Makefile
539: src/lib/sdbm/Makefile
1.133 moko 540: src/lib/sdbm/pa-include/Makefile
1.128 misha 541: src/lib/json/Makefile
1.137 moko 542: src/lib/memcached/Makefile
1.138 moko 543: src/lib/curl/Makefile
1.66 paf 544: src/targets/Makefile
545: src/targets/cgi/Makefile
1.131 moko 546: src/targets/apache/Makefile
1.66 paf 547: src/targets/isapi/Makefile
548: etc/Makefile
549: etc/parser3.charsets/Makefile
1.67 paf 550: bin/Makefile
551: bin/auto.p.dist)
E-mail: