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