From: Graham Knop Date: Mon, 23 May 2016 13:13:25 +0000 (-0400) Subject: calculate extra libs better X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c5699decd650935332d3d0f7025dc1e9efe55ec0;p=scpubgit%2FObject-Remote.git calculate extra libs better --- diff --git a/lib/Object/Remote/FatNode.pm b/lib/Object/Remote/FatNode.pm index 8b143b8..ec91733 100644 --- a/lib/Object/Remote/FatNode.pm +++ b/lib/Object/Remote/FatNode.pm @@ -14,13 +14,14 @@ sub stripspace { $text; } -my %maybe_libs = map +($_ => 1), grep defined, (values %Config, '.'); - -my @extra_libs = grep not(ref($_) or $maybe_libs{$_}), @INC; -my $extra_libs = join '', map { - my $lib = $_; - $lib =~ s{'}{'\\''}g; - " -I'$lib'\n"; +chomp(my @base_libs = `"$^X" -le"print for grep defined and !ref, \@INC"`); +my %base_libs = map +($_ => 1), @base_libs; + +my @extra_libs = grep not(ref($_) or $base_libs{$_}), @INC; +my $extra_libs = join ' ', map { + my $lib = $_; + $lib =~ s{'}{'\\''}g; + "-I'$lib'\n"; } @extra_libs; my $command = qq(