diff --git a/src/build.pl b/src/build.pl index aa5fc8f..7316d56 100644 --- a/src/build.pl +++ b/src/build.pl @@ -5,6 +5,25 @@ use Cwd; $/ = undef; +# Set up shell +my $verbose = 0; +$verbose = 1 if $ENV{VERBOSE} =~ /^yes$/i; + +if ($verbose) { + # we implement VERBOSE by restarting in the debugger and having it print each line + unless (defined &DB::DB) { + # sadly Devel::Trace is not a standard package so we test for it here + eval { + require Devel::Trace; + }; + unless ($@) { + exit system($^X, "-d:Trace", $0, @ARGV); + } else { + message("Could not 'import Devel::Trace' required for VERBOSE=yes. Consider installing it from CPAN https://metacpan.org/pod/Devel::Trace or using your package manager (possibly in the libdevel-trace-perl package)."); + } + } +} + # Set locations my $THORN = "MPI"; my $NAME = "openmpi-1.10.7"; diff --git a/src/detect.pl b/src/detect.pl index 84cd56c..0a6d736 100644 --- a/src/detect.pl +++ b/src/detect.pl @@ -13,6 +13,21 @@ my $verbose = 0; $verbose = 1 if $ENV{VERBOSE} =~ /^yes$/i; +if ($verbose) { + # we implement VERBOSE by restarting in the debugger and having it print each line + unless (defined &DB::DB) { + # sadly Devel::Trace is not a standard package so we test for it here + eval { + require Devel::Trace; + }; + unless ($@) { + exit system($^X, "-d:Trace", $0, @ARGV); + } else { + message("Could not 'import Devel::Trace' required for VERBOSE=yes. Consider installing it from CPAN https://metacpan.org/pod/Devel::Trace or using your package manager (possibly in the libdevel-trace-perl package)."); + } + } +} + ################################################################################ # Check for old mechanism ################################################################################