GNOME Bugzilla – Bug 778549
Look for libxml2 via pkg-config first
Last modified: 2017-09-13 09:16:24 UTC
Created attachment 345604 [details] [review] Patch libxml2 check to use pkg-config If no explicit path is specified, try pkg-config first, before xml2-config. The reason is that pkg-config knows the difference between static and shared dependencies and thus doesn't cause libxslt to be linked against a bunch of extra stuff. Say for example that libxml2 is compiled --with-icu, then it will be linked against various libicu shared libraries. xml2-config will _also_ specify those libraries (because it doesn't know whether you are doing static or shared linking) and thus libxslt is also linked against libicu even though it does not use it. On the other hand, pkg-config has Libs/Libs.private which separates shared&static dependencies and so you can get libxslt to link to _only_ libxml2 without any other things.
Fixed with the following commit: https://git.gnome.org/browse/libxslt/commit/?id=abf537ebb2296cd3ae89989a17b0e1b5c79db107 Thanks for the patch.
This patch is a bashism and therefore only works when /bin/sh is a symlink to the bash shell. (I'm sorry, but who actually uses "==" in either bash or sh??? This is incredibly ugly and serves no purpose other than to foment confusion.) It also breaks xslt-config which admittedly is an ugly workaround for people who don't realize they should have used pkg-config. See https://bugs.archlinux.org/task/55600 for details.