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