Skip to content

Commit

Permalink
Allow setting --no-relocatable different than moar with respect to rp…
Browse files Browse the repository at this point in the history
…ath.
  • Loading branch information
PatZim committed Mar 20, 2019
1 parent 9e63da4 commit a542ec9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Configure.pl
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,11 @@

$errors{moar}{'no gen-nqp'} = @errors && !defined $options{'gen-nqp'};

$config{ldrpath} = $options{'no-relocatable'} ? $nqp_config{'moar::ldrpath'} : $nqp_config{'moar::ldrpath_relocatable'};
# Strip rpath from ldflags so we can set it differently ourself.
$config{ldflags} = join(' ', $nqp_config{'moar::ldflags'}, $nqp_config{'moar::ldmiscflags'}, $nqp_config{'moar::ldoptiflags'}, $nqp_config{'moar::ldlibs'});
$config{ldflags} =~ s/\Q$nqp_config{'moar::ldrpath'}\E ?//;
$config{ldflags} =~ s/\Q$nqp_config{'moar::ldrpath_relocatable'}\E ?//;
$config{ldflags} .= ' ' . ($options{'no-relocatable'} ? $nqp_config{'moar::ldrpath'} : $nqp_config{'moar::ldrpath_relocatable'});

if ($win) {
if ($prefix . $slash . 'bin' ne $nqp_config{'moar::libdir'}) {
Expand Down
7 changes: 3 additions & 4 deletions tools/build/Makefile-Moar.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
M_CC = @moar::cc@
M_LD = @moar::ld@
M_CFLAGS = @moar::cflags@ @moar::ccmiscflags@ @moar::ccoptiflags@ @moar::ccwarnflags@
M_LDFLAGS = @moar::ldflags@ @moar::ldmiscflags@ @moar::ldoptiflags@ @moar::ldlibs@
M_LDRPATH = @ldrpath@
M_LDFLAGS = @ldflags@
M_C_RUNNER_LIBS = @c_runner_libs@
M_MINGW_UNICODE = @mingw_unicode@

Expand Down Expand Up @@ -229,14 +228,14 @@ $(M_C_RUNNER): src/vm/moar/runner/main.c
# Using only the pkgconfig moar includes does not work, because moar.h assumes all the specific includes below.
$(M_CC) @moar::ccshared@ @static_nqp_home_define@ @static_perl6_home_define@ $(M_CFLAGS) $(M_LDFLAGS) -I$(M_INCPATH) -I$(M_INCPATH)/moar \
-I$(M_INCPATH)/libatomic_ops -I$(M_INCPATH)/dyncall -I$(M_INCPATH)/sha1 -I$(M_INCPATH)/tinymt -I$(M_INCPATH)/libtommath -I$(M_INCPATH)/libuv \
-L@moar::libdir@ $(M_LDRPATH) $(M_MINGW_UNICODE) @moar::ccout@$@ src/vm/moar/runner/main.c -lmoar $(M_C_RUNNER_LIBS)
-L@moar::libdir@ $(M_MINGW_UNICODE) @moar::ccout@$@ src/vm/moar/runner/main.c -lmoar $(M_C_RUNNER_LIBS)

$(M_C_DEBUG_RUNNER): src/vm/moar/runner/main.c
$(RM_F) $(M_C_DEBUG_RUNNER)
# Using only the pkgconfig moar includes does not work, because moar.h assumes all the specific includes below.
$(M_CC) @moar::ccshared@ @static_nqp_home_define@ @static_perl6_home_define@ -DMOAR_PERL6_RUNNER_DEBUG $(M_CFLAGS) $(M_LDFLAGS) -I$(M_INCPATH) -I$(M_INCPATH)/moar \
-I$(M_INCPATH)/libatomic_ops -I$(M_INCPATH)/dyncall -I$(M_INCPATH)/moar -I$(M_INCPATH)/sha1 -I$(M_INCPATH)/tinymt -I$(M_INCPATH)/libtommath -I$(M_INCPATH)/libuv \
-L@moar::libdir@ $(M_LDRPATH) $(M_MINGW_UNICODE) @moar::ccout@$@ src/vm/moar/runner/main.c -lmoar $(M_C_RUNNER_LIBS)
-L@moar::libdir@ $(M_MINGW_UNICODE) @moar::ccout@$@ src/vm/moar/runner/main.c -lmoar $(M_C_RUNNER_LIBS)


## testing targets
Expand Down

0 comments on commit a542ec9

Please sign in to comment.