diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2023-06-25 23:22:22 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-06-27 16:23:40 +0100 |
commit | 4bd6fb3488909357ba04cb52a41d3d61086efed3 (patch) | |
tree | d401667cc4cfbbd232c026584705af09cb1592b6 /meta/recipes-core/libxml/libxml2 | |
parent | 5401b2ea794509e1ac0cb64d3ffbeb4edc6626d0 (diff) | |
download | poky-4bd6fb3488909357ba04cb52a41d3d61086efed3.tar.gz |
libxml2: update 2.10.4 -> 2.11.4
Drop backports.
Drop libxml-64bit.patch
(no longer necessary).
(From OE-Core rev: 24860598ba8557ea3a145f249938ea411f1ef1d8)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/libxml/libxml2')
4 files changed, 7 insertions, 472 deletions
diff --git a/meta/recipes-core/libxml/libxml2/fix-tests.patch b/meta/recipes-core/libxml/libxml2/fix-tests.patch deleted file mode 100644 index 80678efcfe..0000000000 --- a/meta/recipes-core/libxml/libxml2/fix-tests.patch +++ /dev/null | |||
@@ -1,222 +0,0 @@ | |||
1 | Backport the following patches to fix the reader2 and runsuite test cases: | ||
2 | |||
3 | b92768cd tests: Enable "runsuite" test | ||
4 | 0ac8c15e python/tests/reader2: use absolute paths everywhere | ||
5 | b9ba5e1d python/tests/reader2: always exit(1) if a test fails | ||
6 | |||
7 | Upstream-Status: Backport | ||
8 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
9 | |||
10 | diff --git a/python/tests/reader2.py b/python/tests/reader2.py | ||
11 | index 65cecd47..6e6353b4 100755 | ||
12 | --- a/python/tests/reader2.py | ||
13 | +++ b/python/tests/reader2.py | ||
14 | @@ -6,7 +6,6 @@ | ||
15 | import sys | ||
16 | import glob | ||
17 | import os | ||
18 | -import string | ||
19 | import libxml2 | ||
20 | try: | ||
21 | import StringIO | ||
22 | @@ -20,103 +19,104 @@ libxml2.debugMemory(1) | ||
23 | |||
24 | err = "" | ||
25 | basedir = os.path.dirname(os.path.realpath(__file__)) | ||
26 | -dir_prefix = os.path.join(basedir, "../../test/valid/") | ||
27 | +dir_prefix = os.path.realpath(os.path.join(basedir, "..", "..", "test", "valid")) | ||
28 | + | ||
29 | # This dictionary reflects the contents of the files | ||
30 | # ../../test/valid/*.xml.err that are not empty, except that | ||
31 | # the file paths in the messages start with ../../test/ | ||
32 | |||
33 | expect = { | ||
34 | '766956': | ||
35 | -"""../../test/valid/dtds/766956.dtd:2: parser error : PEReference: expecting ';' | ||
36 | +"""{0}/dtds/766956.dtd:2: parser error : PEReference: expecting ';' | ||
37 | %ä%ent; | ||
38 | ^ | ||
39 | -../../test/valid/dtds/766956.dtd:2: parser error : Content error in the external subset | ||
40 | +{0}/dtds/766956.dtd:2: parser error : Content error in the external subset | ||
41 | %ä%ent; | ||
42 | ^ | ||
43 | Entity: line 1: | ||
44 | value | ||
45 | ^ | ||
46 | -""", | ||
47 | +""".format(dir_prefix), | ||
48 | '781333': | ||
49 | -"""../../test/valid/781333.xml:4: element a: validity error : Element a content does not follow the DTD, expecting ( ..., got | ||
50 | +"""{0}/781333.xml:4: element a: validity error : Element a content does not follow the DTD, expecting ( ..., got | ||
51 | <a/> | ||
52 | ^ | ||
53 | -../../test/valid/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more child | ||
54 | +{0}/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more child | ||
55 | |||
56 | ^ | ||
57 | -""", | ||
58 | +""".format(dir_prefix), | ||
59 | 'cond_sect2': | ||
60 | -"""../../test/valid/dtds/cond_sect2.dtd:15: parser error : All markup of the conditional section is not in the same entity | ||
61 | +"""{0}/dtds/cond_sect2.dtd:15: parser error : All markup of the conditional section is not in the same entity | ||
62 | %ent; | ||
63 | ^ | ||
64 | Entity: line 1: | ||
65 | ]]> | ||
66 | ^ | ||
67 | -../../test/valid/dtds/cond_sect2.dtd:17: parser error : Content error in the external subset | ||
68 | +{0}/dtds/cond_sect2.dtd:17: parser error : Content error in the external subset | ||
69 | |||
70 | ^ | ||
71 | -""", | ||
72 | +""".format(dir_prefix), | ||
73 | 'rss': | ||
74 | -"""../../test/valid/rss.xml:177: element rss: validity error : Element rss does not carry attribute version | ||
75 | +"""{0}/rss.xml:177: element rss: validity error : Element rss does not carry attribute version | ||
76 | </rss> | ||
77 | ^ | ||
78 | -""", | ||
79 | +""".format(dir_prefix), | ||
80 | 't8': | ||
81 | -"""../../test/valid/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
82 | +"""{0}/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
83 | |||
84 | %defroot; %defmiddle; %deftest; | ||
85 | ^ | ||
86 | Entity: line 1: | ||
87 | <!ELEMENT root (middle) > | ||
88 | ^ | ||
89 | -../../test/valid/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
90 | +{0}/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
91 | |||
92 | %defroot; %defmiddle; %deftest; | ||
93 | ^ | ||
94 | Entity: line 1: | ||
95 | <!ELEMENT middle (test) > | ||
96 | ^ | ||
97 | -../../test/valid/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
98 | +{0}/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
99 | |||
100 | %defroot; %defmiddle; %deftest; | ||
101 | ^ | ||
102 | Entity: line 1: | ||
103 | <!ELEMENT test (#PCDATA) > | ||
104 | ^ | ||
105 | -""", | ||
106 | +""".format(dir_prefix), | ||
107 | 't8a': | ||
108 | -"""../../test/valid/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
109 | +"""{0}/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
110 | |||
111 | %defroot;%defmiddle;%deftest; | ||
112 | ^ | ||
113 | Entity: line 1: | ||
114 | <!ELEMENT root (middle) > | ||
115 | ^ | ||
116 | -../../test/valid/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
117 | +{0}/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
118 | |||
119 | %defroot;%defmiddle;%deftest; | ||
120 | ^ | ||
121 | Entity: line 1: | ||
122 | <!ELEMENT middle (test) > | ||
123 | ^ | ||
124 | -../../test/valid/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
125 | +{0}/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration | ||
126 | |||
127 | %defroot;%defmiddle;%deftest; | ||
128 | ^ | ||
129 | Entity: line 1: | ||
130 | <!ELEMENT test (#PCDATA) > | ||
131 | ^ | ||
132 | -""", | ||
133 | +""".format(dir_prefix), | ||
134 | 'xlink': | ||
135 | -"""../../test/valid/xlink.xml:450: element termdef: validity error : ID dt-arc already defined | ||
136 | +"""{0}/xlink.xml:450: element termdef: validity error : ID dt-arc already defined | ||
137 | <p><termdef id="dt-arc" term="Arc">An <ter | ||
138 | ^ | ||
139 | validity error : attribute def line 199 references an unknown ID "dt-xlg" | ||
140 | -""", | ||
141 | +""".format(dir_prefix), | ||
142 | } | ||
143 | |||
144 | # Add prefix_dir and extension to the keys | ||
145 | -expect = {"{}{}.xml".format(dir_prefix, key): val for key, val in expect.items()} | ||
146 | +expect = {os.path.join(dir_prefix, key + ".xml"): val for key, val in expect.items()} | ||
147 | |||
148 | def callback(ctx, str): | ||
149 | global err | ||
150 | @@ -124,11 +124,12 @@ def callback(ctx, str): | ||
151 | libxml2.registerErrorHandler(callback, "") | ||
152 | |||
153 | parsing_error_files = ["766956", "cond_sect2", "t8", "t8a"] | ||
154 | -expect_parsing_error = ["{}{}.xml".format(dir_prefix, f) for f in parsing_error_files] | ||
155 | +expect_parsing_error = [os.path.join(dir_prefix, f + ".xml") for f in parsing_error_files] | ||
156 | |||
157 | -valid_files = glob.glob(dir_prefix + "*.x*") | ||
158 | +valid_files = glob.glob(os.path.join(dir_prefix, "*.x*")) | ||
159 | assert valid_files, "found no valid files in '{}'".format(dir_prefix) | ||
160 | valid_files.sort() | ||
161 | +failures = 0 | ||
162 | for file in valid_files: | ||
163 | err = "" | ||
164 | reader = libxml2.newTextReaderFilename(file) | ||
165 | @@ -142,9 +143,15 @@ for file in valid_files: | ||
166 | #sys.exit(1) | ||
167 | if (err): | ||
168 | if not(file in expect and err == expect[file]): | ||
169 | + failures += 1 | ||
170 | print("Error: ", err) | ||
171 | if file in expect: | ||
172 | print("Expected: ", expect[file]) | ||
173 | + | ||
174 | +if failures: | ||
175 | + print("Failed %d tests" % failures) | ||
176 | + sys.exit(1) | ||
177 | + | ||
178 | # | ||
179 | # another separate test based on Stephane Bidoul one | ||
180 | # | ||
181 | @@ -337,9 +344,11 @@ while reader.Read() == 1: | ||
182 | if res != expect: | ||
183 | print("test5 failed: unexpected output") | ||
184 | print(res) | ||
185 | + sys.exit(1) | ||
186 | if err != "": | ||
187 | print("test5 failed: validation error found") | ||
188 | print(err) | ||
189 | + sys.exit(1) | ||
190 | |||
191 | # | ||
192 | # cleanup | ||
193 | diff --git a/runsuite.c b/runsuite.c | ||
194 | index 483490a2..a522d24b 100644 | ||
195 | --- a/runsuite.c | ||
196 | +++ b/runsuite.c | ||
197 | @@ -1054,13 +1054,18 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { | ||
198 | old_tests = nb_tests; | ||
199 | old_leaks = nb_leaks; | ||
200 | xsdTest(); | ||
201 | - if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) | ||
202 | - printf("Ran %d tests, no errors\n", nb_tests - old_tests); | ||
203 | - else | ||
204 | - printf("Ran %d tests, %d errors, %d leaks\n", | ||
205 | - nb_tests - old_tests, | ||
206 | - nb_errors - old_errors, | ||
207 | - nb_leaks - old_leaks); | ||
208 | + printf("Ran %d tests, %d errors, %d leaks\n", | ||
209 | + nb_tests - old_tests, | ||
210 | + nb_errors - old_errors, | ||
211 | + nb_leaks - old_leaks); | ||
212 | + if (nb_errors - old_errors == 10) { | ||
213 | + printf("10 errors were expected\n"); | ||
214 | + nb_errors = old_errors; | ||
215 | + } else { | ||
216 | + printf("10 errors were expected, got %d errors\n", | ||
217 | + nb_errors - old_errors); | ||
218 | + nb_errors = old_errors + 1; | ||
219 | + } | ||
220 | old_errors = nb_errors; | ||
221 | old_tests = nb_tests; | ||
222 | old_leaks = nb_leaks; | ||
diff --git a/meta/recipes-core/libxml/libxml2/install-tests.patch b/meta/recipes-core/libxml/libxml2/install-tests.patch index b770afbeb4..14ccce5873 100644 --- a/meta/recipes-core/libxml/libxml2/install-tests.patch +++ b/meta/recipes-core/libxml/libxml2/install-tests.patch | |||
@@ -1,19 +1,19 @@ | |||
1 | From 3fc716357ce1372d9418dc86f24315b34d9808de Mon Sep 17 00:00:00 2001 | ||
2 | From: Ross Burton <ross.burton@arm.com> | ||
3 | Date: Mon, 5 Dec 2022 17:02:32 +0000 | ||
4 | Subject: [PATCH] add yocto-specific install-ptest target | ||
5 | |||
1 | Add a target to install the test suite. | 6 | Add a target to install the test suite. |
2 | 7 | ||
3 | Upstream-Status: Inappropriate | 8 | Upstream-Status: Inappropriate |
4 | Signed-off-by: Ross Burton <ross.burton@arm.com> | 9 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
5 | 10 | ||
6 | From c7809dc6947324ea506a0c2bf132ecd37156f211 Mon Sep 17 00:00:00 2001 | ||
7 | From: Ross Burton <ross.burton@arm.com> | ||
8 | Date: Mon, 5 Dec 2022 17:02:32 +0000 | ||
9 | Subject: [PATCH] add yocto-specific install-ptest target | ||
10 | |||
11 | --- | 11 | --- |
12 | Makefile.am | 10 ++++++++++ | 12 | Makefile.am | 10 ++++++++++ |
13 | 1 file changed, 10 insertions(+) | 13 | 1 file changed, 10 insertions(+) |
14 | 14 | ||
15 | diff --git a/Makefile.am b/Makefile.am | 15 | diff --git a/Makefile.am b/Makefile.am |
16 | index 316109b1..15e100be 100644 | 16 | index 5bc4018..57d27af 100644 |
17 | --- a/Makefile.am | 17 | --- a/Makefile.am |
18 | +++ b/Makefile.am | 18 | +++ b/Makefile.am |
19 | @@ -26,6 +26,16 @@ check_PROGRAMS = \ | 19 | @@ -26,6 +26,16 @@ check_PROGRAMS = \ |
@@ -32,7 +32,4 @@ index 316109b1..15e100be 100644 | |||
32 | + | 32 | + |
33 | bin_PROGRAMS = xmllint xmlcatalog | 33 | bin_PROGRAMS = xmllint xmlcatalog |
34 | 34 | ||
35 | nodist_bin_SCRIPTS = xml2-config | 35 | bin_SCRIPTS = xml2-config |
36 | -- | ||
37 | 2.34.1 | ||
38 | |||
diff --git a/meta/recipes-core/libxml/libxml2/libxml-64bit.patch b/meta/recipes-core/libxml/libxml2/libxml-64bit.patch deleted file mode 100644 index fd8e469dd3..0000000000 --- a/meta/recipes-core/libxml/libxml2/libxml-64bit.patch +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | From 056b14345b1abd76a761ab14538f1bc21302781a Mon Sep 17 00:00:00 2001 | ||
2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
3 | Date: Sat, 11 May 2019 20:26:51 +0800 | ||
4 | Subject: [PATCH] libxml 64bit | ||
5 | |||
6 | Upstream-Status: Backport [from debian: bugs.debian.org/439843] | ||
7 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
8 | --- | ||
9 | libxml.h | 3 +++ | ||
10 | 1 file changed, 3 insertions(+) | ||
11 | |||
12 | diff --git a/libxml.h b/libxml.h | ||
13 | index 64e30f7..4e80d90 100644 | ||
14 | --- a/libxml.h | ||
15 | +++ b/libxml.h | ||
16 | @@ -15,6 +15,9 @@ | ||
17 | #ifndef _LARGEFILE_SOURCE | ||
18 | #define _LARGEFILE_SOURCE | ||
19 | #endif | ||
20 | +#ifndef _LARGEFILE64_SOURCE | ||
21 | +#define _LARGEFILE64_SOURCE | ||
22 | +#endif | ||
23 | #ifndef _FILE_OFFSET_BITS | ||
24 | #define _FILE_OFFSET_BITS 64 | ||
25 | #endif | ||
26 | -- | ||
27 | 2.7.4 | ||
28 | |||
diff --git a/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch b/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch deleted file mode 100644 index 639c80bd6c..0000000000 --- a/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch +++ /dev/null | |||
@@ -1,212 +0,0 @@ | |||
1 | Change the AM_PATH_XML2 macros to use pkg-config instead of xml2-config. | ||
2 | |||
3 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/d598d8af0913b6e3d4e61ffa62397a275b669dca] | ||
4 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
5 | |||
6 | libxml.m4 | 189 ++---------------------------------------------------- | ||
7 | 1 file changed, 5 insertions(+), 184 deletions(-) | ||
8 | |||
9 | diff --git a/libxml.m4 b/libxml.m4 | ||
10 | index fc7790c..1c53585 100644 | ||
11 | --- a/libxml.m4 | ||
12 | +++ b/libxml.m4 | ||
13 | @@ -1,191 +1,12 @@ | ||
14 | -# Configure paths for LIBXML2 | ||
15 | -# Simon Josefsson 2020-02-12 | ||
16 | -# Fix autoconf 2.70+ warnings | ||
17 | -# Mike Hommey 2004-06-19 | ||
18 | -# use CPPFLAGS instead of CFLAGS | ||
19 | -# Toshio Kuratomi 2001-04-21 | ||
20 | -# Adapted from: | ||
21 | -# Configure paths for GLIB | ||
22 | -# Owen Taylor 97-11-3 | ||
23 | - | ||
24 | dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | ||
25 | dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS | ||
26 | dnl | ||
27 | -AC_DEFUN([AM_PATH_XML2],[ | ||
28 | -AC_ARG_WITH(xml-prefix, | ||
29 | - [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)], | ||
30 | - xml_config_prefix="$withval", xml_config_prefix="") | ||
31 | -AC_ARG_WITH(xml-exec-prefix, | ||
32 | - [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)], | ||
33 | - xml_config_exec_prefix="$withval", xml_config_exec_prefix="") | ||
34 | -AC_ARG_ENABLE(xmltest, | ||
35 | - [ --disable-xmltest Do not try to compile and run a test LIBXML program],, | ||
36 | - enable_xmltest=yes) | ||
37 | - | ||
38 | - if test x$xml_config_exec_prefix != x ; then | ||
39 | - xml_config_args="$xml_config_args" | ||
40 | - if test x${XML2_CONFIG+set} != xset ; then | ||
41 | - XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config | ||
42 | - fi | ||
43 | - fi | ||
44 | - if test x$xml_config_prefix != x ; then | ||
45 | - xml_config_args="$xml_config_args --prefix=$xml_config_prefix" | ||
46 | - if test x${XML2_CONFIG+set} != xset ; then | ||
47 | - XML2_CONFIG=$xml_config_prefix/bin/xml2-config | ||
48 | - fi | ||
49 | - fi | ||
50 | - | ||
51 | - AC_PATH_PROG(XML2_CONFIG, xml2-config, no) | ||
52 | - min_xml_version=ifelse([$1], ,2.0.0,[$1]) | ||
53 | - AC_MSG_CHECKING(for libxml - version >= $min_xml_version) | ||
54 | - no_xml="" | ||
55 | - if test "$XML2_CONFIG" = "no" ; then | ||
56 | - no_xml=yes | ||
57 | - else | ||
58 | - XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags` | ||
59 | - XML_LIBS=`$XML2_CONFIG $xml_config_args --libs` | ||
60 | - xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \ | ||
61 | - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | ||
62 | - xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \ | ||
63 | - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | ||
64 | - xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \ | ||
65 | - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | ||
66 | - if test "x$enable_xmltest" = "xyes" ; then | ||
67 | - ac_save_CPPFLAGS="$CPPFLAGS" | ||
68 | - ac_save_LIBS="$LIBS" | ||
69 | - CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" | ||
70 | - LIBS="$XML_LIBS $LIBS" | ||
71 | -dnl | ||
72 | -dnl Now check if the installed libxml is sufficiently new. | ||
73 | -dnl (Also sanity checks the results of xml2-config to some extent) | ||
74 | -dnl | ||
75 | - rm -f conf.xmltest | ||
76 | - AC_RUN_IFELSE( | ||
77 | - [AC_LANG_SOURCE([[ | ||
78 | -#include <stdlib.h> | ||
79 | -#include <stdio.h> | ||
80 | -#include <string.h> | ||
81 | -#include <libxml/xmlversion.h> | ||
82 | - | ||
83 | -int | ||
84 | -main() | ||
85 | -{ | ||
86 | - int xml_major_version, xml_minor_version, xml_micro_version; | ||
87 | - int major, minor, micro; | ||
88 | - char *tmp_version; | ||
89 | - | ||
90 | - system("touch conf.xmltest"); | ||
91 | - | ||
92 | - /* Capture xml2-config output via autoconf/configure variables */ | ||
93 | - /* HP/UX 9 (%@#!) writes to sscanf strings */ | ||
94 | - tmp_version = (char *)strdup("$min_xml_version"); | ||
95 | - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | ||
96 | - printf("%s, bad version string from xml2-config\n", "$min_xml_version"); | ||
97 | - exit(1); | ||
98 | - } | ||
99 | - free(tmp_version); | ||
100 | - | ||
101 | - /* Capture the version information from the header files */ | ||
102 | - tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION); | ||
103 | - if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) { | ||
104 | - printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION"); | ||
105 | - exit(1); | ||
106 | - } | ||
107 | - free(tmp_version); | ||
108 | - | ||
109 | - /* Compare xml2-config output to the libxml headers */ | ||
110 | - if ((xml_major_version != $xml_config_major_version) || | ||
111 | - (xml_minor_version != $xml_config_minor_version) || | ||
112 | - (xml_micro_version != $xml_config_micro_version)) | ||
113 | - { | ||
114 | - printf("*** libxml header files (version %d.%d.%d) do not match\n", | ||
115 | - xml_major_version, xml_minor_version, xml_micro_version); | ||
116 | - printf("*** xml2-config (version %d.%d.%d)\n", | ||
117 | - $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version); | ||
118 | - return 1; | ||
119 | - } | ||
120 | -/* Compare the headers to the library to make sure we match */ | ||
121 | - /* Less than ideal -- doesn't provide us with return value feedback, | ||
122 | - * only exits if there's a serious mismatch between header and library. | ||
123 | - */ | ||
124 | - LIBXML_TEST_VERSION; | ||
125 | - | ||
126 | - /* Test that the library is greater than our minimum version */ | ||
127 | - if ((xml_major_version > major) || | ||
128 | - ((xml_major_version == major) && (xml_minor_version > minor)) || | ||
129 | - ((xml_major_version == major) && (xml_minor_version == minor) && | ||
130 | - (xml_micro_version >= micro))) | ||
131 | - { | ||
132 | - return 0; | ||
133 | - } | ||
134 | - else | ||
135 | - { | ||
136 | - printf("\n*** An old version of libxml (%d.%d.%d) was found.\n", | ||
137 | - xml_major_version, xml_minor_version, xml_micro_version); | ||
138 | - printf("*** You need a version of libxml newer than %d.%d.%d.\n", | ||
139 | - major, minor, micro); | ||
140 | - printf("***\n"); | ||
141 | - printf("*** If you have already installed a sufficiently new version, this error\n"); | ||
142 | - printf("*** probably means that the wrong copy of the xml2-config shell script is\n"); | ||
143 | - printf("*** being found. The easiest way to fix this is to remove the old version\n"); | ||
144 | - printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n"); | ||
145 | - printf("*** correct copy of xml2-config. (In this case, you will have to\n"); | ||
146 | - printf("*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf\n"); | ||
147 | - printf("*** so that the correct libraries are found at run-time))\n"); | ||
148 | - } | ||
149 | - return 1; | ||
150 | -} | ||
151 | -]])],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | ||
152 | - CPPFLAGS="$ac_save_CPPFLAGS" | ||
153 | - LIBS="$ac_save_LIBS" | ||
154 | - fi | ||
155 | - fi | ||
156 | +AC_DEFUN([AM_PATH_XML2],[ | ||
157 | + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) | ||
158 | |||
159 | - if test "x$no_xml" = x ; then | ||
160 | - AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)) | ||
161 | - ifelse([$2], , :, [$2]) | ||
162 | - else | ||
163 | - AC_MSG_RESULT(no) | ||
164 | - if test "$XML2_CONFIG" = "no" ; then | ||
165 | - echo "*** The xml2-config script installed by LIBXML could not be found" | ||
166 | - echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in" | ||
167 | - echo "*** your path, or set the XML2_CONFIG environment variable to the" | ||
168 | - echo "*** full path to xml2-config." | ||
169 | - else | ||
170 | - if test -f conf.xmltest ; then | ||
171 | - : | ||
172 | - else | ||
173 | - echo "*** Could not run libxml test program, checking why..." | ||
174 | - CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" | ||
175 | - LIBS="$LIBS $XML_LIBS" | ||
176 | - AC_LINK_IFELSE( | ||
177 | - [AC_LANG_PROGRAM([[ | ||
178 | -#include <libxml/xmlversion.h> | ||
179 | -#include <stdio.h> | ||
180 | -]], [[ LIBXML_TEST_VERSION; return 0;]])], | ||
181 | - [ echo "*** The test program compiled, but did not run. This usually means" | ||
182 | - echo "*** that the run-time linker is not finding LIBXML or finding the wrong" | ||
183 | - echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your" | ||
184 | - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | ||
185 | - echo "*** to the installed location Also, make sure you have run ldconfig if that" | ||
186 | - echo "*** is required on your system" | ||
187 | - echo "***" | ||
188 | - echo "*** If you have an old version installed, it is best to remove it, although" | ||
189 | - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], | ||
190 | - [ echo "*** The test program failed to compile or link. See the file config.log for the" | ||
191 | - echo "*** exact error that occurred. This usually means LIBXML was incorrectly installed" | ||
192 | - echo "*** or that you have moved LIBXML since it was installed. In the latter case, you" | ||
193 | - echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ]) | ||
194 | - CPPFLAGS="$ac_save_CPPFLAGS" | ||
195 | - LIBS="$ac_save_LIBS" | ||
196 | - fi | ||
197 | - fi | ||
198 | + verdep=ifelse([$1], [], [], [">= $1"]) | ||
199 | + PKG_CHECK_MODULES(XML, [libxml-2.0 $verdep], [$2], [$3]) | ||
200 | |||
201 | - XML_CPPFLAGS="" | ||
202 | - XML_LIBS="" | ||
203 | - ifelse([$3], , :, [$3]) | ||
204 | - fi | ||
205 | + XML_CPPFLAGS=$XML_CFLAGS | ||
206 | AC_SUBST(XML_CPPFLAGS) | ||
207 | - AC_SUBST(XML_LIBS) | ||
208 | - rm -f conf.xmltest | ||
209 | ]) | ||
210 | -- | ||
211 | 2.34.1 | ||
212 | |||