diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2020-03-17 12:09:27 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2020-03-17 12:09:27 -0400 |
commit | d67d7243f914f99bd1103f811efd320c987db2bc (patch) | |
tree | 77c4e7bd6cd5af9cc59e517f2bedfe6ad0bdcce0 /doc/src | |
parent | 5e4a0b7194b9b53eeedc718fde1430eb649b8b62 (diff) |
Use pkg-config, if available, to locate libxml2 during configure.
If pkg-config is installed and knows about libxml2, use its information
rather than asking xml2-config. Otherwise proceed as before. This
patch allows "configure --with-libxml" to succeed on platforms that
have pkg-config but not xml2-config, which is likely to soon become
a typical situation.
The old mechanism can be forced by setting XML2_CONFIG explicitly
(hence, build processes that were already doing so will certainly
not need adjustment). Also, it's now possible to set XML2_CFLAGS
and XML2_LIBS explicitly to override both programs.
There is a small risk of this breaking existing build processes,
if there are multiple libxml2 installations on the machine and
pkg-config disagrees with xml2-config about which to use. The
only case where that seems really likely is if a builder has tried
to select a non-default xml2-config by putting it early in his PATH
rather than setting XML2_CONFIG. Plan to warn against that in the
minor release notes.
Back-patch to v10; before that we had no pkg-config infrastructure,
and it doesn't seem worth adding it for this.
Hugh McMaster and Tom Lane; Peter Eisentraut also made an earlier
attempt at this, from which I lifted most of the docs changes.
Discussion: https://postgr.es/m/CAN9BcdvfUwc9Yx5015bLH2TOiQ-M+t_NADBSPhMF7dZ=pLa_iw@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/installation.sgml | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index 4a4f4b517e4..19e3a3cf9aa 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -955,21 +955,31 @@ su - postgres <term><option>--with-libxml</option></term> <listitem> <para> - Build with libxml (enables SQL/XML support). Libxml version 2.6.23 or + Build with libxml2, enabling SQL/XML support. Libxml2 version 2.6.23 or later is required for this feature. </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 - <envar>XML2_CONFIG</envar> to point to the - <command>xml2-config</command> program belonging to the - installation, or use the options - <option>--with-includes</option> and - <option>--with-libraries</option>. + To detect the required compiler and linker options, PostgreSQL will + query <command>pkg-config</command>, if that is installed and knows + about libxml2. Otherwise the program <command>xml2-config</command>, + which is installed by libxml2, will be used if it is found. Use + of <command>pkg-config</command> is preferred, because it can deal + with multi-architecture installations better. + </para> + + <para> + To use a libxml2 installation that is in an unusual location, you + can 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 libxml2 + installation, or set the variables <envar>XML2_CFLAGS</envar> + and <envar>XML2_LIBS</envar>. (If <command>pkg-config</command> is + installed, then to override its idea of where libxml2 is you must + either set <envar>XML2_CONFIG</envar> or set + both <envar>XML2_CFLAGS</envar> and <envar>XML2_LIBS</envar> to + nonempty strings.) </para> </listitem> </varlistentry> @@ -1495,7 +1505,7 @@ su - postgres <listitem> <para> <command>xml2-config</command> program used to locate the - libxml installation. + libxml2 installation </para> </listitem> </varlistentry> |