On Tue, Dec 03, 2002 at 01:37:05AM -0600, Craig A. Berry wrote:
> However, the change introduces the following failure:
>
> lib/ExtUtils/t/writemakefile_args....FAILED at test 6
This means you're not handling the LIBS => '-lfoo -lbar' case properly. ie.
where LIBS contains a simple string.
> BTW, in the penultimate line of context in the patch, is it possible
> for "ref \$self->{LIBS}" ever be equal to 'SCALAR'? Isn't "ref \$foo"
> always going to be 'REF'?
ref \$self->{LIBS} eq 'SCALAR' is a very silly way to say !ref
$self->{LIBS}. ie. if $self->{LIBS} does not contain a reference but
just a plain string.
> --- lib/ExtUtils/MM_Unix.pm;-0 Sat Nov 30 16:40:42 2002
> +++ lib/ExtUtils/MM_Unix.pm Mon Dec 2 23:17:49 2002
> @@ -1764,7 +1764,9 @@
> # undefined. In any case we turn it into an anon array:
>
> # May check $Config{libs} too, thus not empty.
> - $self->{LIBS}=[''] unless $self->{LIBS};
> + $self->{LIBS}=['']
> + unless ref($self->{LIBS}) eq 'SCALAR' && $self->{LIBS}
> + || ref($self->{LIBS}) eq 'ARRAY' && @{$self->{LIBS}};
>
> $self->{LIBS}=[$self->{LIBS}] if ref \$self->{LIBS} eq 'SCALAR';
Likely better written as:
$self->{LIBS} = [$self->{LIBS}] unless ref $self->{LIBS};
$self->{LIBS} = [''] unless @{$self->{LIBS}};
by doing the normalization to an array ref first, all the logic is
simplified because we now know we have an array ref.
Try that and I betcha your writemakefile_args failures will go away.
(Apologies, my copy of MM is in a dreadful state at the moment).
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
My breasts are arousing weapons.