source: trunk/third/libxml/configure.in @ 17097

Revision 17097, 4.5 KB checked in by ghudson, 23 years ago (diff)
Merge with libxml 1.8.17.
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.2)
3AC_INIT(entities.h)
4AM_CONFIG_HEADER(config.h)
5
6LIBXML_MAJOR_VERSION=1
7LIBXML_MINOR_VERSION=8
8LIBXML_MICRO_VERSION=17
9LIBXML_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
12AC_SUBST(LIBXML_MAJOR_VERSION)
13AC_SUBST(LIBXML_MINOR_VERSION)
14AC_SUBST(LIBXML_MICRO_VERSION)
15AC_SUBST(LIBXML_VERSION)
16AC_SUBST(LIBXML_VERSION_INFO)
17
18VERSION=$LIBXML_VERSION
19
20AM_INIT_AUTOMAKE(libxml, $VERSION)
21
22AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
23
24dnl Checks for programs.
25AC_PROG_CC
26AC_PROG_INSTALL
27AC_PROG_CPP
28AC_PATH_PROG(RM, rm, /bin/rm)
29AC_PATH_PROG(MV, mv, /bin/mv)
30AC_PATH_PROG(TAR, tar, /bin/tar)
31
32AM_PROG_LIBTOOL
33
34AM_MAINTAINER_MODE
35
36dnl Checks for zlib library.
37_cppflags="${CPPFLAGS}"
38_ldflags="${LDFLAGS}"
39
40AC_ARG_WITH(zlib,
41[  --with-zlib[=DIR]       use libz in DIR],[
42  if test "$withval" != "no"; then
43    Z_DIR=$withval
44    CPPFLAGS="${CPPFLAGS} -I$withval/include"
45    LDFLAGS="${LDFLAGS} -L$withval/lib"
46  fi
47])
48
49AC_CHECK_HEADERS(zlib.h,
50    AC_CHECK_LIB(z, gzread,[
51        AC_DEFINE(HAVE_LIBZ)
52        if test "x${Z_DIR}" != "x"; then
53            Z_CFLAGS="-I${Z_DIR}/include"
54            Z_LIBS="-L${Z_DIR}/lib -lz"
55        else
56            Z_LIBS="-lz"
57        fi]))
58AC_SUBST(Z_CFLAGS)
59AC_SUBST(Z_LIBS)
60
61CPPFLAGS=${_cppflags}
62LDFLAGS=${_ldflags}
63
64dnl Checks for header files.
65AC_HEADER_DIRENT
66AC_HEADER_STDC
67AC_CHECK_HEADERS(fcntl.h unistd.h ctype.h dirent.h errno.h malloc.h)
68AC_CHECK_HEADERS(stdarg.h sys/stat.h sys/types.h time.h)
69AC_CHECK_HEADERS(ieeefp.h nan.h math.h fp_class.h float.h)
70AC_CHECK_HEADERS(stdlib.h sys/socket.h netinet/in.h arpa/inet.h)
71AC_CHECK_HEADERS(netdb.h sys/time.h sys/select.h)
72
73dnl Specific dir for HTML output ?
74if test "x$with_html_dir" = "x" ; then
75  HTML_DIR='${datadir}/gtk-doc/html'
76else
77  HTML_DIR=$with_html_dir
78fi
79
80AC_SUBST(HTML_DIR)
81
82AC_ARG_ENABLE(corba,    [  --enable-corba           Add Corba support (default)])
83
84dnl
85dnl Corba is enabled by default
86dnl
87if test "$enable_corba" = "no" ; then
88   CORBA_CFLAGS="-DWITHOUT_CORBA"
89fi
90AC_SUBST(CORBA_CFLAGS)
91
92dnl Checks for library functions.
93AC_FUNC_STRFTIME
94AC_CHECK_FUNCS(strdup strndup strerror snprintf)
95AC_CHECK_FUNCS(finite isnand fp_class class fpclass)
96AC_CHECK_FUNCS(strftime localtime)
97
98dnl Checks for inet libraries:
99AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
100AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
101AC_CHECK_FUNC(connect, , AC_CHECK_LIB(inet, connect))
102
103dnl Checks for isnan in libm if not in libc
104AC_CHECK_FUNC(isnan, , AC_CHECK_LIB(m, isnan,
105  [M_LIBS="-lm"; AC_DEFINE(HAVE_ISNAN)]))
106
107AC_CHECK_FUNC(isinf, , AC_CHECK_LIB(m, isinf,
108  [M_LIBS="-lm"; AC_DEFINE(HAVE_ISINF)]))
109
110XML_LIBDIR='-L${libdir}'
111XML_INCLUDEDIR='-I${includedir}/gnome-xml'
112XML_LIBS="-lxml $Z_LIBS $M_LIBS $LIBS"
113
114AC_CANONICAL_HOST
115
116case $host in
117*-*-solaris*)
118        XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
119        ;;
120esac
121
122dnl
123dnl Extra flags
124dnl
125XML_CFLAGS=""
126
127dnl
128dnl Workaround wor HP native compiler
129dnl http://bugs.gnome.org/db/31/3163.html
130dnl DEC : Enable NaN/Inf
131dnl
132if test "${GCC}" != "yes" ; then
133    case "${host}" in
134          *-*-hpux* )
135               CFLAGS="${CFLAGS} -Wp,-H30000"
136               ;;
137          *-dec-osf* )
138               CFLAGS="${CFLAGS} -ieee"
139               ;;
140    esac
141else
142    CFLAGS="${CFLAGS} -Wall"
143    case "${host}" in
144          alpha*-*-linux* )
145               CFLAGS="${CFLAGS} -mieee"
146               ;;
147    esac
148fi
149case ${host} in
150    *-*-solaris*)
151        XML_LIBDIR="${XML_LIBDIR} -R${libdir}"
152        ;;
153esac
154
155
156dnl
157dnl Use buffers for content
158dnl
159
160AC_ARG_WITH(buffers, [  --with-buffers          Use buffers for node content])
161if test "$with_buffers" = "yes" ; then
162    CFLAGS="${CFLAGS} -DXML_USE_BUFFER_CONTENT"
163    XML_CFLAGS="${XML_CFLAGS}  -DXML_USE_BUFFER_CONTENT"
164fi
165
166dnl
167dnl Tester makes use of readline if present
168dnl
169RDL_LIBS=""
170AC_CHECK_LIB(history, append_history,
171             RDL_LIBS="-lhistory"; AC_DEFINE(HAVE_LIBHISTORY))
172AC_CHECK_LIB(termcap,main,TERMCAP_LIBS="-ltermcap")
173AC_CHECK_LIB(readline, readline,
174             RDL_LIBS="-lreadline ${RDL_LIBS} ${TERMCAP_LIBS}";
175             AC_DEFINE(HAVE_LIBREADLINE),,$TERMCAP_LIBS)
176
177AC_SUBST(CFLAGS)
178AC_SUBST(XML_CFLAGS)
179
180AC_SUBST(XML_LIBDIR)
181AC_SUBST(XML_LIBS)
182AC_SUBST(XML_INCLUDEDIR)
183AC_SUBST(HTML_DIR)
184AC_SUBST(HAVE_ISNAN)
185AC_SUBST(HAVE_ISINF)
186
187AC_SUBST(M_LIBS)
188AC_SUBST(RDL_LIBS)
189AC_OUTPUT(libxml.spec Makefile doc/Makefile example/Makefile xml-config win32config.h libxml.pc)
190
Note: See TracBrowser for help on using the repository browser.