-sub help_buildsystem {
- my $step=shift;
-
- # Print build system help page to standard output
-
- my $inst = load_buildsystem($opt_buildsys, $step);
- if ($inst) {
- my $pmfile = ref $inst;
- $pmfile =~ s#::#/#g;
- $pmfile = $INC{"$pmfile.pm"};
-
- # Display help with perldoc if it is installed and output is
- # a tty
- my $perldoc;
- if (-t STDOUT) {
- eval "use Pod::Perldoc";
- $perldoc = "Pod::Perldoc" if (!$@);
- }
- if ($perldoc) {
- $perldoc = new Pod::Perldoc();
- $perldoc->{args} = [ '-oman',
- '-w', 'section=7" "--name=dh_auto_'.lc($inst->NAME()),
- '-w', 'center=Dh_auto build system documentation',
- '-w', 'release=',
- '-F', $pmfile ];
- $perldoc->process();
- }
- else {
- # No perldoc on the system. Use Pod::Usage to emit simple text
- eval "use Pod::Usage";
- pod2usage( -message => "Help page for the ".$inst->NAME()." build system\n" .
- '<' . '-'x74 . '>',
- -input => $pmfile, -exitval => 'NOEXIT',
- -verbose => 2, -noperldoc => 1 );
- print '<', '-'x74, '>', "\n";
- }
- return 0;
- }
- else {
- print STDERR "No system auto-selected or specified. Try using --buildsystem option\n";
- return 1;
- }
-}
-