From dbb14a72f092e70213ae7aadbc04abacccd35aa7 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 26 Apr 2001 20:54:01 +0000 Subject: [PATCH] - parser.c: applied fixes from Christian Glahn bug report #53391 Daniel --- ChangeLog | 4 ++++ libxml.m4 | 38 +++++++++++++++++++++++--------------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 272d670f..21a14f7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Apr 26 22:53:03 CEST 2001 Daniel Veillard + + * libxml.m4: yet another patch from Toshio Kuratomi + Thu Apr 26 21:27:43 CEST 2001 Daniel Veillard * libxml.m4 libxml2-spec.in: new patches from Toshio Kuratomi diff --git a/libxml.m4 b/libxml.m4 index 67c8d0b8..1983c9b0 100644 --- a/libxml.m4 +++ b/libxml.m4 @@ -32,7 +32,7 @@ AC_ARG_ENABLE(xmltest, fi AC_PATH_PROG(XML_CONFIG, xml-config, no) - min_xml_version=ifelse([$1], ,2.0.0,[$1]) + min_xml_version=ifelse([$1], ,1.0.0,[$1]) AC_MSG_CHECKING(for libxml - version >= $min_xml_version) no_xml="" if test "$XML_CONFIG" = "no" ; then @@ -59,7 +59,7 @@ dnl AC_TRY_RUN([ #include #include -#include +#include int main() @@ -67,6 +67,7 @@ main() int xml_major_version, xml_minor_version, xml_micro_version; int major, minor, micro; char *tmp_version; + int tmp_int_version; system("touch conf.xmltest"); @@ -80,17 +81,24 @@ main() free(tmp_version); /* Capture the version information from the header files */ - tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION); - if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) { - printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION"); - exit(1); - } - free(tmp_version); + tmp_int_version = LIBXML_VERSION_NUMBER; + xml_major_version=tmp_int_version / 10000; + xml_minor_version=(tmp_int_version - xml_major_version * 10000) / 100; + xml_micro_version=(tmp_int_version - xml_minor_version * 100 - xml_major_version * 10000); /* Compare xml-config output to the libxml headers */ if ((xml_major_version != $xml_config_major_version) || - (xml_minor_version != $xml_config_minor_version) || - (xml_micro_version != $xml_config_micro_version)) + (xml_minor_version != $xml_config_minor_version) +#if 0 + || +/* The last released version of libxml-1.x has an incorrect micro version in + * the header file so neither the includes nor the library will match the + * micro_version to the output of xml-config + */ + (xml_micro_version != $xml_config_micro_version) +#endif + ) + { printf("*** libxml header files (version %d.%d.%d) do not match\n", xml_major_version, xml_minor_version, xml_micro_version); @@ -105,10 +113,10 @@ main() LIBXML_TEST_VERSION; /* Test that the library is greater than our minimum version */ - if ((xml_major_version > major) || - ((xml_major_version == major) && (xml_minor_version > minor)) || - ((xml_major_version == major) && (xml_minor_version == minor) && - (xml_micro_version >= micro))) + if (($xml_config_major_version > major) || + (($xml_config_major_version == major) && ($xml_config_minor_version > minor)) || + (($xml_config_major_version == major) && ($xml_config_minor_version == minor) && + ($xml_config_micro_version >= micro))) { return 0; } @@ -154,7 +162,7 @@ main() CFLAGS="$CFLAGS $XML_CFLAGS" LIBS="$LIBS $XML_LIBS" AC_TRY_LINK([ -#include +#include #include ], [ LIBXML_TEST_VERSION; return 0;], [ echo "*** The test program compiled, but did not run. This usually means"