Re: [PATCH] Use PKG_CHECK_MODULES to detect the libxml2 library

From: Hugh McMaster <hugh(dot)mcmaster(at)outlook(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Use PKG_CHECK_MODULES to detect the libxml2 library
Date: 2020-03-11 10:24:10
Message-ID: CAN9BcdtMKR3gfsWv1YNGOu-bNJoySXZk5uNXFaz7XeonrABfsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 10 Mar 2020 at 22:41, Daniel Gustafsson wrote:
>
> > On 10 Mar 2020, at 11:53, Hugh McMaster <hugh(dot)mcmaster(at)outlook(dot)com> wrote:
> > This patch uses pkg-config's PKG_CHECK_MODULES macro to detect libxml2
> > or, if pkg-config is not available, falls back to xml2-confg.
>
> This was previously discussed in 20200120204715(dot)GA73984(at)msg(dot)df7cb(dot)de which
> ended without a real conclusion on what could/should be done (except that
> nothing *had* to be done).
>
> What is the situation on non-Debian/Ubuntu systems (BSD's, macOS etc etc)? Is
> it worth adding pkg-config support if we still need a fallback to xml2-config?

To the best of my knowledge, FreeBSD, macOS, OpenSUSE, Solaris etc.
all support detection of libxml2 via pkg-config.

One way or another, xml2-config is going away, whether by decision of
a package maintainer or upstream.

freetype-config was deprecated upstream a few years ago. Upstream ICU
will also disable the installation of icu-config by default from April
this year. Some systems, such as Debian, have not shipped icu-config
for a year or so.

The PHP project last year switched to using pkg-config by default for
all libraries supplying a .pc file. PHP's build scripts do not fall
back to legacy scripts.

Another reason for switching is that xml2-config incorrectly outputs
static libraries when called with `--libs`. You have to call `--libs
--dynamic` to output -lxml2 only. Debian patches the script to avoid
this unusual behaviour.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-03-11 10:25:17 Re: HAVE_WORKING_LINK still needed?
Previous Message Prabhat Sahu 2020-03-11 10:15:42 SERIAL datatype column skipping values.