Skip to content
Permalink
Browse files

Move Build config reloc handling back to nqp-configuration

Parts of the relocatability configuration logic is also needed in
NQP. So move those bits back.
  • Loading branch information...
patzim committed May 31, 2019
1 parent 34476c3 commit 7fc38d553b3b514f50be0a9e7814ad239e220820
Showing with 11 additions and 14 deletions.
  1. +1 −0 Configure.pl
  2. +10 −14 tools/lib/NQP/Config/Rakudo.pm
@@ -92,6 +92,7 @@ BEGIN

$cfg->configure_paths;
$cfg->configure_from_options;
$cfg->configure_relocatability;
$cfg->configure_repo_urls;
$cfg->configure_commands;
$cfg->configure_nqp;
@@ -272,10 +272,13 @@ sub configure_moar_backend {
moar => "Unable to read configuration from NQP on MoarVM" );
}

# Relocatability is not supported on AIX.
$self->{options}->{"no-relocatable"} ||= !!( $^O =~ /^(?:aix|openbsd)$/ );
if ( $self->{options}->{"no-relocatable"} ) {
$config->{relocatable} = 0;
if ( $config->{relocatable} ) {
$config->{static_nqp_home} = '';
$config->{static_perl6_home} = '';
$config->{static_nqp_home_define} = '';
$config->{static_perl6_home_define} = '';
}
else {
$config->{static_nqp_home} =
File::Spec->rel2abs(File::Spec->catdir( $nqp_config->{'nqp::prefix'}, 'share', 'nqp' ));
$config->{static_perl6_home} =
@@ -285,23 +288,16 @@ sub configure_moar_backend {
$config->{static_perl6_home_define} =
'-DSTATIC_PERL6_HOME=' . $config->{static_perl6_home};
}
else {
$config->{relocatable} = 1;
$config->{static_nqp_home} = '';
$config->{static_perl6_home} = '';
$config->{static_nqp_home_define} = '';
$config->{static_perl6_home_define} = '';
}

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

0 comments on commit 7fc38d5

Please sign in to comment.
You can’t perform that action at this time.