Skip to content

Commit

Permalink
Override shebang with PERL_MM_SHEBANG=relocatable
Browse files Browse the repository at this point in the history
- Relocatable shebangs are nice. Let's try to make them happen!
- This PR is related to tickets Perl-Toolchain-Gang#38 and Perl-Toolchain-Gang#58
  • Loading branch information
Salve J. Nilsen authored and bingos committed Jul 19, 2018
1 parent 26e6703 commit 43b30ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ExtUtils/MM_Unix.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,10 @@ sub _fixin_replace_shebang {

# Now look (in reverse) for interpreter in absolute PATH (unless perl).
my $interpreter;
if ( $cmd =~ m{^perl(?:\z|[^a-z])} ) {
if ( defined $ENV{PERL_MM_SHEBANG} && $ENV{PERL_MM_SHEBANG} eq "relocatable" ) {
$interpreter = "/usr/bin/env perl";
}
elsif ( $cmd =~ m{^perl(?:\z|[^a-z])} ) {
if ( $Config{startperl} =~ m,^\#!.*/perl, ) {
$interpreter = $Config{startperl};
$interpreter =~ s,^\#!,,;
Expand Down

0 comments on commit 43b30ec

Please sign in to comment.