Re: [PATCH] Use PKG_CHECK_MODULES to detect the libxml2 library
Hugh McMaster <hugh.mcmaster@outlook.com>
From: Hugh McMaster <hugh.mcmaster@outlook.com>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2020-03-11T10:37:01Z
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.
Commits
-
Use pkg-config, if available, to locate libxml2 during configure.
- d67d7243f914 10.13 landed
- 9af2f7dc9603 11.8 landed
- d8e7f8149400 12.3 landed
- 0bc8cebdb889 13.0 landed