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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hugh McMaster <hugh(dot)mcmaster(at)outlook(dot)com>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, 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-12 16:39:41
Message-ID: 24281.1584031181@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I poked at this issue a bit more and realized that Hugh's patch
flat-out breaks building --with-libxml in environments without
pkg-config, because PKG_CHECK_MODULES just gives up and dies
if there's no pkg-config (as we'd already found out in connection
with ICU). That won't win us any friends, so the attached revision
doesn't call PKG_CHECK_MODULES unless we found pkg-config. I also
concluded that if the user has set XML2_CONFIG, it's pretty clear
that her intent is to use whatever that is pointing at, so we should
not use pkg-config in that case either.

Also, I'd been going back and forth about whether it was worth
documenting XML2_CFLAGS/XML2_LIBS, but I realized that use of
PKG_CHECK_MODULES(XML2, ...) basically forces the issue for us:
it does AC_ARG_VAR on them, which puts them into configure's
--help output and makes configure picky about caching them.
So we can't really pretend they're boring implementation detail.

So the attached mostly adopts Peter's old suggested docs, but
I added discussion of XML2_CFLAGS/XML2_LIBS and dropped the mention
of forcing matters with --with-libs/--with-libraries (not because
that doesn't work anymore but because it seemed like we were offering
quite enough alternatives already).

I'd originally thought that we might back-patch this, but I'm now of
the opinion that we probably should not. If pkg-config is present,
this can change the default behavior about where we get libxml from,
which seems like something not to do in minor releases. (OTOH, it'd
only matter if the default pkg-config choice is different from the
default xml2-config choice, so maybe the risk of breakage is small
enough to be acceptable?)

regards, tom lane

Attachment Content-Type Size
0001-pkg-check-modules-libxml2-v2.patch text/x-diff 16.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexey Kondratov 2020-03-12 17:08:46 Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly
Previous Message Ashutosh Bapat 2020-03-12 16:19:25 Re: A bug when use get_bit() function for a long bytea string