Bug#681663: omake: wrong link option order in CheckCLib breaks with ld-as-needed
Package: omake
Version: 0.9.8.5-3
Severity: important
Tags: upstream patch
Usertags: ld-as-needed
Dear Maintainer,
OMake "CheckCLib" function uses CFLAGS instead of LDFLAGS to pass link
options. This causes this test to fail with ld-as-needed, since "-l"
option appears on the command-line before objects which use the library.
In particular, the package camlimages fails to build properly because of
this bug: it fails to check the existence of libpng, libjpeg, ..., using
CheckCLib.
Fixing the bug is easy: one only need to replace CFLAGS with LFLAGS in
the definition of CheckCLib (lib/configure/Configure.om).
Upstream bug: http://bugzilla.metaprl.org/cgi-bin/show_bug.cgi?id=738
Upstream camlimages workaround:
https://bitbucket.org/camlspotter/camlimages/changeset/7e9024c0cd0a
Ubuntu bug for camlimages:
https://bugs.launchpad.net/ubuntu/+source/camlimages/+bug/1019222
--- omake-0.9.8.5-3.orig/lib/configure/Configure.om
+++ omake-0.9.8.5-3/lib/configure/Configure.om
@@ -268,7 +268,7 @@ public.VerboseCheckCHeader(files) =
# \end{doc}
#
public.CheckCLib(libs, funs) =
- CFLAGS += $(addprefix -l, $(libs))
+ LDFLAGS += $(addprefix -l, $(libs))
return $(TryLinkC $"""
#ifdef __cplusplus
Reply to: