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