Re: [PATCH] Use PKG_CHECK_MODULES to detect the libxml2 library
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hugh McMaster <hugh.mcmaster@outlook.com>
Cc: Daniel Gustafsson <daniel@yesql.se>,
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2020-03-12T16:39:41Z
Lists: pgsql-hackers
Attachments
- 0001-pkg-check-modules-libxml2-v2.patch (text/x-diff) patch v2-0001
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
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