From: Tony Cook Date: Mon, 9 Aug 2010 12:39:30 +0000 (+0000) Subject: retain compatibility with the original Devel::CheckLib, even if it X-Git-Tag: Imager-0.77~8 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/2fba920a154dec2538462b5f852266fde47d2eb0 retain compatibility with the original Devel::CheckLib, even if it doesn't match EU::MM handling of LIBS --- diff --git a/inc/Devel/CheckLib.pm b/inc/Devel/CheckLib.pm index ead38afb..92db0c0f 100644 --- a/inc/Devel/CheckLib.pm +++ b/inc/Devel/CheckLib.pm @@ -204,13 +204,23 @@ sub assert_lib { } # using special form of split to trim whitespace if(defined($args{LIBS})) { - my @LIBS = ref $args{LIBS} ? @{$args{LIBS}} : split ' ', $args{LIBS}; - foreach my $arg (@LIBS) { - my @sep = split ' ', $arg; - my @libs = map { /^-l(.+)$/ ? $1 : () } @sep; - my @paths = map { /^-L(.+)$/ ? $1 : () } @sep; - push @link_cfgs, [ \@paths, \@libs ]; - } + if (ref $args{LIBS}) { + foreach my $arg (@{$args{LIBS}}) { + my @sep = split ' ', $arg; + my @libs = map { /^-l(.+)$/ ? $1 : () } @sep; + my @paths = map { /^-L(.+)$/ ? $1 : () } @sep; + push @link_cfgs, [ \@paths, \@libs ]; + } + } + else { + my @libs; + my @paths; + foreach my $arg (split(' ', $args{LIBS})) { + die("LIBS argument badly-formed: $arg\n") unless($arg =~ /^-l/i); + push @{$arg =~ /^-l/ ? \@libs : \@paths}, substr($arg, 2); + } + push @link_cfgs, map [ \@paths, [ $_ ] ], @libs; + } } if(defined($args{INC})) { foreach my $arg (split(' ', $args{INC})) {