build: use pkg-config to find zlib#41
Conversation
When building with slibtool it fails with undefined references for -lz because the build sets -no-undefined in the LDFLAGS. This doesn't fail with GNU libtool because they silently ignore -no-undefined. To solve this the build now uses PKG_CHECK_MODULES to find zlib. Gentoo issue: https://bugs.gentoo.org/920273
|
I only now see the similar already existing PR... I'll leave this open for visibility, but I don't mind which version is preferred. |
|
Merged pull request #32. Thanks for the reminder by this pull request. |
|
Note the fairly obvious difference between my PR and this later one is that mine included fallback code for when zlib is installed by the host system without a pkg-config file, e.g. some versions of *BSD that include it in their monorepo without building via the official zlib build system. EDIT:
The libtool flag is unrelated to the ld.bfd flag, and libtool behaves exactly as you want it to if you add |
FWIW, Darwin doesn't have |
GNU libtool documents the flag as meaning "it is safe or not safe to build shared libraries in a cygwin environment". When I say it doesn't have anything to do with the ld.bfd flag, I'm not exaggerating. It is literally unrelated. It is not topical to the topic of asking the linker to error out on undefined symbols. |
|
I don't know what you mean by "ld.bfd", There may also be issues with using https://bugs.freedesktop.org/show_bug.cgi?id=76856 |
When building with slibtool it fails with undefined references for
-lzbecause the build sets-no-undefinedin theLDFLAGS. This doesn't fail with GNU libtool because they silently ignore-no-undefined.To solve this the build now uses
PKG_CHECK_MODULESto find zlib.Gentoo issue: https://bugs.gentoo.org/920273