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: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, 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:37:01
Message-ID: CAN9BcdvVGGY65fU5rGRQpOV9zQDe8JwQ6ti+6K6qZ+AEDQ8CGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 11 Mar 2020 at 07:49, Daniel Gustafsson wrote:
> > On 10 Mar 2020, at 18:38, Peter Eisentraut wrote:
> > Btw., here is an older thread for the same issue <https://www.postgresql.org/message-id/flat/1358164265.29612.7.camel%40vanquo.pezone.net>. Might be worth reflecting on the issues discussed there.
>
> Thanks, didn't realize that the subject had been up for discussion earlier as
> well.

Interesting thread. The issue of precedence (e.g. pkg-config over
xml2-config) is still relevant, although arguably less so today, due
to the far greater availability of pkg-config. Some packages choose to
fall back to xml2-config, say, if they need to support old or
soon-to-be EOL systems lacking pkg-config. These situations are
increasingly rare.

The thread is correct on multi-arch header and library directories.
That said, pkg-config can handle this easily.

> For me, the duplication aspect is the most troubling, since we'd still need the
> xml2-config fallback and thus won't be able to simplify the code.

configure.in shows that ICU only uses the PKG_CHECK_MODULES macro.
libxml2, libxslt and other dependencies could also switch.

Using AC_CHECK_LIB to add libraries (such as -lxml2) to $LIBS isn't
probably the most ideal method (I'd recommend adding pkg-config's
native X_CFLAGS and X_LIBS variables as necessary to $LIBS, $CPPFLAGS
etc.), but that's a topic for another thread.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2020-03-11 10:40:53 Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager
Previous Message Peter Eisentraut 2020-03-11 10:25:17 Re: HAVE_WORKING_LINK still needed?