Annotation of parser3/configure.in, revision 1.18
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: )
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.18 ! paf 146:
! 147:
! 148: AC_ARG_WITH(sendmail,[ \"--with-sendmail=COMMAND\" forces this command to send mail.
! 149: example: \"--with-sendmail=/usr/sbin/sendmail -t\"
! 150: (makes parser ignore user-defined sendmail commands)],
! 151: AC_DEFINE_UNQUOTED(PA_FORCED_SENDMAIL,"$withval",parser uses this command instead of user-defined sendmail commands)
! 152: )
! 153:
1.14 paf 154:
155: AC_ARG_WITH(apache13,[ --with-apache13=D D is the Apache13 source distribution directory
156: builds library for apache_module using that dir
157: (do not add /src)],
158: APACHE13=$withval
159: if test \! -f "$APACHE13/src/include/httpd.h"; then
160: AC_MSG_ERROR($APACHE13 does not seem to be valid Apache13 source distribution directory)
161: fi
162: )
163: AC_SUBST(APACHE13)
164: AM_CONDITIONAL(COMPILE_APACHE13_MODULE, test -n "$APACHE13")
165:
1.1 paf 166:
167: dnl AC_CANONICAL_SYSTEM
168: AC_CANONICAL_HOST
169: AC_SUBST(host_os)
170:
171: dnl Checks for programs.
172: AC_PROG_INSTALL
173: AC_PROG_MAKE_SET
174: AC_PROG_RANLIB
175: AC_PROG_AWK
176:
177: AC_PROG_YACC
178: if test "$YACC" != "bison -y"; then
179: AC_MSG_WARN(to regenerate Parser grammar YOU WOULD NEED BISON)
180: else
181: AC_MSG_CHECKING(bison version)
182: oldIFS=$IFS; IFS=.
183: set `bison -V | sed -e 's/^GNU Bison version //'`
184: IFS=$oldIFS
185: if test "$1" = "1" -a "$2" -lt "25"; then
186: AC_MSG_WARN(Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2).)
187: fi
188: AC_MSG_RESULT($1.$2 (ok))
189: fi
190:
191: dnl Enable building of the convenience library
192: dnl and set LIBLTDL accordingly
193: AC_LIBLTDL_CONVENIENCE(src/libltdl)
194: dnl Substitute INCLTDL and LIBLTDL in the Makefiles
195: AC_SUBST(INCLTDL)
196: AC_SUBST(LIBLTDL)
197:
198: dnl Configure libltdl
199: AC_CONFIG_SUBDIRS(src/libltdl)
1.10 paf 200: dnl moved from src/libltdl/configure.in
201: LIBADD_DL=
202: AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1) LIBADD_DL="-ldl"],
203: [AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1)])])
204: AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1)],
205: [AC_CHECK_LIB(dld, shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1) LIBADD_DL="$LIBADD_DL -ldld"])])
206: AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1)dnl
207: test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
208: AC_SUBST(LIBADD_DL)
209:
210: if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
211: LIBS_SAVE="$LIBS"
212: LIBS="$LIBS $LIBADD_DL"
213: AC_CHECK_FUNCS(dlerror)
214: LIBS="$LIBS_SAVE"
215: fi
1.1 paf 216:
217: dnl Checks for typedefs, structures, and compiler characteristics.
218:
219: AC_TYPE_SIZE_T
220:
221: dnl Checks for header files.
222:
1.10 paf 223: AC_HEADER_TIME
224:
1.1 paf 225: AC_CHECK_HEADERS(
226: unistd.h \
227: process.h \
228: stddef.h \
229: stdarg.h \
230: fcntl.h \
231: sys/stat.h \
232: io.h \
233: stdio.h \
234: errno.h \
235: ctype.h \
236: math.h \
1.3 paf 237: time.h sys/time.h \
1.1 paf 238: stdlib.h \
239: string.h \
240: direct.h \
241: setjmp.h \
242: memory.h \
243: new \
244: sys/file.h \
245: sys/locking.h \
1.3 paf 246: sys/types.h \
1.5 paf 247: sys/select.h \
248: sys/resource.h
1.1 paf 249: )
250:
251: dnl Checks for libraries.
252:
253: dnl Some systems (Solaris 2.x) require libnsl (Network Services Library)
254: case "$host" in
255: *-sunos5.6* | *-solaris2.6*)
256: AC_CHECK_LIB(xnet, main)
257: ;;
258: *-sunos5* | *-solaris2*)
259: AC_CHECK_LIB(socket, main)
260: AC_CHECK_LIB(nsl, main)
261: ;;
262: *-nec-sysv4*)
263: AC_CHECK_LIB(nsl, gethostbyname)
264: AC_CHECK_LIB(socket, socket)
265: ;;
266: *-cygwin*)
267: AC_DEFINE(WIN32,,Windows32 target platform)
268: AC_CHECK_LIB(wsock32, socket)
269: ;;
270: esac
271:
272: AC_CHECK_LIB(m, sin)
273:
274: dnl Checks for functions.
275:
276: AC_CHECK_FUNCS(
277: trunc \
278: round \
279: sign \
280: flock \
281: _locking \
1.7 paf 282: fcntl \
1.4 paf 283: lockf \
284: getrusage
1.1 paf 285: )
1.3 paf 286:
287: dnl We require qsort(3) and select(2).
288:
289: AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.]))
290: AC_CHECK_FUNCS(select, , AC_MSG_ERROR([No select library function.]))
1.1 paf 291:
292: AC_MSG_CHECKING(whether compiler supports pragma pack)
293: AC_TRY_COMPILE(
294: ,
295: #pragma pack(1)
296: struct must_be_1_byte {
297: char c;
298: };
299: #pragma pack()
300: if(sizeof(must_be_1_byte)!=1)
301: return 1;
302: ,[
303: AC_MSG_RESULT(yes)
304: AC_DEFINE(HAVE_PRAGMA_PACK,,compiler supports pragma pack)
305: ],
306: AC_MSG_RESULT(no)
307: )
308:
309: AC_MSG_CHECKING(for set_new_handler)
310: AC_TRY_COMPILE(
311: #ifdef HAVE_NEW
312: #include <new>
313: #endif
314: void failed_new() {}
315: ,
316: std::set_new_handler(failed_new);
317: ,[
318: AC_MSG_RESULT(yes)
319: AC_DEFINE(HAVE_SET_NEW_HANDLER,,library has set_new_handler func)
320: ],
321: AC_MSG_RESULT(no)
322: )
323:
324:
325: dnl AC_ARG_ENABLE(db, [ --enable-db to enable 'hashfile' parser class],
326: dnl [
327: dnl if test "$enableval" != "no"; then
328: dnl AC_CHECK_HEADERS(db.h)
329: dnl AC_CHECK_LIB(db, __db_open)
330: dnl fi
331: dnl ]
332: dnl )
1.17 paf 333:
1.1 paf 334:
335: dnl Apache libs
1.10 paf 336: APACHE_LIBS="$LIBS $LIBADD_DL"
1.9 paf 337: dnl append stdc++ to libs list commented
338: dnl 1. because binary seem to work without it
339: dnl purpose of this: remove strange name dependance
340: dnl for linker creates reference not for libstc++.xx but
341: dnl for something specific to local system,
342: dnl thus reducing binary compatibility
343: dnl 2. for same reason linker of targets/cgi/parser3 changed to
344: dnl "C" compiler from "C++" compiler
345: dnl AC_CHECK_LIB(stdc++, __builtin_new,
346: dnl APACHE_LIBS="$APACHE_LIBS -lstdc++"
347: dnl )
1.1 paf 348: AC_SUBST(APACHE_LIBS)
349:
350:
351: dnl install directories
352:
353: # expand apostrophed
1.6 paf 354: e_prefix=$prefix
355: test "x$e_prefix" = xNONE && e_prefix=$ac_default_prefix
356:
1.1 paf 357: e_sysconfdir=$sysconfdir
1.6 paf 358: test "$e_sysconfdir" = "\${prefix}/etc" && e_sysconfdir="${e_prefix}/etc"
1.1 paf 359:
360: dnl this is used in targets/cgi/parser3.C to load root config
361:
1.2 paf 362: rootconfigdir=$e_sysconfdir
363: AC_SUBST(rootconfigdir)
1.1 paf 364:
365: dnl these are used to fill in etc/parser3.conf
366:
367: charsetsdir=$e_sysconfdir/parser3.charsets
368: AC_SUBST(charsetsdir)
369:
370: # expand apostrophed
371: e_libdir=$libdir
372: if test "$e_libdir" = "\${exec_prefix}/lib"; then
373:
374: # Let make expand exec_prefix.
375: e_exec_prefix=$exec_prefix
1.12 paf 376: test "x$e_exec_prefix" = xNONE && e_exec_prefix=$e_prefix
1.1 paf 377:
378: # expand apostrophed
379: test "$e_libdir" = "\${exec_prefix}/lib" && e_libdir="${e_exec_prefix}/lib"
380: fi
381:
382: sqldriversdir=$e_libdir
383: AC_SUBST(sqldriversdir)
384:
385:
386: dnl Output makefiles
387:
388: AM_CONFIG_HEADER(src/include/pa_config_auto.h)
1.8 paf 389: 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: