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