[postgis-tickets] [SCM] PostGIS branch master updated. 8033b2844f14708e84ea9ae29e3129a03e457bd0

git at osgeo.org git at osgeo.org
Fri Jan 24 07:37:53 PST 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  8033b2844f14708e84ea9ae29e3129a03e457bd0 (commit)
      from  8ebafdd358205de4d5392a469f2f39744ed02618 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8033b2844f14708e84ea9ae29e3129a03e457bd0
Author: Raúl Marín <git at rmr.ninja>
Date:   Fri Jan 24 16:24:40 2020 +0100

    Support pkg-config for libxml2
    
    Patch by Bas Couwenberg
    References #4626

diff --git a/NEWS b/NEWS
index 3009eab..b4539b9 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,7 @@ PostGIS 3.1.0
   - #4473, Silence yacc warnings (Raúl Marín)
   - #4589, Disable C asserts when building without "--enable-debug" (Raúl Marín)
   - #4543, Introduce ryu to print doubles (Raúl Marín)
+  - #4626, Support pkg-config for libxml2 (Bas Couwenberg)
 
 * Bug fixes *
   - #4544, Fix leak when parsing a WKT geometry_list (Raúl Marín)
diff --git a/configure.ac b/configure.ac
index 9f0813a..2ba040f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -313,6 +313,16 @@ fi
 AC_SUBST([MATHML2_DTD])
 
 dnl ===========================================================================
+dnl Detect if pkg-config installed
+dnl ===========================================================================
+# check for pkg-config
+PKG_PROG_PKG_CONFIG
+if test -z "$PKG_CONFIG"; then
+   AC_MSG_WARN([Cannot find pkg-config, make sure it is installed in your PATH])
+fi
+
+
+dnl ===========================================================================
 dnl Detect CUnit if it is installed (used for unit testing)
 dnl
 dnl Note that we pass any specified CPPFLAGS and LDFLAGS into the Makefile
@@ -589,13 +599,31 @@ AC_ARG_WITH([xml2config],
 	[AS_HELP_STRING([--with-xml2config=FILE], [specify an alternative xml2-config file])],
 	[XML2CONFIG="$withval"], [XML2CONFIG=""])
 
+XML2_LDFLAGS=""
+XML2_CPPFLAGS=""
+
 if test "x$XML2CONFIG" = "x"; then
 	dnl XML2CONFIG was not specified, so search within the current path
 	AC_PATH_PROG([XML2CONFIG], [xml2-config])
 
-	dnl If we couldn't find xml2-config, display a warning
+	dnl If we couldn't find xml2-config, display a warning if pkg-config fails too
 	if test "x$XML2CONFIG" = "x"; then
-		AC_MSG_ERROR([could not find xml2-config from libxml2 within the current path. You may need to try re-running configure with a --with-xml2config parameter.])
+		if test ! -z "$PKG_CONFIG"; then
+			PKG_CHECK_MODULES([LIBXML2], [libxml-2.0], [
+				XML2_CPPFLAGS="$LIBXML2_CFLAGS"
+				XML2_LDFLAGS="$LIBXML2_LIBS"
+				POSTGIS_LIBXML2_VERSION=`$PKG_CONFIG libxml-2.0 --modversion`
+			], [])
+		else
+			AC_MSG_ERROR([could not find xml2-config from libxml2 within the current path. You may need to try re-running configure with a --with-xml2config parameter.])
+		fi
+	else
+		dnl Extract the linker and include flags
+		XML2_LDFLAGS=`$XML2CONFIG --libs`
+		XML2_CPPFLAGS=`$XML2CONFIG --cflags`
+
+		dnl Extract the version
+		POSTGIS_LIBXML2_VERSION=`$XML2CONFIG --version`
 	fi
 else
 	dnl XML2CONFIG was specified; display a message to the user
@@ -604,6 +632,13 @@ else
 	else
 		if test -f $XML2CONFIG; then
 			AC_MSG_RESULT([Using user-specified xml2-config file: $XML2CONFIG])
+
+			dnl Extract the linker and include flags
+			XML2_LDFLAGS=`$XML2CONFIG --libs`
+			XML2_CPPFLAGS=`$XML2CONFIG --cflags`
+
+			dnl Extract the version
+			POSTGIS_LIBXML2_VERSION=`$XML2CONFIG --version`
 		else
 			AC_MSG_ERROR([the user-specified xml2-config file $XML2CONFIG does not exist])
 		fi
@@ -611,11 +646,6 @@ else
 fi
 
 
-dnl Extract the linker and include flags
-XML2_LDFLAGS=`$XML2CONFIG --libs`
-XML2_CPPFLAGS=`$XML2CONFIG --cflags`
-
-
 dnl
 dnl XCode in 10.12 supplies bad flags in xml2config resulting
 dnl in compile errors. For that one version, we force the prefix
@@ -638,10 +668,6 @@ case $host_os in
         ;;
 esac
 
-
-dnl Extract the version
-POSTGIS_LIBXML2_VERSION=`$XML2CONFIG --version`
-
 dnl Check headers file
 CPPFLAGS_SAVE="$CPPFLAGS"
 CPPFLAGS="$XML2_CPPFLAGS"
@@ -830,16 +856,6 @@ CFLAGS="$CFLAGS_SAVE"
 
 
 dnl ===========================================================================
-dnl Detect if pkg-config installed
-dnl ===========================================================================
-# check for pkg-config
-PKG_PROG_PKG_CONFIG
-if test -z "$PKG_CONFIG"; then
-   AC_MSG_WARN([Cannot find pkg-config, make sure it is installed in your PATH])
-fi
-
-
-dnl ===========================================================================
 dnl Detect the version of PROJ.4 installed
 dnl ===========================================================================
 

-----------------------------------------------------------------------

Summary of changes:
 NEWS         |  1 +
 configure.ac | 58 +++++++++++++++++++++++++++++++++++++---------------------
 2 files changed, 38 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list