From: Tony Cook Date: Fri, 25 Nov 2005 00:04:29 +0000 (+0000) Subject: - fixes to verbose mode in Makefile.PL, also added a -v switch so you X-Git-Tag: Imager-0.48^2~90 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/855c5808a2661ad4b3b13a552dc05feb949012a7 - fixes to verbose mode in Makefile.PL, also added a -v switch so you can enable it via the command-line Resolves: http://rt.cpan.org/NoAuth/Bug.html?id=16094 --- diff --git a/Changes b/Changes index 3de11344..9adb2ec6 100644 --- a/Changes +++ b/Changes @@ -1177,6 +1177,9 @@ Revision history for Perl extension Imager. - more examples - add AUTHOR/REVISION/SEE ALSO - add samples/tk-photo.pl +- fixes to verbose mode in Makefile.PL, also added a -v switch so you + can enable it via the command-line + Resolves: http://rt.cpan.org/NoAuth/Bug.html?id=16094 ================================================================= diff --git a/Makefile.PL b/Makefile.PL index 0262e44b..89c124d7 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -22,6 +22,8 @@ use Getopt::Long; # IM_DFLAGS Extra flags to pass to the preprocessor # IM_SUPPRESS_PROMPT Suppress the prompt asking about gif support +getenv(); # get environment variables + my $help; my @enable; my @disable; @@ -33,7 +35,14 @@ GetOptions("help" => \$help, "disable=s" => \@disable, "incpath=s", \@incpaths, "libpath=s" => \@libpaths, - "noprobe" => \$noprobe); + "noprobe" => \$noprobe, + "verbose|v" => \$VERBOSE); + +if ($VERBOSE) { + print "Verbose mode\n"; + require Data::Dumper; + import Data::Dumper qw(Dumper); +} if ($help) { usage(); @@ -44,7 +53,6 @@ if (@enable && @disable) { exit 1; } -getenv(); # get environment variables init(); # initialize global data pathcheck(); # Check if directories exist @@ -322,7 +330,7 @@ sub pathcheck { if ($VERBOSE) { print "\nLibrary paths:\n"; - for (@incs) { print $_,"\n"; } + for (@libs) { print $_,"\n"; } } @libs=grep { -d $_ && -r _ && -x _ or ( print(" $_ doesnt exist or is unaccessible - removed.\n"),0) } @libs; print "\ndone.\n"; @@ -535,8 +543,6 @@ sub getenv { IM_LFLAGS IM_DFLAGS); - if ($VERBOSE) { print "Verbose mode\n"; require Data::Dumper; import Data::Dumper qw(Dumper);} - if ($NOLOG) { print "Logging not compiled into module\n"; } else { push @defines, [ IMAGER_LOG => 1, "Logging system" ]; @@ -652,8 +658,8 @@ sub is_exe { sub usage { print STDERR <