1 # Copyright (C) 2001-2003, Parrot Foundation.
6 config/init/hints.pm - Platform Hints
10 Loads the platform and local hints files, modifying the defaults set up in
11 F<config/init/default.pm>.
20 use File
::Spec
::Functions qw
/catfile/;
21 use base
qw(Parrot::Configure::Step);
26 $data{description
} = q{Load platform and local hints files};
32 my ( $self, $conf ) = @_;
34 my $verbose = $conf->options->get('verbose');
35 print "\n[ " if $verbose;
39 my $osname = lc( $conf->data->get_p5('OSNAME') );
40 $osname = 'linux' if ($osname eq 'gnukfreebsd');
41 my $hints_file = catfile
('config', 'init', 'hints', "$osname.pm");
42 if ( -f
$hints_file ) {
43 my $hints_pkg = "init::hints::" . $osname;
45 print "$hints_pkg " if $verbose;
47 eval "use $hints_pkg";
50 # Call the runstep method if it exists.
51 # Otherwise the step must have done its work when it was loaded.
52 $hints_pkg->runstep( $conf, @_ ) if $hints_pkg->can('runstep');
55 $hints_pkg = "init::hints::local";
56 print "$hints_pkg " if $verbose;
57 eval "use $hints_pkg";
60 $hints_pkg->runstep( $conf, @_ ) if $hints_pkg->can('runstep');
65 print "No $hints_file found. " if $verbose;
68 if ( $hints_used == 0 and $verbose ) {
72 print "]" if $verbose;
81 # cperl-indent-level: 4
84 # vim: expandtab shiftwidth=4: