[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl6-internals
Subject:    Re: [perl #50390] [BUG]: Parrot::Configure::Step::Methods::_handle_darwin_for_fink adding superfluou
From:       "Will Coleda" <will () coleda ! com>
Date:       2008-01-30 2:14:18
Message-ID: 3907b40a0801291814l32a5d1dcga5c7d2745969845a () mail ! gmail ! com
[Download RAW message or body]

On Jan 29, 2008 9:08 PM, via RT James Keenan
<parrotbug-followup@parrotcode.org> wrote:
> # New Ticket Created by  James Keenan
> # Please include the string:  [perl #50390]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=50390 >
>
>
> In the course of research on http://rt.perl.org/rt3/Ticket/
> Display.html?id=50056 tonight, use of Parrot::Configure::Trace
> indicated that auxiliary method _handle_darwin_for_fink was adding
> flag '-L/sw/lib' an unnecessary second time to 'linkflags' and
> 'ldflags' at config step auto::gdbm (on my box, at least) and was
> adding '-I/sw/include' an unnecessary second time to 'ccflags'.
>
> The attached patch for lib/Parrot/Configure/Step/Methods.pm corrects
> the problem by checking to see whether these flags are already in the
> attribute before adding them.
>
> Index: lib/Parrot/Configure/Step/Methods.pm
> ===================================================================
> --- lib/Parrot/Configure/Step/Methods.pm        (revision 25337)
> +++ lib/Parrot/Configure/Step/Methods.pm        (working copy)
> @@ -65,9 +65,21 @@
>          my $fink_include_dir    = $conf->data->get('fink_include_dir');
>          if ( (defined $fink_lib_dir) && (defined $fink_include_dir) ) {
>              if ( -f "$fink_include_dir/$file" ) {
> -                $conf->data->add( ' ', linkflags => "-L$fink_lib_dir" );
> -                $conf->data->add( ' ', ldflags   => "-L$fink_lib_dir" );
> -                $conf->data->add( ' ', ccflags   => "-I$fink_include_dir" );
> +#                $conf->data->add( ' ', linkflags => "-L$fink_lib_dir" );
> +#                $conf->data->add( ' ', ldflags   => "-L$fink_lib_dir" );
> +#                $conf->data->add( ' ', ccflags   => "-I$fink_include_dir" );
> +                my %intended = (
> +                    linkflags => "-L$fink_lib_dir",
> +                    ldflags   => "-L$fink_lib_dir",
> +                    ccflags   => "-I$fink_include_dir",
> +                );
> +                foreach my $flag (keys %intended) {
> +                    my $flagstr = $conf->data->get($flag);
> +                    my @elements = split /\s+/, $flagstr;
> +                    my %seen = map {$_, 1} @elements;
> +                    $conf->data->add( ' ', $flag => $intended{$flag} )
> +                        unless $seen{$intended{$flag}};
> +                }
>              }
>          }
>      }
>
>
>
>
>

Would it make sense to make this the default behavior to
$conf->data->add, or perhaps add another add* variant?


-- 
Will "Coke" Coleda
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic