Annotation of parser3/configure.in, revision 1.17
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:
60: AC_ARG_ENABLE(foreign-group-files, [ --disable-foreign-group-files to disable reads
61: of files belonging to group other then effective],
62: [
63: if test "$enableval" = "no"; then
64: AC_MSG_WARN(disabling reading of files belonging to group other then effective)
65: AC_DEFINE(NO_FOREIGN_GROUP_FILES,,disabled reading of files of non-process-effective-group)
1.15 paf 66: fi
67: ]
68: )
69:
1.9 paf 70: AC_ARG_WITH(pathlink,[ --with-pathlink=LKEY put dynamic libraries paths to binary
1.1 paf 71: using linker key (-R, -rpath-link)],
72: LD_PATHLINK=$withval
73: )
74:
1.17 ! paf 75:
1.9 paf 76: AC_ARG_WITH(glib-config,[ --with-glib-config=FILE FILE is glib library
77: configuration file (search for glib*-config)],
78: GLIB_CONFIG=$withval
79: )
80:
1.12 paf 81: AC_ARG_WITH(shared-xml,[ --with-shared-xml=D D is the directory where
82: Gnome XML libraries are installed (shared libs)],[
1.1 paf 83: GNOME_XML=$withval
1.13 paf 84: XMLBIN="$GNOME_XML/bin"
85: XMLINC="$GNOME_XML/include"
86: XMLLIB="$GNOME_XML/lib"
1.1 paf 87:
1.13 paf 88: if test \! -d $XMLBIN -o \! -d $XMLINC -o \! -d $XMLLIB; then
1.1 paf 89: AC_MSG_ERROR($GNOME_XML does not seem to be valid Gnome installation directory)
90: fi
91:
92: AC_DEFINE(XML,,xml-abled parser)
93:
1.13 paf 94: LIBXML2_SO_NAME=`cd $XMLLIB ; ls libxml2.?? libxml2.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
95: LIBGDOME_SO_NAME=`cd $XMLLIB ; ls libgdome.?? libgdome.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
96: LIBXSLT_SO_NAME=`cd $XMLLIB ; ls libxslt.?? libxslt.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
97: LIBEXSLT_SO_NAME=`cd $XMLLIB ; ls libexslt.?? libexslt.??? 2>/dev/null | grep -v \.la$ | sed 's/lib//' | sed 's/\..*//'`
1.9 paf 98:
99: if test -z "$GLIB_CONFIG"; then
1.13 paf 100: GLIB_CONFIG=$XMLBIN/glib-config
1.9 paf 101: if test \! -x $GLIB_CONFIG; then
102: GLIB_CONFIG=glib-config
103: fi
1.1 paf 104: fi
105: GLIB_CFLAGS=`$GLIB_CONFIG --cflags`
106: GLIB_LIBS=`$GLIB_CONFIG --libs`
107:
1.13 paf 108: XML_INCLUDES="$GLIB_CFLAGS -I$XMLINC -I$XMLINC/libgdome -I$XMLINC/libxml2"
109: 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 110: if test \! -z "$LD_PATHLINK"; then
1.13 paf 111: XML_LIBS="$XML_LIBS -Wl,$LD_PATHLINK -Wl,$XMLLIB"
1.1 paf 112: fi
113: ])
1.12 paf 114:
115: AC_ARG_WITH(static-xml,[ --with-static-xml=D D is the directory where
116: Gnome XML libraries are installed (static libs)],[
117: GNOME_XML=$withval
1.13 paf 118: XMLBIN="$GNOME_XML/bin"
119: XMLINC="$GNOME_XML/include"
120: XMLLIB="$GNOME_XML/lib"
1.12 paf 121:
1.13 paf 122: if test \! -d $XMLBIN -o \! -d $XMLINC -o \! -d $XMLLIB; then
1.12 paf 123: AC_MSG_ERROR($GNOME_XML does not seem to be valid Gnome installation directory)
124: fi
125:
126: AC_DEFINE(XML,,xml-abled parser)
127:
128: if test -z "$GLIB_CONFIG"; then
1.13 paf 129: GLIB_CONFIG=$XMLBIN/glib-config
1.12 paf 130: if test \! -x $GLIB_CONFIG; then
131: GLIB_CONFIG=glib-config
132: fi
133: fi
134: GLIB_CFLAGS=`$GLIB_CONFIG --cflags`
1.13 paf 135:
1.12 paf 136: dnl '-L/usr/local/lib -lglib' -> /usr/local/lib
1.13 paf 137: changequote(, )dnl
138: GLIB_DIR=`$GLIB_CONFIG --libs | sed 's/.*-L\([^ ]*\).*/\1/'`
139: GLIB_NAME=`$GLIB_CONFIG --libs | sed 's/.*-l\([^ ]*\).*/\1/'`
140: changequote([, ])dnl
141: XML_INCLUDES="$GLIB_CFLAGS -I$XMLINC -I$XMLINC/libgdome -I$XMLINC/libxml2"
142: XML_LIBS="$XMLLIB/libgdome.a $XMLLIB/libxslt.a $XMLLIB/libexslt.a $XMLLIB/libxml2.a $GLIB_DIR/lib$GLIB_NAME.a"
1.12 paf 143: ])
1.1 paf 144: AC_SUBST(XML_INCLUDES)
145: AC_SUBST(XML_LIBS)
1.14 paf 146:
147: AC_ARG_WITH(apache13,[ --with-apache13=D D is the Apache13 source distribution directory
148: builds library for apache_module using that dir
149: (do not add /src)],
150: APACHE13=$withval
151: if test \! -f "$APACHE13/src/include/httpd.h"; then
152: AC_MSG_ERROR($APACHE13 does not seem to be valid Apache13 source distribution directory)
153: fi
154: )
155: AC_SUBST(APACHE13)
156: AM_CONDITIONAL(COMPILE_APACHE13_MODULE, test -n "$APACHE13")
157:
1.1 paf 158:
159: dnl AC_CANONICAL_SYSTEM
160: AC_CANONICAL_HOST
161: AC_SUBST(host_os)
162:
163: dnl Checks for programs.
164: AC_PROG_INSTALL
165: AC_PROG_MAKE_SET
166: AC_PROG_RANLIB
167: AC_PROG_AWK
168:
169: AC_PROG_YACC
170: if test "$YACC" != "bison -y"; then
171: AC_MSG_WARN(to regenerate Parser grammar YOU WOULD NEED BISON)
172: else
173: AC_MSG_CHECKING(bison version)
174: oldIFS=$IFS; IFS=.
175: set `bison -V | sed -e 's/^GNU Bison version //'`
176: IFS=$oldIFS
177: if test "$1" = "1" -a "$2" -lt "25"; then
178: AC_MSG_WARN(Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2).)
179: fi
180: AC_MSG_RESULT($1.$2 (ok))
181: fi
182:
183: dnl Enable building of the convenience library
184: dnl and set LIBLTDL accordingly
185: AC_LIBLTDL_CONVENIENCE(src/libltdl)
186: dnl Substitute INCLTDL and LIBLTDL in the Makefiles
187: AC_SUBST(INCLTDL)
188: AC_SUBST(LIBLTDL)
189:
190: dnl Configure libltdl
191: AC_CONFIG_SUBDIRS(src/libltdl)
1.10 paf 192: dnl moved from src/libltdl/configure.in
193: LIBADD_DL=
194: AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1) LIBADD_DL="-ldl"],
195: [AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1)])])
196: AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1)],
197: [AC_CHECK_LIB(dld, shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1) LIBADD_DL="$LIBADD_DL -ldld"])])
198: AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1)dnl
199: test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
200: AC_SUBST(LIBADD_DL)
201:
202: if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
203: LIBS_SAVE="$LIBS"
204: LIBS="$LIBS $LIBADD_DL"
205: AC_CHECK_FUNCS(dlerror)
206: LIBS="$LIBS_SAVE"
207: fi
1.1 paf 208:
209: dnl Checks for typedefs, structures, and compiler characteristics.
210:
211: AC_TYPE_SIZE_T
212:
213: dnl Checks for header files.
214:
1.10 paf 215: AC_HEADER_TIME
216:
1.1 paf 217: AC_CHECK_HEADERS(
218: unistd.h \
219: process.h \
220: stddef.h \
221: stdarg.h \
222: fcntl.h \
223: sys/stat.h \
224: io.h \
225: stdio.h \
226: errno.h \
227: ctype.h \
228: math.h \
1.3 paf 229: time.h sys/time.h \
1.1 paf 230: stdlib.h \
231: string.h \
232: direct.h \
233: setjmp.h \
234: memory.h \
235: new \
236: sys/file.h \
237: sys/locking.h \
1.3 paf 238: sys/types.h \
1.5 paf 239: sys/select.h \
240: sys/resource.h
1.1 paf 241: )
242:
243: dnl Checks for libraries.
244:
245: dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
246: case "$host" in
247: *-sunos5.6* | *-solaris2.6*)
248: AC_CHECK_LIB(xnet, main)
249: ;;
250: *-sunos5* | *-solaris2*)
251: AC_CHECK_LIB(socket, main)
252: AC_CHECK_LIB(nsl, main)
253: ;;
254: *-nec-sysv4*)
255: AC_CHECK_LIB(nsl, gethostbyname)
256: AC_CHECK_LIB(socket, socket)
257: ;;
258: *-cygwin*)
259: AC_DEFINE(WIN32,,Windows32 target platform)
260: AC_CHECK_LIB(wsock32, socket)
261: ;;
262: esac
263:
264: AC_CHECK_LIB(m, sin)
265:
266: dnl Checks for functions.
267:
268: AC_CHECK_FUNCS(
269: trunc \
270: round \
271: sign \
272: flock \
273: _locking \
1.7 paf 274: fcntl \
1.4 paf 275: lockf \
276: getrusage
1.1 paf 277: )
1.3 paf 278:
279: dnl We require qsort(3) and select(2).
280:
281: AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.]))
282: AC_CHECK_FUNCS(select, , AC_MSG_ERROR([No select library function.]))
1.1 paf 283:
284: AC_MSG_CHECKING(whether compiler supports pragma pack)
285: AC_TRY_COMPILE(
286: ,
287: #pragma pack(1)
288: struct must_be_1_byte {
289: char c;
290: };
291: #pragma pack()
292: if(sizeof(must_be_1_byte)!=1)
293: return 1;
294: ,[
295: AC_MSG_RESULT(yes)
296: AC_DEFINE(HAVE_PRAGMA_PACK,,compiler supports pragma pack)
297: ],
298: AC_MSG_RESULT(no)
299: )
300:
301: AC_MSG_CHECKING(for set_new_handler)
302: AC_TRY_COMPILE(
303: #ifdef HAVE_NEW
304: #include <new>
305: #endif
306: void failed_new() {}
307: ,
308: std::set_new_handler(failed_new);
309: ,[
310: AC_MSG_RESULT(yes)
311: AC_DEFINE(HAVE_SET_NEW_HANDLER,,library has set_new_handler func)
312: ],
313: AC_MSG_RESULT(no)
314: )
315:
316:
317: dnl AC_ARG_ENABLE(db, [ --enable-db to enable 'hashfile' parser class],
318: dnl [
319: dnl if test "$enableval" != "no"; then
320: dnl AC_CHECK_HEADERS(db.h)
321: dnl AC_CHECK_LIB(db, __db_open)
322: dnl fi
323: dnl ]
324: dnl )
1.17 ! paf 325:
1.1 paf 326:
327: dnl Apache libs
1.10 paf 328: APACHE_LIBS="$LIBS $LIBADD_DL"
1.9 paf 329: dnl append stdc++ to libs list commented
330: dnl 1. because binary seem to work without it
331: dnl purpose of this: remove strange name dependance
332: dnl for linker creates reference not for libstc++.xx but
333: dnl for something specific to local system,
334: dnl thus reducing binary compatibility
335: dnl 2. for same reason linker of targets/cgi/parser3 changed to
336: dnl "C" compiler from "C++" compiler
337: dnl AC_CHECK_LIB(stdc++, __builtin_new,
338: dnl APACHE_LIBS="$APACHE_LIBS -lstdc++"
339: dnl )
1.1 paf 340: AC_SUBST(APACHE_LIBS)
341:
342:
343: dnl install directories
344:
345: # expand apostrophed
1.6 paf 346: e_prefix=$prefix
347: test "x$e_prefix" = xNONE && e_prefix=$ac_default_prefix
348:
1.1 paf 349: e_sysconfdir=$sysconfdir
1.6 paf 350: test "$e_sysconfdir" = "\${prefix}/etc" && e_sysconfdir="${e_prefix}/etc"
1.1 paf 351:
352: dnl this is used in targets/cgi/parser3.C to load root config
353:
1.2 paf 354: rootconfigdir=$e_sysconfdir
355: AC_SUBST(rootconfigdir)
1.1 paf 356:
357: dnl these are used to fill in etc/parser3.conf
358:
359: charsetsdir=$e_sysconfdir/parser3.charsets
360: AC_SUBST(charsetsdir)
361:
362: # expand apostrophed
363: e_libdir=$libdir
364: if test "$e_libdir" = "\${exec_prefix}/lib"; then
365:
366: # Let make expand exec_prefix.
367: e_exec_prefix=$exec_prefix
1.12 paf 368: test "x$e_exec_prefix" = xNONE && e_exec_prefix=$e_prefix
1.1 paf 369:
370: # expand apostrophed
371: test "$e_libdir" = "\${exec_prefix}/lib" && e_libdir="${e_exec_prefix}/lib"
372: fi
373:
374: sqldriversdir=$e_libdir
375: AC_SUBST(sqldriversdir)
376:
377:
378: dnl Output makefiles
379:
380: AM_CONFIG_HEADER(src/include/pa_config_auto.h)
1.8 paf 381: 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: