blob: 7c253234a3e17d9fd761b1ab41b342fdf063dfed [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 Veillard496a1cf2000-05-03 14:20:55 +00007LIBXML_MINOR_VERSION=1
Daniel Veillard3f6f7f62000-06-30 17:58:25 +00008LIBXML_MICRO_VERSION=1
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
35AM_PROG_LIBTOOL
36
37AM_MAINTAINER_MODE
38
Daniel Veillard71b656e2000-01-05 14:46:17 +000039dnl Checks for zlib library.
40_cppflags="${CPPFLAGS}"
41_ldflags="${LDFLAGS}"
Daniel Veillard01791d51998-07-24 19:24:09 +000042
Daniel Veillard71b656e2000-01-05 14:46:17 +000043AC_ARG_WITH(zlib,
44[ --with-zlib[=DIR] use libz in DIR],[
45 if test "$withval" != "no"; then
46 Z_DIR=$withval
47 CPPFLAGS="${CPPFLAGS} -I$withval/include"
48 LDFLAGS="${LDFLAGS} -L$withval/lib"
49 fi
50])
51
Daniel Veillard461a66c2000-01-18 18:01:01 +000052AC_CHECK_HEADERS(zlib.h,
Daniel Veillard71b656e2000-01-05 14:46:17 +000053 AC_CHECK_LIB(z, gzread,[
54 AC_DEFINE(HAVE_LIBZ)
55 if test "x${Z_DIR}" != "x"; then
56 Z_CFLAGS="-I${Z_DIR}/include"
57 Z_LIBS="-L${Z_DIR}/lib -lz"
58 else
59 Z_LIBS="-lz"
60 fi]))
61AC_SUBST(Z_CFLAGS)
62AC_SUBST(Z_LIBS)
63
64CPPFLAGS=${_cppflags}
65LDFLAGS=${_ldflags}
Daniel Veillardb05deb71999-08-10 19:04:08 +000066
Daniel Veillard01791d51998-07-24 19:24:09 +000067dnl Checks for header files.
68AC_HEADER_DIRENT
69AC_HEADER_STDC
70AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h)
Daniel Veillard71b656e2000-01-05 14:46:17 +000071AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h)
Daniel Veillardb05deb71999-08-10 19:04:08 +000072AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h)
Daniel Veillard7f7d1111999-09-22 09:46:25 +000073AC_CHECK_HEADERS(stdlib.h sys/socket.h netinet/in.h arpa/inet.h)
74AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h)
Daniel Veillard01791d51998-07-24 19:24:09 +000075
Daniel Veillard1164e751999-02-16 16:29:17 +000076dnl Specific dir for HTML output ?
77if test "x$with_html_dir" = "x" ; then
78 HTML_DIR='${datadir}/gtk-doc/html'
79else
80 HTML_DIR=$with_html_dir
81fi
82
83AC_SUBST(HTML_DIR)
84
Daniel Veillard27fb0751998-10-17 06:47:46 +000085AC_ARG_ENABLE(corba, [ --enable-corba Add Corba support (default)])
86
87dnl
88dnl Corba is enabled by default
89dnl
Daniel Veillardda4d3c41998-11-04 20:07:05 +000090if test "$enable_corba" = "no" ; then
Daniel Veillard27fb0751998-10-17 06:47:46 +000091 CORBA_CFLAGS="-DWITHOUT_CORBA"
92fi
93AC_SUBST(CORBA_CFLAGS)
94
Daniel Veillard01791d51998-07-24 19:24:09 +000095dnl Checks for library functions.
96AC_FUNC_STRFTIME
Daniel Veillardb05deb71999-08-10 19:04:08 +000097AC_CHECK_FUNCS(strdup strndup strerror snprintf)
Daniel Veillard71b656e2000-01-05 14:46:17 +000098AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
Daniel Veillard7f7d1111999-09-22 09:46:25 +000099AC_CHECK_FUNCS(strftime localtime)
100
101dnl Checks for inet libraries:
Daniel Veillard71b656e2000-01-05 14:46:17 +0000102AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
103AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
104AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000105
106dnl Checks for isnan in libm if not in libc
Daniel Veillard71b656e2000-01-05 14:46:17 +0000107AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
108 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000109
Daniel Veillard71b656e2000-01-05 14:46:17 +0000110AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf,
111 [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)]))
Daniel Veillardb05deb71999-08-10 19:04:08 +0000112
113XML_LIBDIR='-L${libdir}'
Daniel Veillard361d8452000-04-03 19:48:13 +0000114XML_INCLUDEDIR='-I${includedir}/libxml -I${includedir}'
Daniel Veillard7f7d1111999-09-22 09:46:25 +0000115XML_LIBS="-lxml $Z_LIBS $M_LIBS $LIBS"
Daniel Veillardb05deb71999-08-10 19:04:08 +0000116
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000117dnl
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000118dnl Extra flags
119dnl
120XML_CFLAGS=""
121
122dnl
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000123dnl Workaround wor HP native compiler
124dnl http://bugs.gnome.org/db/31/3163.html
125dnl
126if test "${CC}" != "gcc" ; then
127 case "${host}" in
128 *-*-hpux* )
129 CFLAGS="${CFLAGS} -Wp,-H16800 -Ae"
130 ;;
131 esac
132fi
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000133
134dnl
135dnl Use buffers for content
136dnl
137
138AC_ARG_WITH(buffers, [ --with-buffers Use buffers for node content])
139if test "$with_buffers" = "yes" ; then
140 CFLAGS="${CFLAGS} -DXML_USE_BUFFER_CONTENT"
141 XML_CFLAGS="${XML_CFLAGS} -DXML_USE_BUFFER_CONTENT"
142fi
143
Daniel Veillard437b87b2000-01-03 17:30:46 +0000144dnl
145dnl Tester makes use of readline if present
146dnl
147RDL_LIBS=""
148AC_CHECK_LIB(history, append_history,
149 RDL_LIBS="-lhistory"; AC_DEFINE(HAVE_LIBHISTORY))
150AC_CHECK_LIB(readline, readline,
151 RDL_LIBS="-lreadline ${RDL_LIBS}"; AC_DEFINE(HAVE_LIBREADLINE))
152
Daniel Veillard361d8452000-04-03 19:48:13 +0000153
154dnl
155dnl Aloow to disable various pieces
156dnl
157
158AC_ARG_WITH(ftp, [ --with-ftp Add the FTP support (on)])
159if test "$with_ftp" = "no" ; then
160 echo Disabling FTP support
161 WITH_FTP=0
162 FTP_OBJ=
163else
164 WITH_FTP=1
165 FTP_OBJ=nanoftp.o
166fi
167AC_SUBST(WITH_FTP)
168AC_SUBST(FTP_OBJ)
169
170AC_ARG_WITH(http, [ --with-http Add the HTTP support (on)])
171if test "$with_http" = "no" ; then
172 echo Disabling HTTP support
173 WITH_HTTP=0
174 HTTP_OBJ=
175else
176 WITH_HTTP=1
177 HTTP_OBJ=nanohttp.o
178fi
179AC_SUBST(WITH_HTTP)
180AC_SUBST(HTTP_OBJ)
181
182AC_ARG_WITH(html, [ --with-html Add the HTML support (on)])
183if test "$with_html" = "no" ; then
184 echo Disabling HTML support
185 WITH_HTML=0
186 HTML_OBJ=
187else
188 WITH_HTML=1
189 HTML_OBJ="HTMLparser.o HTMLtree.o"
190fi
191AC_SUBST(WITH_HTML)
192AC_SUBST(HTML_OBJ)
193
194AC_ARG_WITH(xpath, [ --with-xpath Add the XPATH support (on)])
195if test "$with_xpath" = "no" ; then
196 echo Disabling XPATH support
197 WITH_XPATH=0
198 XPATH_OBJ=
199else
200 WITH_XPATH=1
201 XPATH_OBJ=xpath.o
202fi
203AC_SUBST(WITH_XPATH)
204AC_SUBST(XPATH_OBJ)
205
Daniel Veillard496a1cf2000-05-03 14:20:55 +0000206AC_ARG_WITH(iconv, [ --with-iconv Add the ICONV support (on)])
207if test "$with_iconv" = "no" ; then
208 echo Disabling ICONV support
209 WITH_ICONV=0
210else
211 if test "$have_iconv" != "" ; then
212 echo Iconv support not found
213 WITH_ICONV=0
214 else
215 WITH_ICONV=1
216 fi
217fi
218AC_SUBST(WITH_ICONV)
219
Daniel Veillard361d8452000-04-03 19:48:13 +0000220AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)])
221if test "$with_debug" = "no" ; then
222 echo Disabling DEBUG support
223 WITH_DEBUG=0
224 DEBUG_OBJ=
225else
226 WITH_DEBUG=1
227 DEBUG_OBJ=debugXML.o
228fi
229AC_SUBST(WITH_DEBUG)
230AC_SUBST(DEBUG_OBJ)
231
232AC_ARG_WITH(mem_debug, [ --with-mem-debug Add the memory debugging module (off)])
233if test "$with_mem_debug" = "yes" ; then
234 echo Enabling memory debug support
235 WITH_MEM_DEBUG=1
236else
237 WITH_MEM_DEBUG=0
238fi
239AC_SUBST(WITH_MEM_DEBUG)
240
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000241AC_SUBST(CFLAGS)
Daniel Veillardf5c2c871999-12-01 09:51:45 +0000242AC_SUBST(XML_CFLAGS)
Daniel Veillardd7e200c1999-11-15 17:53:11 +0000243
Daniel Veillardb05deb71999-08-10 19:04:08 +0000244AC_SUBST(XML_LIBDIR)
245AC_SUBST(XML_LIBS)
246AC_SUBST(XML_INCLUDEDIR)
247AC_SUBST(HTML_DIR)
248AC_SUBST(HAVE_ISNAN)
249AC_SUBST(HAVE_ISINF)
250
Daniel Veillardb05deb71999-08-10 19:04:08 +0000251AC_SUBST(M_LIBS)
Daniel Veillard437b87b2000-01-03 17:30:46 +0000252AC_SUBST(RDL_LIBS)
Daniel Veillard361d8452000-04-03 19:48:13 +0000253
254dnl
255dnl create the libxml link needed to get dependencies right
256dnl
257if test -f $srcdir/libxml
258then
259 rm -f $srcdir/libxml libxml
260 (cd $srcdir ; ln -s . libxml)
261 (ln -s . libxml)
262else
263 (cd $srcdir ; rm -f libxml ; ln -s . libxml)
264 (rm -f libxml ; ln -s . libxml)
265fi
266AC_OUTPUT(libxml.spec Makefile doc/Makefile example/Makefile xmlversion.h xml-config win32config.h)
Arturo Espinosa15fe6e71998-09-07 17:27:57 +0000267