tag 466770 patch
thanks
On Wed, Feb 20, 2008 at 10:34:18PM +0200, Niko Tyni wrote:
> Package: perl4caml
> Version: 0.9.3-8
> Severity: important
> User: [EMAIL PROTECTED]
> Usertags: perl-5.10-transition
>
> Your package fails to build with Perl 5.10:
>
> ocamlopt -w s -I wrappers -cclib -L. perl4caml.cmxa \
> /usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a examples/test.cmx -o
> examples/test.opt
> gcc: /usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a: No such file or directory
> Error during linking
> make[1]: *** [examples/test.opt] Error 2
> make[1]: Leaving directory `/build/niko/perl4caml-0.9.3'
> make: *** [build-stamp] Error 2
The attached patch mangles the output of 'ExtUtils::Embed::ldopts' for
'ocamlopt' consumption. The package builds on both Perl 5.8.8 and 5.10.0
with this, although ocamlklib says "Unknown option -Wl,-E".
DYNALOADER_HACK certainly deserves its name with this...
Cheers,
--
Niko Tyni [EMAIL PROTECTED]
diff --git a/Makefile.config b/Makefile.config
index 4234c25..362bcc3 100644
--- a/Makefile.config
+++ b/Makefile.config
@@ -36,7 +36,8 @@ EXTRA_CFLAGS := -DPERL4CAML_REFCOUNTING_EXPERIMENTAL=1
# To work out what this should be, try:
# `perl -MExtUtils::Embed -e ldopts'
-DYNALOADER_HACK := /usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a
+#DYNALOADER_HACK := /usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a
+DYNALOADER_HACK := $(shell perl -MExtUtils::Embed -e 'print map { m{^(-l|/)} ? "-cclib $$_ " : "-ccopt $$_ "} split(/\s+/, ldopts(1))')
#DYNALOADER_HACK := /System/Library/Perl/5.8.1/darwin-thread-multi-2level/auto/DynaLoader/DynaLoader.a
# PACKAGE and VERSION