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