blob: e7d326d7e5a654741ca57d11607ff76429c8988c [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001From 003c9feaae6ed5c173edcea51193e49bc94ac39a Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen.kooi@linaro.org>
3Date: Tue, 17 Jun 2014 09:53:00 +0200
4Subject: [PATCH 3/8] acinclude: use pkgconfig for libxml2 config
5
6Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Armin Kuster066be202018-07-08 14:58:53 -07007Upstream-Status: Pending
Patrick Williamsb48b7b42016-08-17 15:04:38 -05008---
9 acinclude.m4 | 63 ++++++++++++++++++++++--------------------------------------
10 1 file changed, 23 insertions(+), 40 deletions(-)
11
12diff --git a/acinclude.m4 b/acinclude.m4
13index 206fcbf..a6c0d84 100644
14--- a/acinclude.m4
15+++ b/acinclude.m4
16@@ -2530,48 +2530,31 @@ dnl
17 dnl Common setup macro for libxml
18 dnl
19 AC_DEFUN([PHP_SETUP_LIBXML], [
20-AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path,
21-[
22-
23- ac_cv_php_xml2_config_path="$PHP_LIBXML_DIR/xml2-config"
24-
25+PKG_CHECK_MODULES([LIBXML], [libxml-2.0 > 2.6.11], [
26+ PHP_EVAL_LIBLINE($LIBXML_LIBS, $1)
27+ PHP_EVAL_INCLINE($LIBXML_CFLAGS)
28+
29+ dnl Check that build works with given libs
30+ AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [
31+ PHP_TEST_BUILD(xmlInitParser,
32+ [
33+ php_cv_libxml_build_works=yes
34+ AC_MSG_RESULT(yes)
35+ ], [
36+ AC_MSG_RESULT(no)
37+ AC_MSG_ERROR([build test failed. Please check the config.log for details.])
38+ ], [
39+ [$]$1
40+ ])
41+ ])
42+ if test "$php_cv_libxml_build_works" = "yes"; then
43+ AC_DEFINE(HAVE_LIBXML, 1, [ ])
44+ fi
45+ $2
46+], [
47+ AC_MSG_ERROR([$LIBXML_PKG_ERRORS])
48 ])
49
50- if test -x "$ac_cv_php_xml2_config_path"; then
51- XML2_CONFIG="$ac_cv_php_xml2_config_path"
52- libxml_full_version=`$XML2_CONFIG --version`
53- ac_IFS=$IFS
54- IFS="."
55- set $libxml_full_version
56- IFS=$ac_IFS
57- LIBXML_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
58- if test "$LIBXML_VERSION" -ge "2006011"; then
59- LIBXML_LIBS=`$XML2_CONFIG --libs`
60- LIBXML_INCS=`$XML2_CONFIG --cflags`
61- PHP_EVAL_LIBLINE($LIBXML_LIBS, $1)
62- PHP_EVAL_INCLINE($LIBXML_INCS)
63-
64- dnl Check that build works with given libs
65- AC_CACHE_CHECK(whether libxml build works, php_cv_libxml_build_works, [
66- PHP_TEST_BUILD(xmlInitParser,
67- [
68- php_cv_libxml_build_works=yes
69- ], [
70- AC_MSG_RESULT(no)
71- AC_MSG_ERROR([build test failed. Please check the config.log for details.])
72- ], [
73- [$]$1
74- ])
75- ])
76- if test "$php_cv_libxml_build_works" = "yes"; then
77- AC_DEFINE(HAVE_LIBXML, 1, [ ])
78- fi
79- $2
80- else
81- AC_MSG_ERROR([libxml2 version 2.6.11 or greater required.])
82- fi
83-ifelse([$3],[],,[else $3])
84- fi
85 ])
86
87 dnl -------------------------------------------------------------------------
88--
891.9.3
90