Re: Change 17347: Support hints and OPTIMIZE in MM_MacOS

[email protected] (Jarkko Hietaniemi) Wed, 17 Jul 2002 03:15:50 +0300
Newsgroups perl.perl5.porters,perl.perl5.changes.mac
Message-ID <[email protected]>
On Tue, Jul 16, 2002 at 04:46:06PM -0400, Michael G Schwern wrote:
> I'd rather not put yet more duplicated code into MakeMaker.  Is there
> something that can be done to MakeMaker.pm's version of the methods to make
> them generic?  Something from File::Spec?

For post-5.8.0 something from File::Spec for this would be nice, yes.

> On Sat, Jun 22, 2002 at 05:37:54PM -0400, Chris Nandor wrote:
> > +# yes, these are just copies of the same routines in
> > +# MakeMaker.pm, but with paths changed.
> > +sub check_hints {
> > +    my($self) = @_;
> > +    # We allow extension-specific hints files.
> > +
> > +    return unless -d ":hints";
> > +
> > +    # First we look for the best hintsfile we have
> > +    my($hint)="${^O}_$Config{osvers}";
> > +    $hint =~ s/\./_/g;
> > +    $hint =~ s/_$//;
> > +    return unless $hint;
> > +
> > +    # Also try without trailing minor version numbers.
> > +    while (1) {
> > +        last if -f ":hints:$hint.pl";      # found
> > +    } continue {
> > +        last unless $hint =~ s/_[^_]*$//; # nothing to cut off
> > +    }
> > +    my $hint_file = ":hints:$hint.pl";
> > +
> > +    return unless -f $hint_file;    # really there
> > +
> > +    _run_hintfile($self, $hint_file);
> > +}
> > +
> > +sub _run_hintfile {
> > +    no strict 'vars';
> > +    local($self) = shift;       # make $self available to the hint file.
> > +    my($hint_file) = shift;
> > +
> > +    local $@;
> > +    print STDERR "Processing hints file $hint_file\n";
> > +    my $ret = do $hint_file;
> > +    unless( defined $ret ) {
> > +        print STDERR $@ if $@;
> > +    }
> > +}
> >  1;
> 
> 
> -- 
> This sig file temporarily out of order.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen