blob: caa4d49d6e36ffa84bbf0dcebfdf616fde07015a [file] [log] [blame]
Daniel Veillard2913e4c2001-04-26 19:29:02 +00001# Configure paths for LIBXML2
2# Toshio Kuratomi 2001-04-21
3# Adapted from:
4# Configure paths for GLIB
5# Owen Taylor 97-11-3
6
7dnl AM_PATH_XML([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
8dnl Test for XML, and define XML_CFLAGS and XML_LIBS
9dnl
10AC_DEFUN(AM_PATH_XML,[
Owen Taylor3473f882001-02-23 17:55:21 +000011AC_ARG_WITH(xml-prefix,
Daniel Veillard2913e4c2001-04-26 19:29:02 +000012 [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)],
Owen Taylor3473f882001-02-23 17:55:21 +000013 xml_config_prefix="$withval", xml_config_prefix="")
Daniel Veillard2913e4c2001-04-26 19:29:02 +000014AC_ARG_WITH(xml-exec-prefix,
15 [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
16 xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
Owen Taylor3473f882001-02-23 17:55:21 +000017AC_ARG_ENABLE(xmltest,
Daniel Veillard2913e4c2001-04-26 19:29:02 +000018 [ --disable-xmltest Do not try to compile and run a test LIBXML program],,
Owen Taylor3473f882001-02-23 17:55:21 +000019 enable_xmltest=yes)
20
Daniel Veillard2913e4c2001-04-26 19:29:02 +000021 if test x$xml_config_exec_prefix != x ; then
22 xml_config_args="$xml_config_args --exec-prefix=$xml_config_exec_prefix"
23 if test x${XML_CONFIG+set} != xset ; then
24 XML_CONFIG=$xml_config_exec_prefix/bin/xml-config
25 fi
26 fi
Owen Taylor3473f882001-02-23 17:55:21 +000027 if test x$xml_config_prefix != x ; then
Daniel Veillard2913e4c2001-04-26 19:29:02 +000028 xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
29 if test x${XML_CONFIG+set} != xset ; then
30 XML_CONFIG=$xml_config_prefix/bin/xml-config
31 fi
Owen Taylor3473f882001-02-23 17:55:21 +000032 fi
33
34 AC_PATH_PROG(XML_CONFIG, xml-config, no)
Daniel Veillarddbb14a72001-04-26 20:54:01 +000035 min_xml_version=ifelse([$1], ,1.0.0,[$1])
Owen Taylor3473f882001-02-23 17:55:21 +000036 AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
37 no_xml=""
38 if test "$XML_CONFIG" = "no" ; then
39 no_xml=yes
40 else
41 XML_CFLAGS=`$XML_CONFIG $xml_config_args --cflags`
42 XML_LIBS=`$XML_CONFIG $xml_config_args --libs`
43 xml_config_major_version=`$XML_CONFIG $xml_config_args --version | \
Daniel Veillard2913e4c2001-04-26 19:29:02 +000044 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
Owen Taylor3473f882001-02-23 17:55:21 +000045 xml_config_minor_version=`$XML_CONFIG $xml_config_args --version | \
Daniel Veillard2913e4c2001-04-26 19:29:02 +000046 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
Owen Taylor3473f882001-02-23 17:55:21 +000047 xml_config_micro_version=`$XML_CONFIG $xml_config_args --version | \
Daniel Veillard2913e4c2001-04-26 19:29:02 +000048 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
Owen Taylor3473f882001-02-23 17:55:21 +000049 if test "x$enable_xmltest" = "xyes" ; then
50 ac_save_CFLAGS="$CFLAGS"
51 ac_save_LIBS="$LIBS"
52 CFLAGS="$CFLAGS $XML_CFLAGS"
53 LIBS="$XML_LIBS $LIBS"
54dnl
55dnl Now check if the installed libxml is sufficiently new.
Daniel Veillard2913e4c2001-04-26 19:29:02 +000056dnl (Also sanity checks the results of xml-config to some extent)
Owen Taylor3473f882001-02-23 17:55:21 +000057dnl
58 rm -f conf.xmltest
59 AC_TRY_RUN([
60#include <stdlib.h>
61#include <stdio.h>
Daniel Veillarddbb14a72001-04-26 20:54:01 +000062#include <libxml/tree.h>
Owen Taylor3473f882001-02-23 17:55:21 +000063
Daniel Veillard2913e4c2001-04-26 19:29:02 +000064int
Owen Taylor3473f882001-02-23 17:55:21 +000065main()
66{
67 int xml_major_version, xml_minor_version, xml_micro_version;
68 int major, minor, micro;
69 char *tmp_version;
Daniel Veillarddbb14a72001-04-26 20:54:01 +000070 int tmp_int_version;
Owen Taylor3473f882001-02-23 17:55:21 +000071
72 system("touch conf.xmltest");
73
Daniel Veillard2913e4c2001-04-26 19:29:02 +000074 /* Capture xml-config output via autoconf/configure variables */
75 /* HP/UX 9 (%@#!) writes to sscanf strings */
76 tmp_version = (char *)strdup("$min_xml_version");
77 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
78 printf("%s, bad version string from xml-config\n", "$min_xml_version");
79 exit(1);
80 }
81 free(tmp_version);
Owen Taylor3473f882001-02-23 17:55:21 +000082
Daniel Veillard2913e4c2001-04-26 19:29:02 +000083 /* Capture the version information from the header files */
Daniel Veillard70ac0e32001-08-13 11:24:16 +000084 tmp_int_version = LIBXML_VERSION;
Daniel Veillarddbb14a72001-04-26 20:54:01 +000085 xml_major_version=tmp_int_version / 10000;
86 xml_minor_version=(tmp_int_version - xml_major_version * 10000) / 100;
87 xml_micro_version=(tmp_int_version - xml_minor_version * 100 - xml_major_version * 10000);
Owen Taylor3473f882001-02-23 17:55:21 +000088
Daniel Veillard2913e4c2001-04-26 19:29:02 +000089 /* Compare xml-config output to the libxml headers */
90 if ((xml_major_version != $xml_config_major_version) ||
Daniel Veillarddbb14a72001-04-26 20:54:01 +000091 (xml_minor_version != $xml_config_minor_version)
92#if 0
93 ||
94/* The last released version of libxml-1.x has an incorrect micro version in
95 * the header file so neither the includes nor the library will match the
96 * micro_version to the output of xml-config
97 */
98 (xml_micro_version != $xml_config_micro_version)
99#endif
100 )
101
Owen Taylor3473f882001-02-23 17:55:21 +0000102 {
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000103 printf("*** libxml header files (version %d.%d.%d) do not match\n",
104 xml_major_version, xml_minor_version, xml_micro_version);
105 printf("*** xml-config (version %d.%d.%d)\n",
106 $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
107 return 1;
108 }
109/* Compare the headers to the library to make sure we match */
110 /* Less than ideal -- doesn't provide us with return value feedback,
111 * only exits if there's a serious mismatch between header and library.
112 */
113 LIBXML_TEST_VERSION;
114
115 /* Test that the library is greater than our minimum version */
Daniel Veillarddbb14a72001-04-26 20:54:01 +0000116 if (($xml_config_major_version > major) ||
117 (($xml_config_major_version == major) && ($xml_config_minor_version > minor)) ||
118 (($xml_config_major_version == major) && ($xml_config_minor_version == minor) &&
119 ($xml_config_micro_version >= micro)))
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000120 {
121 return 0;
122 }
123 else
124 {
125 printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
126 xml_major_version, xml_minor_version, xml_micro_version);
127 printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
128 major, minor, micro);
129 printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
130 printf("***\n");
131 printf("*** If you have already installed a sufficiently new version, this error\n");
132 printf("*** probably means that the wrong copy of the xml-config shell script is\n");
133 printf("*** being found. The easiest way to fix this is to remove the old version\n");
134 printf("*** of LIBXML, but you can also set the XML_CONFIG environment to point to the\n");
135 printf("*** correct copy of xml-config. (In this case, you will have to\n");
136 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
137 printf("*** so that the correct libraries are found at run-time))\n");
Owen Taylor3473f882001-02-23 17:55:21 +0000138 }
139 return 1;
140}
141],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000142 CFLAGS="$ac_save_CFLAGS"
143 LIBS="$ac_save_LIBS"
144 fi
Owen Taylor3473f882001-02-23 17:55:21 +0000145 fi
146
147 if test "x$no_xml" = x ; then
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000148 AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
149 ifelse([$2], , :, [$2])
Owen Taylor3473f882001-02-23 17:55:21 +0000150 else
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000151 AC_MSG_RESULT(no)
152 if test "$XML_CONFIG" = "no" ; then
153 echo "*** The xml-config script installed by LIBXML could not be found"
154 echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
155 echo "*** your path, or set the XML_CONFIG environment variable to the"
156 echo "*** full path to xml-config."
157 else
158 if test -f conf.xmltest ; then
Owen Taylor3473f882001-02-23 17:55:21 +0000159 :
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000160 else
161 echo "*** Could not run libxml test program, checking why..."
162 CFLAGS="$CFLAGS $XML_CFLAGS"
163 LIBS="$LIBS $XML_LIBS"
164 AC_TRY_LINK([
Daniel Veillarddbb14a72001-04-26 20:54:01 +0000165#include <libxml/tree.h>
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000166#include <stdio.h>
167], [ LIBXML_TEST_VERSION; return 0;],
168 [ echo "*** The test program compiled, but did not run. This usually means"
169 echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
170 echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
171 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
172 echo "*** to the installed location Also, make sure you have run ldconfig if that"
173 echo "*** is required on your system"
174 echo "***"
175 echo "*** If you have an old version installed, it is best to remove it, although"
176 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
177 [ echo "*** The test program failed to compile or link. See the file config.log for the"
178 echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
179 echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
180 echo "*** may want to edit the xml-config script: $XML_CONFIG" ])
181 CFLAGS="$ac_save_CFLAGS"
182 LIBS="$ac_save_LIBS"
183 fi
184 fi
Owen Taylor3473f882001-02-23 17:55:21 +0000185
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000186 XML_CFLAGS=""
187 XML_LIBS=""
188 ifelse([$3], , :, [$3])
Owen Taylor3473f882001-02-23 17:55:21 +0000189 fi
190 AC_SUBST(XML_CFLAGS)
191 AC_SUBST(XML_LIBS)
192 rm -f conf.xmltest
193])
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000194
195# Configure paths for LIBXML2
196# Toshio Kuratomi 2001-04-21
197# Adapted from:
198# Configure paths for GLIB
199# Owen Taylor 97-11-3
200
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000201dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
202dnl Test for XML, and define XML_CFLAGS and XML_LIBS
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000203dnl
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000204AC_DEFUN(AM_PATH_XML2,[
205AC_ARG_WITH(xml-prefix,
206 [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)],
207 xml_config_prefix="$withval", xml_config_prefix="")
208AC_ARG_WITH(xml-exec-prefix,
209 [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
210 xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
211AC_ARG_ENABLE(xmltest,
212 [ --disable-xmltest Do not try to compile and run a test LIBXML program],,
213 enable_xmltest=yes)
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000214
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000215 if test x$xml_config_exec_prefix != x ; then
216 xml_config_args="$xml_config_args --exec-prefix=$xml_config_exec_prefix"
217 if test x${XML2_CONFIG+set} != xset ; then
218 XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000219 fi
220 fi
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000221 if test x$xml_config_prefix != x ; then
222 xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
223 if test x${XML2_CONFIG+set} != xset ; then
224 XML2_CONFIG=$xml_config_prefix/bin/xml2-config
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000225 fi
226 fi
227
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000228 AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
229 min_xml_version=ifelse([$1], ,2.0.0,[$1])
230 AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
231 no_xml=""
232 if test "$XML2_CONFIG" = "no" ; then
233 no_xml=yes
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000234 else
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000235 XML_CFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
236 XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
237 xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000238 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000239 xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000240 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000241 xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000242 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000243 if test "x$enable_xmltest" = "xyes" ; then
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000244 ac_save_CFLAGS="$CFLAGS"
245 ac_save_LIBS="$LIBS"
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000246 CFLAGS="$CFLAGS $XML_CFLAGS"
247 LIBS="$XML_LIBS $LIBS"
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000248dnl
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000249dnl Now check if the installed libxml is sufficiently new.
250dnl (Also sanity checks the results of xml2-config to some extent)
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000251dnl
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000252 rm -f conf.xmltest
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000253 AC_TRY_RUN([
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000254#include <stdlib.h>
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000255#include <stdio.h>
256#include <xmlversion.h>
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000257
258int
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000259main()
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000260{
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000261 int xml_major_version, xml_minor_version, xml_micro_version;
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000262 int major, minor, micro;
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000263 char *tmp_version;
264
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000265 system("touch conf.xmltest");
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000266
267 /* Capture xml2-config output via autoconf/configure variables */
268 /* HP/UX 9 (%@#!) writes to sscanf strings */
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000269 tmp_version = (char *)strdup("$min_xml_version");
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000270 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000271 printf("%s, bad version string from xml2-config\n", "$min_xml_version");
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000272 exit(1);
273 }
274 free(tmp_version);
275
276 /* Capture the version information from the header files */
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000277 tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
278 if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
279 printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
280 exit(1);
281 }
282 free(tmp_version);
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000283
284 /* Compare xml2-config output to the libxml headers */
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000285 if ((xml_major_version != $xml_config_major_version) ||
286 (xml_minor_version != $xml_config_minor_version) ||
287 (xml_micro_version != $xml_config_micro_version))
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000288 {
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000289 printf("*** libxml header files (version %d.%d.%d) do not match\n",
290 xml_major_version, xml_minor_version, xml_micro_version);
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000291 printf("*** xml2-config (version %d.%d.%d)\n",
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000292 $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000293 return 1;
294 }
295/* Compare the headers to the library to make sure we match */
296 /* Less than ideal -- doesn't provide us with return value feedback,
297 * only exits if there's a serious mismatch between header and library.
298 */
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000299 LIBXML_TEST_VERSION;
300
301 /* Test that the library is greater than our minimum version */
302 if ((xml_major_version > major) ||
303 ((xml_major_version == major) && (xml_minor_version > minor)) ||
304 ((xml_major_version == major) && (xml_minor_version == minor) &&
305 (xml_micro_version >= micro)))
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000306 {
307 return 0;
308 }
309 else
310 {
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000311 printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
312 xml_major_version, xml_minor_version, xml_micro_version);
313 printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
314 major, minor, micro);
315 printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000316 printf("***\n");
317 printf("*** If you have already installed a sufficiently new version, this error\n");
318 printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
319 printf("*** being found. The easiest way to fix this is to remove the old version\n");
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000320 printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000321 printf("*** correct copy of xml2-config. (In this case, you will have to\n");
322 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
323 printf("*** so that the correct libraries are found at run-time))\n");
324 }
325 return 1;
326}
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000327],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000328 CFLAGS="$ac_save_CFLAGS"
329 LIBS="$ac_save_LIBS"
330 fi
331 fi
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000332
333 if test "x$no_xml" = x ; then
334 AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000335 ifelse([$2], , :, [$2])
336 else
337 AC_MSG_RESULT(no)
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000338 if test "$XML2_CONFIG" = "no" ; then
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000339 echo "*** The xml2-config script installed by LIBXML could not be found"
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000340 echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
341 echo "*** your path, or set the XML2_CONFIG environment variable to the"
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000342 echo "*** full path to xml2-config."
343 else
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000344 if test -f conf.xmltest ; then
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000345 :
346 else
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000347 echo "*** Could not run libxml test program, checking why..."
348 CFLAGS="$CFLAGS $XML_CFLAGS"
349 LIBS="$LIBS $XML_LIBS"
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000350 AC_TRY_LINK([
351#include <xmlversion.h>
352#include <stdio.h>
353], [ LIBXML_TEST_VERSION; return 0;],
354 [ echo "*** The test program compiled, but did not run. This usually means"
355 echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
356 echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
357 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
358 echo "*** to the installed location Also, make sure you have run ldconfig if that"
359 echo "*** is required on your system"
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000360 echo "***"
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000361 echo "*** If you have an old version installed, it is best to remove it, although"
362 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
363 [ echo "*** The test program failed to compile or link. See the file config.log for the"
364 echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
365 echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000366 echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000367 CFLAGS="$ac_save_CFLAGS"
368 LIBS="$ac_save_LIBS"
369 fi
370 fi
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000371
372 XML_CFLAGS=""
373 XML_LIBS=""
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000374 ifelse([$3], , :, [$3])
375 fi
Daniel Veillard2913e4c2001-04-26 19:29:02 +0000376 AC_SUBST(XML_CFLAGS)
377 AC_SUBST(XML_LIBS)
378 rm -f conf.xmltest
Daniel Veillard5c4ec4c2001-04-26 07:43:59 +0000379])