pg-pkg-config-xml.patch
text/x-patch
Patch
Format: unified
| File | + | − |
|---|---|---|
| configure.in | 18 | 12 |
| doc/src/sgml/installation.sgml | 12 | 5 |
diff --git a/configure.in b/configure.in
index 2dee4b3..9f8b0f9 100644
--- a/configure.in
+++ b/configure.in
@@ -706,18 +706,24 @@ PGAC_ARG_BOOL(with, libxml, no, [build with XML support],
[AC_DEFINE([USE_LIBXML], 1, [Define to 1 to build with XML support. (--with-libxml)])])
if test "$with_libxml" = yes ; then
- AC_CHECK_PROGS(XML2_CONFIG, xml2-config)
- if test -n "$XML2_CONFIG"; then
- for pgac_option in `$XML2_CONFIG --cflags`; do
- case $pgac_option in
- -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
- esac
- done
- for pgac_option in `$XML2_CONFIG --libs`; do
- case $pgac_option in
- -L*) LDFLAGS="$LDFLAGS $pgac_option";;
- esac
- done
+ AC_CHECK_PROGS(PKG_CONFIG, pkg-config)
+ if test -n "$PKG_CONFIG"; then
+ CPPFLAGS="$CPPFLAGS "`$PKG_CONFIG libxml-2.0 --cflags-only-I`
+ LDFLAGS="$LDFLAGS "`$PKG_CONFIG libxml-2.0 --libs-only-L`
+ else
+ AC_CHECK_PROGS(XML2_CONFIG, xml2-config)
+ if test -n "$XML2_CONFIG"; then
+ for pgac_option in `$XML2_CONFIG --cflags`; do
+ case $pgac_option in
+ -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
+ esac
+ done
+ for pgac_option in `$XML2_CONFIG --libs`; do
+ case $pgac_option in
+ -L*) LDFLAGS="$LDFLAGS $pgac_option";;
+ esac
+ done
+ fi
fi
fi
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml
index 6e43bcb..ef32bca 100644
--- a/doc/src/sgml/installation.sgml
+++ b/doc/src/sgml/installation.sgml
@@ -892,11 +892,18 @@ <title>Configuration</title>
</para>
<para>
- Libxml installs a program <command>xml2-config</command> that
- can be used to detect the required compiler and linker
- options. PostgreSQL will use it automatically if found. To
- specify a libxml installation at an unusual location, you can
- either set the environment variable
+ To detect the required compiler and linker options, PostgreSQL will
+ query <command>pkg-config</command>, if it is installed. Otherwise
+ the program <command>xml2-config</command>, which is installed by
+ libxml, will be used if it is found. Use
+ of <command>pkg-config</command> is preferred, because it can deal
+ with multi-arch installations better.
+ </para>
+
+ <para>
+ To specify a libxml installation at an unusual location, you can
+ either set <command>pkg-config</command>-related environment variables
+ (see its documentation), or set the environment variable
<envar>XML2_CONFIG</envar> to point to the
<command>xml2-config</command> program belonging to the
installation, or use the options