Annotation of XML/configure.in, revision 1.43
1.1 veillard 1: dnl Process this file with autoconf to produce a configure script.
2: AC_PREREQ(2.2)
1.42 veillard 3: AC_INIT(entities.c)
4: AM_CONFIG_HEADER(config.h)
5: AC_CANONICAL_HOST
1.1 veillard 6:
1.26 daniel 7: LIBXML_MAJOR_VERSION=2
1.34 veillard 8: LIBXML_MINOR_VERSION=2
1.42 veillard 9: LIBXML_MICRO_VERSION=5
1.4 daniel 10: LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
11: LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
12:
1.28 daniel 13: LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
14:
1.4 daniel 15: AC_SUBST(LIBXML_MAJOR_VERSION)
16: AC_SUBST(LIBXML_MINOR_VERSION)
17: AC_SUBST(LIBXML_MICRO_VERSION)
18: AC_SUBST(LIBXML_VERSION)
19: AC_SUBST(LIBXML_VERSION_INFO)
1.28 daniel 20: AC_SUBST(LIBXML_VERSION_NUMBER)
1.4 daniel 21:
1.42 veillard 22: VERSION=${LIBXML_VERSION}
23:
24: AM_INIT_AUTOMAKE(libxml2, $VERSION)
25:
26: AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
1.4 daniel 27:
1.1 veillard 28: dnl Checks for programs.
29: AC_PROG_CC
30: AC_PROG_INSTALL
1.42 veillard 31: AC_PROG_CPP
1.1 veillard 32: AC_PATH_PROG(RM, rm, /bin/rm)
33: AC_PATH_PROG(MV, mv, /bin/mv)
34: AC_PATH_PROG(TAR, tar, /bin/tar)
35:
1.42 veillard 36: dnl Make sure we have an ANSI compiler
37: AM_C_PROTOTYPES
38: test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
39:
1.43 ! veillard 40: # No fucking shared libs when I debug !
! 41: AC_DISABLE_SHARED
1.42 veillard 42: AM_PROG_LIBTOOL
43:
44: AM_MAINTAINER_MODE
45:
46: dnl Checks for zlib library.
47: _cppflags="${CPPFLAGS}"
48: _ldflags="${LDFLAGS}"
49:
50: AC_ARG_WITH(zlib,
51: [ --with-zlib[=DIR] use libz in DIR],[
52: if test "$withval" != "no" -a "$withval" != "yes"; then
53: Z_DIR=$withval
54: CPPFLAGS="${CPPFLAGS} -I$withval/include"
55: LDFLAGS="${LDFLAGS} -L$withval/lib"
56: fi
57: ])
58:
59: AC_CHECK_HEADERS(zlib.h,
60: AC_CHECK_LIB(z, gzread,[
61: AC_DEFINE(HAVE_LIBZ)
62: if test "x${Z_DIR}" != "x"; then
63: Z_CFLAGS="-I${Z_DIR}/include"
64: Z_LIBS="-L${Z_DIR}/lib -lz"
65: else
66: Z_LIBS="-lz"
67: fi]))
68: AC_SUBST(Z_CFLAGS)
69: AC_SUBST(Z_LIBS)
1.3 daniel 70:
1.42 veillard 71: CPPFLAGS=${_cppflags}
72: LDFLAGS=${_ldflags}
1.9 daniel 73:
1.1 veillard 74: dnl Checks for header files.
75: AC_HEADER_DIRENT
76: AC_HEADER_STDC
77: AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h)
1.42 veillard 78: AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h)
79: AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h)
1.10 daniel 80: AC_CHECK_HEADERS(stdlib.h sys/socket.h netinet/in.h arpa/inet.h)
1.42 veillard 81: AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h sys/mman.h)
82:
83: dnl Specific dir for HTML output ?
84: if test "x$with_html_dir" = "x" ; then
85: HTML_DIR='${datadir}/gtk-doc/html'
86: else
87: HTML_DIR=$with_html_dir
88: fi
89:
90: AC_SUBST(HTML_DIR)
91:
92: AC_ARG_ENABLE(corba,
93: [ --enable-corba Add Corba support (default)])
94:
95: dnl
96: dnl Corba is enabled by default
97: dnl
98: if test "$enable_corba" = "no" ; then
99: CORBA_CFLAGS="-DWITHOUT_CORBA"
100: fi
101: AC_SUBST(CORBA_CFLAGS)
1.1 veillard 102:
103: dnl Checks for library functions.
104: AC_FUNC_STRFTIME
1.8 daniel 105: AC_CHECK_FUNCS(strdup strndup strerror snprintf)
1.42 veillard 106: AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
107: AC_CHECK_FUNCS(strftime localtime)
108:
109: dnl Checks for inet libraries:
110: AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
111: AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
112: AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
113:
114: dnl Determine what socket length (socklen_t) data type is
115: AC_MSG_CHECKING([for type of socket length (socklen_t)])
116: AC_TRY_COMPILE2([
117: #include <stddef.h>
118: #include <sys/types.h>
119: #include <sys/socket.h>],[
120: (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
121: AC_MSG_RESULT(socklen_t *)
122: SOCKLEN_T=socklen_t],[
123: AC_TRY_COMPILE2([
124: #include <stddef.h>
125: #include <sys/types.h>
126: #include <sys/socket.h>],[
127: (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
128: AC_MSG_RESULT(size_t *)
129: SOCKLEN_T=size_t],[
130: AC_TRY_COMPILE2([
131: #include <stddef.h>
132: #include <sys/types.h>
133: #include <sys/socket.h>],[
134: (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
135: AC_MSG_RESULT(int *)
136: SOCKLEN_T=int],[
137: AC_MSG_WARN(could not determine)])])])
138: AC_DEFINE_UNQUOTED(SOCKLEN_T, $SOCKLEN_T)
139:
140: dnl Checks for isnan in libm if not in libc
141: AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
142: [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
143:
144: AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf,
145: [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)]))
146:
147: XML_LIBDIR='-L${libdir}'
148: XML_INCLUDEDIR='-I${includedir}/libxml -I${includedir}'
149: XML_LIBS="-lxml $Z_LIBS $M_LIBS $LIBS"
150:
151: dnl
152: dnl Extra flags
153: dnl
154: XML_CFLAGS=""
1.1 veillard 155:
1.15 daniel 156: dnl
1.42 veillard 157: dnl Workaround for HP native compiler
1.15 daniel 158: dnl http://bugs.gnome.org/db/31/3163.html
159: dnl
1.42 veillard 160: if test "${GCC}" != "yes" ; then
1.15 daniel 161: case "${host}" in
162: *-*-hpux* )
1.42 veillard 163: CFLAGS="${CFLAGS} -Wp,-H30000"
1.15 daniel 164: ;;
165: esac
166: fi
1.42 veillard 167: case ${host} in
168: *-*-solaris*)
169: XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
170: ;;
171: esac
172:
1.27 daniel 173:
1.28 daniel 174:
175: dnl
176: dnl Use buffers for content
177: dnl
178:
1.42 veillard 179: AC_ARG_WITH(buffers, [ --with-buffers Use buffers for node content])
1.28 daniel 180: if test "$with_buffers" = "yes" ; then
181: CFLAGS="${CFLAGS} -DXML_USE_BUFFER_CONTENT"
1.42 veillard 182: XML_CFLAGS="${XML_CFLAGS} -DXML_USE_BUFFER_CONTENT"
1.27 daniel 183: fi
184:
1.42 veillard 185: dnl
186: dnl Tester makes use of readline if present
187: dnl
188: _cppflags="${CPPFLAGS}"
189: _ldflags="${LDFLAGS}"
190:
191: AC_ARG_WITH(readline,
192: [ --with-readline=DIR use readline in DIR],[
193: if test "$withval" != "no" -a "$withval" != "yes"; then
194: RDL_DIR=$withval
195: CPPFLAGS="${CPPFLAGS} -I$withval/include"
196: LDFLAGS="${LDFLAGS} -L$withval/lib"
197: fi
198: ])
199:
200: dnl check for terminal library. this is a very cool solution
201: dnl from octave's configure.in
202: unset tcap
203: for termlib in ncurses curses termcap terminfo termlib; do
204: AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
205: test -n "$tcap" && break
206: done
207:
208: AC_CHECK_HEADER(readline/history.h,
209: AC_CHECK_LIB(history, append_history,[
210: RDL_LIBS="-lhistory"
211: AC_DEFINE(HAVE_LIBHISTORY)]))
212: AC_CHECK_HEADER(readline/readline.h,
213: AC_CHECK_LIB(readline, readline,[
214: RDL_LIBS="-lreadline $RDL_LIBS $tcap"
215: AC_DEFINE(HAVE_LIBREADLINE)], , $tcap))
216: if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
217: CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
218: RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
219: else
220: CPPFLAGS=${_cppflags}
221: fi
222: LDFLAGS=${_ldflags}
1.15 daniel 223:
1.42 veillard 224: AC_SUBST(RDL_LIBS)
1.20 daniel 225:
1.28 daniel 226: dnl
1.42 veillard 227: dnl Aloow to disable various pieces
1.28 daniel 228: dnl
229:
230: AC_ARG_WITH(ftp, [ --with-ftp Add the FTP support (on)])
231: if test "$with_ftp" = "no" ; then
232: echo Disabling FTP support
233: WITH_FTP=0
234: FTP_OBJ=
235: else
236: WITH_FTP=1
237: FTP_OBJ=nanoftp.o
238: fi
239: AC_SUBST(WITH_FTP)
240: AC_SUBST(FTP_OBJ)
241:
242: AC_ARG_WITH(http, [ --with-http Add the HTTP support (on)])
243: if test "$with_http" = "no" ; then
244: echo Disabling HTTP support
245: WITH_HTTP=0
246: HTTP_OBJ=
247: else
248: WITH_HTTP=1
249: HTTP_OBJ=nanohttp.o
250: fi
251: AC_SUBST(WITH_HTTP)
252: AC_SUBST(HTTP_OBJ)
253:
254: AC_ARG_WITH(html, [ --with-html Add the HTML support (on)])
255: if test "$with_html" = "no" ; then
256: echo Disabling HTML support
257: WITH_HTML=0
258: HTML_OBJ=
259: else
260: WITH_HTML=1
261: HTML_OBJ="HTMLparser.o HTMLtree.o"
262: fi
263: AC_SUBST(WITH_HTML)
264: AC_SUBST(HTML_OBJ)
1.37 veillard 265:
266: AC_ARG_WITH(docbook, [ --with-docbook Add the Docbook support (off)])
267: if test "$with_docbook" = "yes" ; then
268: echo Enabling Docbook support
269: WITH_SGML=1
270: SGML_OBJ="SGMLparser.o"
1.42 veillard 271: else
1.37 veillard 272: WITH_SGML=0
273: SGML_OBJ=
274: fi
275: AC_SUBST(WITH_SGML)
276: AC_SUBST(SGML_OBJ)
1.28 daniel 277:
278: AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)])
279: if test "$with_xpath" = "no" ; then
280: echo Disabling XPATH support
281: WITH_XPATH=0
282: XPATH_OBJ=
283: else
284: WITH_XPATH=1
285: XPATH_OBJ=xpath.o
286: fi
287: AC_SUBST(WITH_XPATH)
288: AC_SUBST(XPATH_OBJ)
1.40 veillard 289:
1.41 veillard 290: AC_ARG_WITH(xptr, [ --with-xptr Add the XPointer support (on)])
291: if test "$with_xptr" = "no" ; then
292: echo Disabling XPointer support
293: WITH_XPTR=0
294: XPTR_OBJ=
295: else
1.40 veillard 296: WITH_XPTR=1
297: XPTR_OBJ=xpointer.o
298: fi
299: AC_SUBST(WITH_XPTR)
300: AC_SUBST(XPTR_OBJ)
1.29 daniel 301:
1.30 daniel 302: AC_ARG_WITH(iconv, [ --with-iconv Add the ICONV support (on)])
303: if test "$with_iconv" = "no" ; then
304: echo Disabling ICONV support
305: WITH_ICONV=0
306: else
1.38 veillard 307: AC_CHECK_FUNCS(iconv)
1.29 daniel 308: if test "$have_iconv" != "" ; then
309: echo Iconv support not found
1.42 veillard 310: WITH_ICONV=0
1.29 daniel 311: else
1.42 veillard 312: WITH_ICONV=1
1.29 daniel 313: fi
1.42 veillard 314: fi
1.29 daniel 315: AC_SUBST(WITH_ICONV)
1.28 daniel 316:
317: AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)])
318: if test "$with_debug" = "no" ; then
319: echo Disabling DEBUG support
320: WITH_DEBUG=0
321: DEBUG_OBJ=
322: else
323: WITH_DEBUG=1
324: DEBUG_OBJ=debugXML.o
325: fi
326: AC_SUBST(WITH_DEBUG)
327: AC_SUBST(DEBUG_OBJ)
328:
329: AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
1.42 veillard 330: if test "$with_mem_debug" = "yes" ; then
1.28 daniel 331: echo Enabling memory debug support
332: WITH_MEM_DEBUG=1
1.42 veillard 333: else
334: WITH_MEM_DEBUG=0
1.28 daniel 335: fi
336: AC_SUBST(WITH_MEM_DEBUG)
337:
1.42 veillard 338: AC_SUBST(CFLAGS)
339: AC_SUBST(XML_CFLAGS)
340:
341: AC_SUBST(XML_LIBDIR)
342: AC_SUBST(XML_LIBS)
343: AC_SUBST(XML_INCLUDEDIR)
344: AC_SUBST(HTML_DIR)
345: AC_SUBST(HAVE_ISNAN)
346: AC_SUBST(HAVE_ISINF)
347:
348: AC_SUBST(M_LIBS)
349: AC_SUBST(RDL_LIBS)
350:
351: dnl
352: dnl create the libxml and include links needed to get dependencies right
353: dnl
354: if test ! -d $srcdir/include/libxml
355: then
356: if test ! -d $srcdir/include
357: then
358: rm -f $srcdir/include
359: mkdir $srcdir/include
360: fi
361: rm -f $srcdir/libxml
362: (cd $srcdir/include ; ln -s .. libxml)
363: fi
364: if test ! -e $srcdir/libxml
365: then
366: (cd $srcdir ; ln -s include/libxml libxml)
367: fi
368: if test ! -e include/libxml
369: then
370: if test ! -d include
371: then
372: rm -f include
373: mkdir include
374: fi
375: (cd include ; ln -s ../libxml libxml)
376: fi
377: if test ! -e libxml
378: then
379: rm -rf libxml
380: ln -s $srcdir/include/libxml libxml
381: fi
382:
383: AC_OUTPUT(libxml.spec Makefile include/Makefile doc/Makefile example/Makefile libxml/xmlversion.h xml-config libxml-2.0.pc)
1.28 daniel 384:
Webmaster