blob: 5b7c675a1fd0538d38beac6a13f46243c8e61eb6 [file] [log] [blame]
Daniel Veillard01791d51998-07-24 19:24:09 +00001dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.2)
Daniel Veillard260a68f1998-08-13 03:39:55 +00003AC_INIT(entities.h)
Daniel Veillard01791d51998-07-24 19:24:09 +00004AM_CONFIG_HEADER(config.h)
Daniel Veillard14fff061999-06-22 21:49:07 +00005
Daniel Veillardcf461992000-03-14 18:30:20 +00006LIBXML_MAJOR_VERSION=2
Daniel Veillard32bc74e2000-07-14 14:49:25 +00007LIBXML_MINOR_VERSION=2
Daniel Veillard87b95392000-08-12 21:12:04 +00008LIBXML_MICRO_VERSION=2
Daniel Veillard14fff061999-06-22 21:49:07 +00009LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
10LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
11
Daniel Veillard361d8452000-04-03 19:48:13 +000012LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
13
Daniel Veillard14fff061999-06-22 21:49:07 +000014AC_SUBST(LIBXML_MAJOR_VERSION)
15AC_SUBST(LIBXML_MINOR_VERSION)
16AC_SUBST(LIBXML_MICRO_VERSION)
17AC_SUBST(LIBXML_VERSION)
18AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000019AC_SUBST(LIBXML_VERSION_NUMBER)
Daniel Veillard14fff061999-06-22 21:49:07 +000020
Daniel Veillard361d8452000-04-03 19:48:13 +000021VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000022
Daniel Veillardedfb29b2000-03-14 19:59:05 +000023AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000024
25AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
Daniel Veillard01791d51998-07-24 19:24:09 +000026
27dnl Checks for programs.
28AC_PROG_CC
29AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000030AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000031AC_PATH_PROG(RM, rm, /bin/rm)
32AC_PATH_PROG(MV, mv, /bin/mv)
33AC_PATH_PROG(TAR, tar, /bin/tar)
Daniel Veillard01791d51998-07-24 19:24:09 +000034
Daniel Veillard03109292000-08-14 14:58:22 +000035dnl Make sure we have an ANSI compiler
36AM_C_PROTOTYPES
37test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
38
Daniel Veillard01791d51998-07-24 19:24:09 +000039AM_PROG_LIBTOOL
40
41AM_MAINTAINER_MODE
42
Daniel Veillard71b656e2000-01-05 14:46:17 +000043dnl Checks for zlib library.
44_cppflags="${CPPFLAGS}"
45_ldflags="${LDFLAGS}"
Daniel Veillard01791d51998-07-24 19:24:09 +000046
Daniel Veillard71b656e2000-01-05 14:46:17 +000047AC_ARG_WITH(zlib,
48[ --with-zlib[=DIR] use libz in DIR],[
Daniel Veillard03109292000-08-14 14:58:22 +000049 if test "$withval" != "no" -a "$withval" != "yes"; then
Daniel Veillard71b656e2000-01-05 14:46:17 +000050 Z_DIR=$withval
51 CPPFLAGS="${CPPFLAGS} -I$withval/include"
52 LDFLAGS="${LDFLAGS} -L$withval/lib"
53 fi
54])
55
Daniel Veillard461a66c2000-01-18 18:01:01 +000056AC_CHECK_HEADERS(zlib.h,
Daniel Veillard71b656e2000-01-05 14:46:17 +000057 AC_CHECK_LIB(z, gzread,[
58 AC_DEFINE(HAVE_LIBZ)
59 if test "x${Z_DIR}" != "x"; then
60 Z_CFLAGS="-I${Z_DIR}/include"
61 Z_LIBS="-L${Z_DIR}/lib -lz"
62 else
63 Z_LIBS="-lz"
64 fi]))
65AC_SUBST(Z_CFLAGS)
66AC_SUBST(Z_LIBS)
67
68CPPFLAGS=${_cppflags}
69LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +000070
Daniel Veillard01791d51998-07-24 19:24:09 +000071dnl Checks for header files.
72AC_HEADER_DIRENT
73AC_HEADER_STDC
74AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h)
Daniel Veillard71b656e2000-01-05 14:46:17 +000075AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h)
Daniel Veillardb05deb71999-08-10 19:04:08 +000076AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h)
Daniel Veillard7f7d1111999-09-22 09:46:25 +000077AC_CHECK_HEADERS(stdlib.h sys/socket.h netinet/in.h arpa/inet.h)
Daniel Veillard46e370e2000-07-21 20:32:03 +000078AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h sys/mman.h)
Daniel Veillard01791d51998-07-24 19:24:09 +000079
Daniel Veillard1164e751999-02-16 16:29:17 +000080dnl Specific dir for HTML output ?
81if test "x$with_html_dir" = "x" ; then
82 HTML_DIR='${datadir}/gtk-doc/html'
83else
84 HTML_DIR=$with_html_dir
85fi
86
87AC_SUBST(HTML_DIR)
88
Daniel Veillard27fb0751998-10-17 06:47:46 +000089AC_ARG_ENABLE(corba, [ --enable-corba Add Corba support (default)])
90
91dnl
92dnl Corba is enabled by default
93dnl
Daniel Veillardda4d3c41998-11-04 20:07:05 +000094if test "$enable_corba" = "no" ; then
Daniel Veillard27fb0751998-10-17 06:47:46 +000095 CORBA_CFLAGS="-DWITHOUT_CORBA"
96fi
97AC_SUBST(CORBA_CFLAGS)
98
Daniel Veillard01791d51998-07-24 19:24:09 +000099dnl Checks for library functions.
100AC_FUNC_STRFTIME
Daniel Veillardb05deb71999-08-10 19:04:08 +0000101AC_CHECK_FUNCS(strdup strndup strerror snprintf)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000102AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000103AC_CHECK_FUNCS(strftime localtime)
104
105dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000106AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
107AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
108AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000109
110dnl Checks for isnan in libm if not in libc
Daniel Veillard71b656e2000-01-05 14:46:17 +0000111AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
112 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000113
Daniel Veillard71b656e2000-01-05 14:46:17 +0000114AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf,
115 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000116
117XML_LIBDIR='-L${libdir}'
Daniel Veillard361d8452000-04-03 19:48:13 +0000118XML_INCLUDEDIR='-I${includedir}/libxml -I${includedir}'
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000119XML_LIBS="-lxml $Z_LIBS $M_LIBS $LIBS"
Daniel Veillardb05deb71999-08-10 19:04:08 +0000120
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000121dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000122dnl Extra flags
123dnl
124XML_CFLAGS=""
125
126dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000127dnl Workaround for HP native compiler
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000128dnl http://bugs.gnome.org/db/31/3163.html
129dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000130if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000131 case "${host}" in
132 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000133 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000134 ;;
135 esac
136fi
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000137
138dnl
139dnl Use buffers for content
140dnl
141
142AC_ARG_WITH(buffers, [ --with-buffers Use buffers for node content])
143if test "$with_buffers" = "yes" ; then
144 CFLAGS="${CFLAGS} -DXML_USE_BUFFER_CONTENT"
145 XML_CFLAGS="${XML_CFLAGS} -DXML_USE_BUFFER_CONTENT"
146fi
147
Daniel Veillard437b87b2000-01-03 17:30:46 +0000148dnl
149dnl Tester makes use of readline if present
150dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000151_cppflags="${CPPFLAGS}"
152_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000153
Daniel Veillard03109292000-08-14 14:58:22 +0000154AC_ARG_WITH(readline,
155[ --with-readline=DIR use readline in DIR],[
156 if test "$withval" != "no" -a "$withval" != "yes"; then
157 RDL_DIR=$withval
158 CPPFLAGS="${CPPFLAGS} -I$withval/include"
159 LDFLAGS="${LDFLAGS} -L$withval/lib"
160 fi
161])
162
163dnl check for terminal library. this is a very cool solution
164dnl from octave's configure.in
165unset tcap
166for termlib in ncurses curses termcap terminfo termlib; do
167 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
168 test -n "$tcap" && break
169done
170
171AC_CHECK_HEADER(readline/history.h,
172 AC_CHECK_LIB(history, append_history,[
173 RDL_LIBS="-lhistory"
174 AC_DEFINE(HAVE_LIBHISTORY)]))
175AC_CHECK_HEADER(readline/readline.h,
176 AC_CHECK_LIB(readline, readline,[
177 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
178 AC_DEFINE(HAVE_LIBREADLINE)], , $tcap))
179if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
180 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
181 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
182else
183 CPPFLAGS=${_cppflags}
184fi
185LDFLAGS=${_ldflags}
186
187AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +0000188
189dnl
190dnl Aloow to disable various pieces
191dnl
192
193AC_ARG_WITH(ftp, [ --with-ftp Add the FTP support (on)])
194if test "$with_ftp" = "no" ; then
195 echo Disabling FTP support
196 WITH_FTP=0
197 FTP_OBJ=
198else
199 WITH_FTP=1
200 FTP_OBJ=nanoftp.o
201fi
202AC_SUBST(WITH_FTP)
203AC_SUBST(FTP_OBJ)
204
205AC_ARG_WITH(http, [ --with-http Add the HTTP support (on)])
206if test "$with_http" = "no" ; then
207 echo Disabling HTTP support
208 WITH_HTTP=0
209 HTTP_OBJ=
210else
211 WITH_HTTP=1
212 HTTP_OBJ=nanohttp.o
213fi
214AC_SUBST(WITH_HTTP)
215AC_SUBST(HTTP_OBJ)
216
217AC_ARG_WITH(html, [ --with-html Add the HTML support (on)])
218if test "$with_html" = "no" ; then
219 echo Disabling HTML support
220 WITH_HTML=0
221 HTML_OBJ=
222else
223 WITH_HTML=1
224 HTML_OBJ="HTMLparser.o HTMLtree.o"
225fi
226AC_SUBST(WITH_HTML)
227AC_SUBST(HTML_OBJ)
228
229AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)])
230if test "$with_xpath" = "no" ; then
231 echo Disabling XPATH support
232 WITH_XPATH=0
233 XPATH_OBJ=
234else
235 WITH_XPATH=1
236 XPATH_OBJ=xpath.o
237fi
238AC_SUBST(WITH_XPATH)
239AC_SUBST(XPATH_OBJ)
240
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000241AC_ARG_WITH(iconv, [ --with-iconv Add the ICONV support (on)])
242if test "$with_iconv" = "no" ; then
243 echo Disabling ICONV support
244 WITH_ICONV=0
245else
246 if test "$have_iconv" != "" ; then
247 echo Iconv support not found
248 WITH_ICONV=0
249 else
250 WITH_ICONV=1
251 fi
252fi
253AC_SUBST(WITH_ICONV)
254
Daniel Veillard361d8452000-04-03 19:48:13 +0000255AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)])
256if test "$with_debug" = "no" ; then
257 echo Disabling DEBUG support
258 WITH_DEBUG=0
259 DEBUG_OBJ=
260else
261 WITH_DEBUG=1
262 DEBUG_OBJ=debugXML.o
263fi
264AC_SUBST(WITH_DEBUG)
265AC_SUBST(DEBUG_OBJ)
266
267AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
268if test "$with_mem_debug" = "yes" ; then
269 echo Enabling memory debug support
270 WITH_MEM_DEBUG=1
271else
272 WITH_MEM_DEBUG=0
273fi
274AC_SUBST(WITH_MEM_DEBUG)
275
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000276AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000277AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000278
Daniel Veillardb05deb71999-08-10 19:04:08 +0000279AC_SUBST(XML_LIBDIR)
280AC_SUBST(XML_LIBS)
281AC_SUBST(XML_INCLUDEDIR)
282AC_SUBST(HTML_DIR)
283AC_SUBST(HAVE_ISNAN)
284AC_SUBST(HAVE_ISINF)
285
Daniel Veillardb05deb71999-08-10 19:04:08 +0000286AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +0000287AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +0000288
289dnl
290dnl create the libxml link needed to get dependencies right
291dnl
292if test -f $srcdir/libxml
293then
294 rm -f $srcdir/libxml libxml
295 (cd $srcdir ; ln -s . libxml)
296 (ln -s . libxml)
297else
298 (cd $srcdir ; rm -f libxml ; ln -s . libxml)
299 (rm -f libxml ; ln -s . libxml)
300fi
301AC_OUTPUT(libxml.spec Makefile doc/Makefile example/Makefile xmlversion.h xml-config win32config.h)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +0000302