blob: 914753ce60b7435c89f798bdcef8987e0870820d [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 Veillardd2ade932000-09-30 14:39:55 +00005AC_CANONICAL_HOST
Daniel Veillard14fff061999-06-22 21:49:07 +00006
Daniel Veillardcf461992000-03-14 18:30:20 +00007LIBXML_MAJOR_VERSION=2
Daniel Veillard32bc74e2000-07-14 14:49:25 +00008LIBXML_MINOR_VERSION=2
Daniel Veillard04698d92000-09-17 16:00:22 +00009LIBXML_MICRO_VERSION=3
Daniel Veillard14fff061999-06-22 21:49:07 +000010LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION
11LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
12
Daniel Veillard361d8452000-04-03 19:48:13 +000013LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
14
Daniel Veillard14fff061999-06-22 21:49:07 +000015AC_SUBST(LIBXML_MAJOR_VERSION)
16AC_SUBST(LIBXML_MINOR_VERSION)
17AC_SUBST(LIBXML_MICRO_VERSION)
18AC_SUBST(LIBXML_VERSION)
19AC_SUBST(LIBXML_VERSION_INFO)
Daniel Veillard361d8452000-04-03 19:48:13 +000020AC_SUBST(LIBXML_VERSION_NUMBER)
Daniel Veillard14fff061999-06-22 21:49:07 +000021
Daniel Veillard361d8452000-04-03 19:48:13 +000022VERSION=${LIBXML_VERSION}
Daniel Veillard14fff061999-06-22 21:49:07 +000023
Daniel Veillardedfb29b2000-03-14 19:59:05 +000024AM_INIT_AUTOMAKE(libxml2, $VERSION)
Daniel Veillard1164e751999-02-16 16:29:17 +000025
26AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ])
Daniel Veillard01791d51998-07-24 19:24:09 +000027
28dnl Checks for programs.
29AC_PROG_CC
30AC_PROG_INSTALL
Sebastian Wilhelmia44c8a41998-08-07 08:38:58 +000031AC_PROG_CPP
Daniel Veillard01791d51998-07-24 19:24:09 +000032AC_PATH_PROG(RM, rm, /bin/rm)
33AC_PATH_PROG(MV, mv, /bin/mv)
34AC_PATH_PROG(TAR, tar, /bin/tar)
Daniel Veillard01791d51998-07-24 19:24:09 +000035
Daniel Veillard03109292000-08-14 14:58:22 +000036dnl Make sure we have an ANSI compiler
37AM_C_PROTOTYPES
38test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
39
Daniel Veillard01791d51998-07-24 19:24:09 +000040AM_PROG_LIBTOOL
41
42AM_MAINTAINER_MODE
43
Daniel Veillard71b656e2000-01-05 14:46:17 +000044dnl Checks for zlib library.
45_cppflags="${CPPFLAGS}"
46_ldflags="${LDFLAGS}"
Daniel Veillard01791d51998-07-24 19:24:09 +000047
Daniel Veillard71b656e2000-01-05 14:46:17 +000048AC_ARG_WITH(zlib,
49[ --with-zlib[=DIR] use libz in DIR],[
Daniel Veillard03109292000-08-14 14:58:22 +000050 if test "$withval" != "no" -a "$withval" != "yes"; then
Daniel Veillard71b656e2000-01-05 14:46:17 +000051 Z_DIR=$withval
52 CPPFLAGS="${CPPFLAGS} -I$withval/include"
53 LDFLAGS="${LDFLAGS} -L$withval/lib"
54 fi
55])
56
Daniel Veillard461a66c2000-01-18 18:01:01 +000057AC_CHECK_HEADERS(zlib.h,
Daniel Veillard71b656e2000-01-05 14:46:17 +000058 AC_CHECK_LIB(z, gzread,[
59 AC_DEFINE(HAVE_LIBZ)
60 if test "x${Z_DIR}" != "x"; then
61 Z_CFLAGS="-I${Z_DIR}/include"
62 Z_LIBS="-L${Z_DIR}/lib -lz"
63 else
64 Z_LIBS="-lz"
65 fi]))
66AC_SUBST(Z_CFLAGS)
67AC_SUBST(Z_LIBS)
68
69CPPFLAGS=${_cppflags}
70LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +000071
Daniel Veillard01791d51998-07-24 19:24:09 +000072dnl Checks for header files.
73AC_HEADER_DIRENT
74AC_HEADER_STDC
75AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h)
Daniel Veillard71b656e2000-01-05 14:46:17 +000076AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h)
Daniel Veillardb05deb71999-08-10 19:04:08 +000077AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h)
Daniel Veillard7f7d1111999-09-22 09:46:25 +000078AC_CHECK_HEADERS(stdlib.h sys/socket.h netinet/in.h arpa/inet.h)
Daniel Veillard46e370e2000-07-21 20:32:03 +000079AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h sys/mman.h)
Daniel Veillard01791d51998-07-24 19:24:09 +000080
Daniel Veillard1164e751999-02-16 16:29:17 +000081dnl Specific dir for HTML output ?
82if test "x$with_html_dir" = "x" ; then
83 HTML_DIR='${datadir}/gtk-doc/html'
84else
85 HTML_DIR=$with_html_dir
86fi
87
88AC_SUBST(HTML_DIR)
89
Daniel Veillard27fb0751998-10-17 06:47:46 +000090AC_ARG_ENABLE(corba, [ --enable-corba Add Corba support (default)])
91
92dnl
93dnl Corba is enabled by default
94dnl
Daniel Veillardda4d3c41998-11-04 20:07:05 +000095if test "$enable_corba" = "no" ; then
Daniel Veillard27fb0751998-10-17 06:47:46 +000096 CORBA_CFLAGS="-DWITHOUT_CORBA"
97fi
98AC_SUBST(CORBA_CFLAGS)
99
Daniel Veillard01791d51998-07-24 19:24:09 +0000100dnl Checks for library functions.
101AC_FUNC_STRFTIME
Daniel Veillardb05deb71999-08-10 19:04:08 +0000102AC_CHECK_FUNCS(strdup strndup strerror snprintf)
Daniel Veillard71b656e2000-01-05 14:46:17 +0000103AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000104AC_CHECK_FUNCS(strftime localtime)
105
106dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000107AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
108AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
109AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000110
111dnl Checks for isnan in libm if not in libc
Daniel Veillard71b656e2000-01-05 14:46:17 +0000112AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
113 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000114
Daniel Veillard71b656e2000-01-05 14:46:17 +0000115AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf,
116 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000117
118XML_LIBDIR='-L${libdir}'
Daniel Veillard361d8452000-04-03 19:48:13 +0000119XML_INCLUDEDIR='-I${includedir}/libxml -I${includedir}'
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000120XML_LIBS="-lxml $Z_LIBS $M_LIBS $LIBS"
Daniel Veillardb05deb71999-08-10 19:04:08 +0000121
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000122dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000123dnl Extra flags
124dnl
125XML_CFLAGS=""
126
127dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000128dnl Workaround for HP native compiler
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000129dnl http://bugs.gnome.org/db/31/3163.html
130dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000131if test "${GCC}" != "yes" ; then
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000132 case "${host}" in
133 *-*-hpux* )
Daniel Veillard03109292000-08-14 14:58:22 +0000134 CFLAGS="${CFLAGS} -Wp,-H30000"
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000135 ;;
136 esac
137fi
Daniel Veillardd2ade932000-09-30 14:39:55 +0000138case $host in
139*-*-solaris*)
140 XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
141 ;;
142esac
143
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000144
145dnl
146dnl Use buffers for content
147dnl
148
149AC_ARG_WITH(buffers, [ --with-buffers Use buffers for node content])
150if test "$with_buffers" = "yes" ; then
151 CFLAGS="${CFLAGS} -DXML_USE_BUFFER_CONTENT"
152 XML_CFLAGS="${XML_CFLAGS} -DXML_USE_BUFFER_CONTENT"
153fi
154
Daniel Veillard437b87b2000-01-03 17:30:46 +0000155dnl
156dnl Tester makes use of readline if present
157dnl
Daniel Veillard03109292000-08-14 14:58:22 +0000158_cppflags="${CPPFLAGS}"
159_ldflags="${LDFLAGS}"
Daniel Veillard437b87b2000-01-03 17:30:46 +0000160
Daniel Veillard03109292000-08-14 14:58:22 +0000161AC_ARG_WITH(readline,
162[ --with-readline=DIR use readline in DIR],[
163 if test "$withval" != "no" -a "$withval" != "yes"; then
164 RDL_DIR=$withval
165 CPPFLAGS="${CPPFLAGS} -I$withval/include"
166 LDFLAGS="${LDFLAGS} -L$withval/lib"
167 fi
168])
169
170dnl check for terminal library. this is a very cool solution
171dnl from octave's configure.in
172unset tcap
173for termlib in ncurses curses termcap terminfo termlib; do
174 AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
175 test -n "$tcap" && break
176done
177
178AC_CHECK_HEADER(readline/history.h,
179 AC_CHECK_LIB(history, append_history,[
180 RDL_LIBS="-lhistory"
181 AC_DEFINE(HAVE_LIBHISTORY)]))
182AC_CHECK_HEADER(readline/readline.h,
183 AC_CHECK_LIB(readline, readline,[
184 RDL_LIBS="-lreadline $RDL_LIBS $tcap"
185 AC_DEFINE(HAVE_LIBREADLINE)], , $tcap))
186if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then
187 CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include"
188 RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS"
189else
190 CPPFLAGS=${_cppflags}
191fi
192LDFLAGS=${_ldflags}
193
194AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +0000195
196dnl
197dnl Aloow to disable various pieces
198dnl
199
200AC_ARG_WITH(ftp, [ --with-ftp Add the FTP support (on)])
201if test "$with_ftp" = "no" ; then
202 echo Disabling FTP support
203 WITH_FTP=0
204 FTP_OBJ=
205else
206 WITH_FTP=1
207 FTP_OBJ=nanoftp.o
208fi
209AC_SUBST(WITH_FTP)
210AC_SUBST(FTP_OBJ)
211
212AC_ARG_WITH(http, [ --with-http Add the HTTP support (on)])
213if test "$with_http" = "no" ; then
214 echo Disabling HTTP support
215 WITH_HTTP=0
216 HTTP_OBJ=
217else
218 WITH_HTTP=1
219 HTTP_OBJ=nanohttp.o
220fi
221AC_SUBST(WITH_HTTP)
222AC_SUBST(HTTP_OBJ)
223
224AC_ARG_WITH(html, [ --with-html Add the HTML support (on)])
225if test "$with_html" = "no" ; then
226 echo Disabling HTML support
227 WITH_HTML=0
228 HTML_OBJ=
229else
230 WITH_HTML=1
231 HTML_OBJ="HTMLparser.o HTMLtree.o"
232fi
233AC_SUBST(WITH_HTML)
234AC_SUBST(HTML_OBJ)
235
236AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)])
237if test "$with_xpath" = "no" ; then
238 echo Disabling XPATH support
239 WITH_XPATH=0
240 XPATH_OBJ=
241else
242 WITH_XPATH=1
243 XPATH_OBJ=xpath.o
244fi
245AC_SUBST(WITH_XPATH)
246AC_SUBST(XPATH_OBJ)
247
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000248AC_ARG_WITH(iconv, [ --with-iconv Add the ICONV support (on)])
249if test "$with_iconv" = "no" ; then
250 echo Disabling ICONV support
251 WITH_ICONV=0
252else
Daniel Veillard04698d92000-09-17 16:00:22 +0000253 AC_CHECK_FUNCS(iconv)
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000254 if test "$have_iconv" != "" ; then
255 echo Iconv support not found
256 WITH_ICONV=0
257 else
258 WITH_ICONV=1
259 fi
260fi
261AC_SUBST(WITH_ICONV)
262
Daniel Veillard361d8452000-04-03 19:48:13 +0000263AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)])
264if test "$with_debug" = "no" ; then
265 echo Disabling DEBUG support
266 WITH_DEBUG=0
267 DEBUG_OBJ=
268else
269 WITH_DEBUG=1
270 DEBUG_OBJ=debugXML.o
271fi
272AC_SUBST(WITH_DEBUG)
273AC_SUBST(DEBUG_OBJ)
274
275AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
276if test "$with_mem_debug" = "yes" ; then
277 echo Enabling memory debug support
278 WITH_MEM_DEBUG=1
279else
280 WITH_MEM_DEBUG=0
281fi
282AC_SUBST(WITH_MEM_DEBUG)
283
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000284AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000285AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000286
Daniel Veillardb05deb71999-08-10 19:04:08 +0000287AC_SUBST(XML_LIBDIR)
288AC_SUBST(XML_LIBS)
289AC_SUBST(XML_INCLUDEDIR)
290AC_SUBST(HTML_DIR)
291AC_SUBST(HAVE_ISNAN)
292AC_SUBST(HAVE_ISINF)
293
Daniel Veillardb05deb71999-08-10 19:04:08 +0000294AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +0000295AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +0000296
297dnl
298dnl create the libxml link needed to get dependencies right
299dnl
300if test -f $srcdir/libxml
301then
302 rm -f $srcdir/libxml libxml
303 (cd $srcdir ; ln -s . libxml)
304 (ln -s . libxml)
305else
306 (cd $srcdir ; rm -f libxml ; ln -s . libxml)
307 (rm -f libxml ; ln -s . libxml)
308fi
Martin Bauligdd7d1f62000-09-29 23:17:57 +0000309AC_OUTPUT(libxml.spec Makefile doc/Makefile example/Makefile xmlversion.h xml-config win32config.h libxml-2.0.pc)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +0000310