Annotation of parser3/configure.in, revision 1.19
1.1 paf 1: dnl Process this file with autoconf to produce a configure script.
2: AC_INIT(README)
3: AM_INIT_AUTOMAKE(parser, 3.0b, nodefine)
4:
1.8 paf 5: dnl expand srcdir
1.14 paf 6: P3S=`cd $srcdir/src ; pwd`
1.1 paf 7: AC_SUBST(P3S)
8:
9: PARSER_VERSION=$VERSION
1.8 paf 10: echo "/* automatically generated by configure */" > $srcdir/src/include/pa_version.h.new
11: echo "/* edit configure.in to change version number */" >> $srcdir/src/include/pa_version.h.new
12: echo "#define PARSER_VERSION \"$PARSER_VERSION\"" >> $srcdir/src/include/pa_version.h.new
13: cmp $srcdir/src/include/pa_version.h.new $srcdir/src/include/pa_version.h >/dev/null 2>&1
1.1 paf 14: if test $? -ne 0 ; then
1.8 paf 15: rm -f $srcdir/src/include/pa_version.h && mv $srcdir/src/include/pa_version.h.new $srcdir/src/include/pa_version.h && \
16: echo Updated $srcdir/src/include/pa_version.h
1.1 paf 17: else
1.8 paf 18: rm -f $srcdir/src/include/pa_version.h.new
1.1 paf 19: fi
20:
21: AC_PROG_INSTALL
22: AC_PROG_CC
23: AC_LANG_C AC_C_INLINE
24: AC_PROG_CXX
25: AC_LANG_CPLUSPLUS
26:
27:
28: dnl Arguments
29:
1.17 paf 30: AC_ARG_ENABLE(link-libstdcpp, [ --disable-link-libstdcpp to disable libstdc++ linkage,
31: if you belive you do not need one],
32: [
33: LINK_LIBSTDCPP_FLAG=$enableval
34: if test "$enableval" = "no"; then
35: AC_MSG_WARN(disabling libstdc++ linkage)
36: fi
37: ]
38: )
39: AM_CONDITIONAL(DO_NOT_LINK_LIBSTDCPP, test "$LINK_LIBSTDCPP_FLAG" = "no")
40:
1.1 paf 41: AC_ARG_ENABLE(string-origins, [ --disable-string-origins to switch off string origin tracking],
42: [
43: if test "$enableval" = "no"; then
1.16 paf 44: AC_MSG_WARN(disabling string origin tracking)
1.1 paf 45: AC_DEFINE(NO_STRING_ORIGIN,,no string origin tracking)
46: fi
47: ]
48: )
49:
1.15 paf 50: AC_ARG_ENABLE(execs, [ --disable-execs to disable any execs
51: (file::exec, file::cgi, unix mail:send)],
52: [
53: if test "$enableval" = "no"; then
1.16 paf 54: AC_MSG_WARN(disabling file execs)
1.15 paf 55: AC_DEFINE(NO_PA_EXECS,,pa_exec disabled)
1.16 paf 56: fi
57: ]
58: )
59:
1.18 paf 60: AC_ARG_ENABLE(foreign-group-files, [ --disable-foreign-group-files to disable read and executing
61: files belonging to group other then effective],
1.16 paf 62: [
63: if test "$enableval" = "no"; then
64: AC_MSG_WARN(disabling reading of files belonging to group other then effective)
1.18 paf 65: AC_DEFINE(NO_FOREIGN_GROUP_FILES,,disabled reading and executing files of non-process-effective-group)
1.15 paf 66: fi
67: ]
68: )
1.19 ! paf 69: sourcecharsetsdir=$srcdir/etc/parser3.charsets
! 70: CHARSETS_REQUESTED="windows-1251"
! 71: AC_ARG_WITH(charsets, [ --with-charsets=CHARSET[,CHARSET,...] Enables charsets in root config (windows-1251,
! 72: windows-1250 windows-1257 koi8-r; Default is windows-1251)],
! 73: [CHARSETS_REQUESTED=`echo $withval | sed -e 's/,/ /g'`])
! 74:
! 75: AC_DEFUN(PA_SUBSTCHARSET, [
! 76: commentcharset_$2='#'
! 77: for c in $CHARSETS_REQUESTED; do
! 78: if test "$1" = "$c"; then
! 79: if test -f $sourcecharsetsdir/$1.cfg; then
! 80: AC_MSG_WARN(Enabling charset $1)
! 81: commentcharset_$2=
! 82: else
! 83: AC_MSG_ERROR(bad charset requested "$1" - file $sourcecharsetsdir/$1.cfg not found)
! 84: fi
! 85: fi
! 86: done
! 87: AC_SUBST(commentcharset_$2)
! 88: ])
! 89:
! 90: PA_SUBSTCHARSET(windows-1251,windows1251)
! 91: PA_SUBSTCHARSET(windows-1250,windows1250)
! 92: PA_SUBSTCHARSET(windows-1257,windows1257)
! 93: PA_SUBSTCHARSET(koi8-r,koi8r)
! 94:
! 95:
! 96: AC_ARG_WITH(mysql-client,[ --with-mysql-client=mysqlclientlib?withparams
! 97: MySQL client dynamic library to root config],
! 98: mysql_client=$withval
! 99: ,
! 100: AC_MSG_CHECKING(for mysql client)
! 101: for lib in \
! 102: /usr/local/lib/mysql/libmysqlclient.so \
! 103: /usr/local/lib/libmysqlclient.so \
! 104: /usr/lib/libmysqlclient.so; do
! 105: if test -f $lib; then mysql_client=$lib; fi
! 106: done
! 107:
! 108: if test -z "$mysql_client"; then
! 109: mysql_client="-configure could not guess-"
! 110: AC_MSG_WARN(could not guess mysql client)
! 111: else
! 112: AC_MSG_RESULT($mysql_client)
! 113: fi
! 114:
! 115: )
! 116: AC_SUBST(mysql_client)
! 117:
! 118: AC_ARG_WITH(pgsql-client,[ --with-pgsql-client=pgsqlclientlib?withparams
! 119: PgSQL client dynamic library to root config],
! 120: mysql_client=$withval
! 121: ,
! 122: AC_MSG_CHECKING(for pgsql client)
! 123: for lib in \
! 124: /usr/local/pgsql/lib/libpq.so \
! 125: /usr/local/lib/libpq.so \
! 126: /usr/lib/libpq.so; do
! 127: if test -f $lib; then pgsql_client=$lib; fi
! 128: done
! 129:
! 130: if test -z "$pgsql_client"; then
! 131: pgsql_client="-configure could not guess-"
! 132: AC_MSG_WARN(could not guess pgsql client)
! 133: else
! 134: AC_MSG_RESULT($pgsql_client)
! 135: fi
! 136:
! 137: )
! 138: AC_SUBST(pgsql_client)
! 139:
! 140: AC_ARG_WITH(oracle-client,[ --with-oracle-client=oracleclientlib?withparams
! 141: Oracle client dynamic library],
! 142: oracle_client=$withval
! 143: ,
! 144: AC_MSG_CHECKING(for oracle client)
! 145: lib=$ORACLE_HOME/lib/libclntsh.so
! 146: if test -f $lib; then oracle_client=$lib; fi
! 147:
! 148: if test -z "$oracle_client"; then
! 149: oracle_client="-configure could not guess-"
! 150: AC_MSG_WARN(could not guess oracle client)
! 151: else
! 152: oracle_client="$oracle_client?ORACLE_HOME=$ORACLE_HOME&ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data"
! 153: AC_MSG_RESULT($oracle_client)
! 154: fi
! 155:
! 156: )
! 157: AC_SUBST(oracle_client)
! 158:
! 159:
1.15 paf 160:
1.9 paf 161: AC_ARG_WITH(pathlink,[ --with-pathlink=LKEY put dynamic libraries paths to binary
1.1 paf 162: using linker key (-R, -rpath-link)],
163: LD_PATHLINK=$withval
164: )
165:
1.17 paf 166:
1.9 paf 167: AC_ARG_WITH(glib-config,[ --with-glib-config=FILE FILE is glib library
168: configuration file (search for glib*-config)],
169: GLIB_CONFIG=$withval
170: )
171:
1.12 paf 172: AC_ARG_WITH(shared-xml,[ --with-shared-xml=D D is the directory where
173: Gnome XML libraries are installed (shared libs)],[
1.1 paf 174: GNOME_XML=$withval
1.13 paf 175: XMLBIN="$GNOME_XML/bin"
176: XMLINC="$GNOME_XML/include"
177: XMLLIB="$GNOME_XML/lib"
1.1 paf 178:
1.13 paf 179: if test \! -d $XMLBIN -o \! -d $XMLINC -o \! -d $XMLLIB; then
1.1 paf 180: AC_MSG_ERROR($GNOME_XML does not seem to be valid Gnome installation directory)
181: fi
182:
183: AC_DEFINE(XML,,xml-abled parser)
184:
1.13 paf 185: LIBXML2_SO_NAME=`cd $XMLLIB ; ls libxml2.?? libxml2.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
186: LIBGDOME_SO_NAME=`cd $XMLLIB ; ls libgdome.?? libgdome.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
187: LIBXSLT_SO_NAME=`cd $XMLLIB ; ls libxslt.?? libxslt.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
188: LIBEXSLT_SO_NAME=`cd $XMLLIB ; ls libexslt.?? libexslt.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
1.9 paf 189:
190: if test -z "$GLIB_CONFIG"; then
1.13 paf 191: GLIB_CONFIG=$XMLBIN/glib-config
1.9 paf 192: if test \! -x $GLIB_CONFIG; then
193: GLIB_CONFIG=glib-config
194: fi
1.1 paf 195: fi
196: GLIB_CFLAGS=`$GLIB_CONFIG --cflags`
197: GLIB_LIBS=`$GLIB_CONFIG --libs`
198:
1.13 paf 199: XML_INCLUDES="$GLIB_CFLAGS -I$XMLINC -I$XMLINC/libgdome -I$XMLINC/libxml2"
200: XML_LIBS="$GLIB_LIBS -L$XMLLIB -l$LIBXML2_SO_NAME -l$LIBGDOME_SO_NAME -l$LIBXSLT_SO_NAME -l$LIBEXSLT_SO_NAME"
1.1 paf 201: if test \! -z "$LD_PATHLINK"; then
1.13 paf 202: XML_LIBS="$XML_LIBS -Wl,$LD_PATHLINK -Wl,$XMLLIB"
1.1 paf 203: fi
204: ])
1.12 paf 205:
206: AC_ARG_WITH(static-xml,[ --with-static-xml=D D is the directory where
207: Gnome XML libraries are installed (static libs)],[
208: GNOME_XML=$withval
1.13 paf 209: XMLBIN="$GNOME_XML/bin"
210: XMLINC="$GNOME_XML/include"
211: XMLLIB="$GNOME_XML/lib"
1.12 paf 212:
1.13 paf 213: if test \! -d $XMLBIN -o \! -d $XMLINC -o \! -d $XMLLIB; then
1.12 paf 214: AC_MSG_ERROR($GNOME_XML does not seem to be valid Gnome installation directory)
215: fi
216:
217: AC_DEFINE(XML,,xml-abled parser)
218:
219: if test -z "$GLIB_CONFIG"; then
1.13 paf 220: GLIB_CONFIG=$XMLBIN/glib-config
1.12 paf 221: if test \! -x $GLIB_CONFIG; then
222: GLIB_CONFIG=glib-config
223: fi
224: fi
225: GLIB_CFLAGS=`$GLIB_CONFIG --cflags`
1.13 paf 226:
1.12 paf 227: dnl '-L/usr/local/lib -lglib' -> /usr/local/lib
1.13 paf 228: changequote(, )dnl
229: GLIB_DIR=`$GLIB_CONFIG --libs | sed 's/.*-L\([^ ]*\).*/\1/'`
230: GLIB_NAME=`$GLIB_CONFIG --libs | sed 's/.*-l\([^ ]*\).*/\1/'`
231: changequote([, ])dnl
232: XML_INCLUDES="$GLIB_CFLAGS -I$XMLINC -I$XMLINC/libgdome -I$XMLINC/libxml2"
233: XML_LIBS="$XMLLIB/libgdome.a $XMLLIB/libxslt.a $XMLLIB/libexslt.a $XMLLIB/libxml2.a $GLIB_DIR/lib$GLIB_NAME.a"
1.12 paf 234: ])
1.1 paf 235: AC_SUBST(XML_INCLUDES)
236: AC_SUBST(XML_LIBS)
1.18 paf 237:
238:
239: AC_ARG_WITH(sendmail,[ \"--with-sendmail=COMMAND\" forces this command to send mail.
240: example: \"--with-sendmail=/usr/sbin/sendmail -t\"
241: (makes parser ignore user-defined sendmail commands)],
242: AC_DEFINE_UNQUOTED(PA_FORCED_SENDMAIL,"$withval",parser uses this command instead of user-defined sendmail commands)
243: )
244:
1.14 paf 245:
246: AC_ARG_WITH(apache13,[ --with-apache13=D D is the Apache13 source distribution directory
247: builds library for apache_module using that dir
248: (do not add /src)],
249: APACHE13=$withval
250: if test \! -f "$APACHE13/src/include/httpd.h"; then
251: AC_MSG_ERROR($APACHE13 does not seem to be valid Apache13 source distribution directory)
252: fi
253: )
254: AC_SUBST(APACHE13)
255: AM_CONDITIONAL(COMPILE_APACHE13_MODULE, test -n "$APACHE13")
256:
1.1 paf 257:
258: dnl AC_CANONICAL_SYSTEM
259: AC_CANONICAL_HOST
260: AC_SUBST(host_os)
261:
262: dnl Checks for programs.
263: AC_PROG_INSTALL
264: AC_PROG_MAKE_SET
265: AC_PROG_RANLIB
266: AC_PROG_AWK
267:
268: AC_PROG_YACC
269: if test "$YACC" != "bison -y"; then
270: AC_MSG_WARN(to regenerate Parser grammar YOU WOULD NEED BISON)
271: else
272: AC_MSG_CHECKING(bison version)
273: oldIFS=$IFS; IFS=.
274: set `bison -V | sed -e 's/^GNU Bison version //'`
275: IFS=$oldIFS
276: if test "$1" = "1" -a "$2" -lt "25"; then
277: AC_MSG_WARN(Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2).)
278: fi
279: AC_MSG_RESULT($1.$2 (ok))
280: fi
281:
282: dnl Enable building of the convenience library
283: dnl and set LIBLTDL accordingly
284: AC_LIBLTDL_CONVENIENCE(src/libltdl)
285: dnl Substitute INCLTDL and LIBLTDL in the Makefiles
286: AC_SUBST(INCLTDL)
287: AC_SUBST(LIBLTDL)
288:
289: dnl Configure libltdl
290: AC_CONFIG_SUBDIRS(src/libltdl)
1.10 paf 291: dnl moved from src/libltdl/configure.in
292: LIBADD_DL=
293: AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1) LIBADD_DL="-ldl"],
294: [AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1)])])
295: AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1)],
296: [AC_CHECK_LIB(dld, shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1) LIBADD_DL="$LIBADD_DL -ldld"])])
297: AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1)dnl
298: test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
299: AC_SUBST(LIBADD_DL)
300:
301: if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
302: LIBS_SAVE="$LIBS"
303: LIBS="$LIBS $LIBADD_DL"
304: AC_CHECK_FUNCS(dlerror)
305: LIBS="$LIBS_SAVE"
306: fi
1.1 paf 307:
308: dnl Checks for typedefs, structures, and compiler characteristics.
309:
310: AC_TYPE_SIZE_T
311:
312: dnl Checks for header files.
313:
1.10 paf 314: AC_HEADER_TIME
315:
1.1 paf 316: AC_CHECK_HEADERS(
317: unistd.h \
318: process.h \
319: stddef.h \
320: stdarg.h \
321: fcntl.h \
322: sys/stat.h \
323: io.h \
324: stdio.h \
325: errno.h \
326: ctype.h \
327: math.h \
1.3 paf 328: time.h sys/time.h \
1.1 paf 329: stdlib.h \
330: string.h \
331: direct.h \
332: setjmp.h \
333: memory.h \
334: new \
335: sys/file.h \
336: sys/locking.h \
1.3 paf 337: sys/types.h \
1.5 paf 338: sys/select.h \
339: sys/resource.h
1.1 paf 340: )
341:
342: dnl Checks for libraries.
343:
344: dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
345: case "$host" in
346: *-sunos5.6* | *-solaris2.6*)
347: AC_CHECK_LIB(xnet, main)
348: ;;
349: *-sunos5* | *-solaris2*)
350: AC_CHECK_LIB(socket, main)
351: AC_CHECK_LIB(nsl, main)
352: ;;
353: *-nec-sysv4*)
354: AC_CHECK_LIB(nsl, gethostbyname)
355: AC_CHECK_LIB(socket, socket)
356: ;;
357: *-cygwin*)
358: AC_DEFINE(WIN32,,Windows32 target platform)
359: AC_CHECK_LIB(wsock32, socket)
360: ;;
361: esac
362:
363: AC_CHECK_LIB(m, sin)
364:
365: dnl Checks for functions.
366:
367: AC_CHECK_FUNCS(
368: trunc \
369: round \
370: sign \
371: flock \
372: _locking \
1.7 paf 373: fcntl \
1.4 paf 374: lockf \
375: getrusage
1.1 paf 376: )
1.3 paf 377:
378: dnl We require qsort(3) and select(2).
379:
380: AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.]))
381: AC_CHECK_FUNCS(select, , AC_MSG_ERROR([No select library function.]))
1.1 paf 382:
383: AC_MSG_CHECKING(whether compiler supports pragma pack)
384: AC_TRY_COMPILE(
385: ,
386: #pragma pack(1)
387: struct must_be_1_byte {
388: char c;
389: };
390: #pragma pack()
391: if(sizeof(must_be_1_byte)!=1)
392: return 1;
393: ,[
394: AC_MSG_RESULT(yes)
395: AC_DEFINE(HAVE_PRAGMA_PACK,,compiler supports pragma pack)
396: ],
397: AC_MSG_RESULT(no)
398: )
399:
400: AC_MSG_CHECKING(for set_new_handler)
401: AC_TRY_COMPILE(
402: #ifdef HAVE_NEW
403: #include <new>
404: #endif
405: void failed_new() {}
406: ,
407: std::set_new_handler(failed_new);
408: ,[
409: AC_MSG_RESULT(yes)
410: AC_DEFINE(HAVE_SET_NEW_HANDLER,,library has set_new_handler func)
411: ],
412: AC_MSG_RESULT(no)
413: )
414:
415:
416: dnl AC_ARG_ENABLE(db, [ --enable-db to enable 'hashfile' parser class],
417: dnl [
418: dnl if test "$enableval" != "no"; then
419: dnl AC_CHECK_HEADERS(db.h)
420: dnl AC_CHECK_LIB(db, __db_open)
421: dnl fi
422: dnl ]
423: dnl )
1.17 paf 424:
1.1 paf 425:
426: dnl Apache libs
1.10 paf 427: APACHE_LIBS="$LIBS $LIBADD_DL"
1.9 paf 428: dnl append stdc++ to libs list commented
429: dnl 1. because binary seem to work without it
430: dnl purpose of this: remove strange name dependance
431: dnl for linker creates reference not for libstc++.xx but
432: dnl for something specific to local system,
433: dnl thus reducing binary compatibility
434: dnl 2. for same reason linker of targets/cgi/parser3 changed to
435: dnl "C" compiler from "C++" compiler
436: dnl AC_CHECK_LIB(stdc++, __builtin_new,
437: dnl APACHE_LIBS="$APACHE_LIBS -lstdc++"
438: dnl )
1.1 paf 439: AC_SUBST(APACHE_LIBS)
440:
441:
442: dnl install directories
443:
444: # expand apostrophed
1.6 paf 445: e_prefix=$prefix
446: test "x$e_prefix" = xNONE && e_prefix=$ac_default_prefix
447:
1.1 paf 448: e_sysconfdir=$sysconfdir
1.6 paf 449: test "$e_sysconfdir" = "\${prefix}/etc" && e_sysconfdir="${e_prefix}/etc"
1.1 paf 450:
451: dnl this is used in targets/cgi/parser3.C to load root config
452:
1.2 paf 453: rootconfigdir=$e_sysconfdir
454: AC_SUBST(rootconfigdir)
1.1 paf 455:
456: dnl these are used to fill in etc/parser3.conf
457:
458: charsetsdir=$e_sysconfdir/parser3.charsets
459: AC_SUBST(charsetsdir)
460:
461: # expand apostrophed
462: e_libdir=$libdir
463: if test "$e_libdir" = "\${exec_prefix}/lib"; then
464:
465: # Let make expand exec_prefix.
466: e_exec_prefix=$exec_prefix
1.12 paf 467: test "x$e_exec_prefix" = xNONE && e_exec_prefix=$e_prefix
1.1 paf 468:
469: # expand apostrophed
470: test "$e_libdir" = "\${exec_prefix}/lib" && e_libdir="${e_exec_prefix}/lib"
471: fi
472:
473: sqldriversdir=$e_libdir
474: AC_SUBST(sqldriversdir)
475:
476:
477: dnl Output makefiles
478:
479: AM_CONFIG_HEADER(src/include/pa_config_auto.h)
1.8 paf 480: AC_OUTPUT(Makefile src/Makefile src/libltdl/Makefile src/types/Makefile src/classes/Makefile src/classes/gd/Makefile src/classes/smtp/Makefile src/include/Makefile src/main/Makefile src/sql/Makefile src/patches/Makefile src/pcre/Makefile src/targets/Makefile src/targets/cgi/pa_config_paths.h src/targets/cgi/Makefile src/targets/apache13/Makefile src/targets/apache13/p3runConfigure src/targets/isapi/Makefile etc/parser3.charsets/Makefile etc/parser3.conf etc/Makefile)
E-mail: