GNOME Bugzilla – Bug 765979
configure.ac should use pkg-config to locate zlib and ICU
Last modified: 2016-05-09 02:18:18 UTC
Created attachment 327291 [details] [review] configure.ac patch to detect ICU via pkg-config in preference to running icu-config This issue is killing cross-compilations for me. The configure.ac script's attempts to detect zlib fail due to the use of -L/lib in the link test. The (not yet applied) fix from bug #749416 does not help me. libxml2 fails to link, complaining about missing symbols (from zlib) Additionally, the configure.ac script's attempts to run icu-config are doomed to fail, as it runs the one in /usr/bin on the build machine, not the one from the cross-compiled ICU. The fix from bug #760190 doesn't really help me. I attach two patches for the configure.ac, made against the 2.9.4-rc1 source archive. These modify the configure.ac to try pkg-config first in both cases. Background: In my case, I have a 32-bit cross-compiler targeting a 32-bit platform, running on a 64-bit host, and /lib/libz.so.1.2.8 is a 64-bit library that the cross-compiler does not like that file as its binutils can't recognise the format and it fails the link. Testing on a 32-bit host shows that the cross-compiler still doesn't like it, because the arch is wrong, but carries on searching the library path, finding the cross-compiled zlib in the cross-compile sysroot and the link succeeds. The idea of running *-config scripts from a cross-compiled sysroot is problematic in the extreme. You can't just put the directory on PATH, as then the build machine will find these binaries instead of the host system's versions. This seems to affect a few bits of software, ICU amongst them.
Created attachment 327292 [details] [review] configure.ac patch to detect zlib via pkg-config
Okay, since the patches fallback to the previous code if pkg-config step fails I think this is the best way to handle this, so pushed and applied https://git.gnome.org/browse/libxml2/commit/?id=3d75c2e82806955542a41ff62a5be25e04287d89 https://git.gnome.org/browse/libxml2/commit/?id=45f0abd4278776e1c12df38672b8d20a3cc471a8 Thanks ! Daniel