Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MoarVM: don't ignore LDFLAGS
An upstream patch that makes sure not to ignore LDFLAGS.

See: MoarVM/MoarVM#472
  • Loading branch information
mojca committed Feb 8, 2017
1 parent 60c0e9d commit cb589c6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lang/MoarVM/Portfile
Expand Up @@ -21,6 +21,8 @@ checksums rmd160 3f0cb18b1f5d8f6da168cd15a6db6be84214a29c \
# conflicts dyncall libtommath libuv
conflicts libtommath

patchfiles patch-build-probe.pm.diff

# configure.cflags-append \
# -I${prefix}/include/libtommath
depends_build port:perl5 \
Expand Down
23 changes: 23 additions & 0 deletions lang/MoarVM/files/patch-build-probe.pm.diff
@@ -0,0 +1,23 @@
# https://github.com/MoarVM/MoarVM/issues/472
# https://github.com/MoarVM/MoarVM/commit/fe2cefb15e14865fdc5e7077647fff41e980b3e7
--- build/probe.pm.orig
+++ build/probe.pm
@@ -57,7 +57,7 @@ sub compile {
push @objs, $obj;
}

- my $command = "$config->{ld} $config->{ldout}$leaf @objs $config->{ldlibs} >$devnull 2>&1";
+ my $command = "$config->{ld} $ENV{LDFLAGS} $config->{ldout}$leaf @objs $config->{ldlibs} >$devnull 2>&1";
system $command
and return;
return 1;
@@ -102,7 +102,8 @@ EOT
}

if ($can_compile) {
- $command = "$config->{ld} $config->{ldout}$leaf $obj $config->{ldlibs} 2>&1";
+ $ENV{LDFLAGS} //= '';
+ $command = "$config->{ld} $ENV{LDFLAGS} $config->{ldout}$leaf $obj $config->{ldlibs} 2>&1";
$output = `$command` || $!;
if ($? >> 8 == 0) {
$can_link = 1;

0 comments on commit cb589c6

Please sign in to comment.