From 6b1a57222521b29cc3bb22e8a31ca1818b4b5dce Mon Sep 17 00:00:00 2001 From: cristy Date: Fri, 8 Oct 2010 17:35:00 +0000 Subject: [PATCH] --- PerlMagick/Makefile.PL | 46 ++++++++++++++++++++++++++------------- PerlMagick/Makefile.PL.in | 46 ++++++++++++++++++++++++++------------- 2 files changed, 62 insertions(+), 30 deletions(-) diff --git a/PerlMagick/Makefile.PL b/PerlMagick/Makefile.PL index 8178f18c2..af6c00192 100644 --- a/PerlMagick/Makefile.PL +++ b/PerlMagick/Makefile.PL @@ -13,7 +13,7 @@ # limitations under the License. # # Exercise all regression tests: -# +# # make test # # Exersise one regression test: @@ -29,11 +29,11 @@ use Cwd; sub AutodetectWin32gcc { my $wrkdir = getcwd(); my $devnull = devnull(); - + my @incdir = (); my @libdir = ($wrkdir); my @bindir = (); - + #try to get configuration info via identify or convert utilities my $conf = `identify -list Configure 2>$devnull` || `convert -list Configure 2>$devnull`; foreach my $line (split '\n', $conf) { @@ -68,7 +68,7 @@ sub AutodetectWin32gcc { foreach (@i) { push @incdir, $_ if (-e "$_/magick/MagickCore.h") }; } }; - + foreach my $bin (@bindir) { opendir(my $bindir, $bin) or die qq{Cannot opendir $bin: $!}; my @dlls = map {catfile($bin, $_)} grep /^\S*magick[^\+]\S*?\.dll$/i, readdir $bindir; @@ -85,7 +85,7 @@ sub AutodetectWin32gcc { } last if -s "$wrkdir/libMagickCore.a"; } - + unless(@incdir && @libdir && @bindir && (-s "$wrkdir/libMagickCore.a")) { print STDERR <$devnull` || `convert -list format 2>$devnull`; + foreach my $line (split '\n', $conf) { + next unless $line =~ /^DELEGATES\s+/; + my (undef, @delegates) = split /\s+/, $line; + last; + }; + return @delegates; +} # Compute test specification my $delegate_tests='t/*.t'; -my $delegate; -foreach $delegate (qw/bzlib fontconfig freetype jpeg jng jp2 png tiff x11 xml zlib/) { - if ( -d "t/$delegate" ) { - if ( defined($ENV{'DISPLAY'}) && ($^O ne 'MSWin32') ) { - if ( defined $ENV{'DISPLAY'} ) { - $delegate_tests .= " t/$delegate/*.t"; +my @tested_delegates = qw/bzlib djvu fftw fontconfig freetype jpeg jng jp2 lcms mpeg png rsvg tiff x11 xml wmf zlib/; +my @supported_delegates = AutodetectDelegates(); +# find the intersection of tested and supported delegates +my %seen_delegates = (); +$seen_delegates{$_}++ for @supported_delegates; +foreach my $delegate (@tested_delegates) { + if ( $seen_delegates{$_} ) { + if ( -d "t/$delegate" ) { + if ( defined($ENV{'DISPLAY'}) && ($^O ne 'MSWin32') ) { + if ( defined $ENV{'DISPLAY'} ) { + $delegate_tests .= " t/$delegate/*.t"; + } + next; } - next; + $delegate_tests .= " t/$delegate/*.t"; } - $delegate_tests .= " t/$delegate/*.t"; } } @@ -174,7 +190,7 @@ WriteMakefile 'VERSION' => '6.6.4', # Preprocessor defines - 'DEFINE' => ' -D_LARGE_FILES=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING' + 'DEFINE' => ' -D_LARGE_FILES=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING' # Header search specfication and preprocessor flags 'INC' => $INC_magick, diff --git a/PerlMagick/Makefile.PL.in b/PerlMagick/Makefile.PL.in index 2ffcd70c0..f17956473 100644 --- a/PerlMagick/Makefile.PL.in +++ b/PerlMagick/Makefile.PL.in @@ -13,7 +13,7 @@ # limitations under the License. # # Exercise all regression tests: -# +# # make test # # Exersise one regression test: @@ -29,11 +29,11 @@ use Cwd; sub AutodetectWin32gcc { my $wrkdir = getcwd(); my $devnull = devnull(); - + my @incdir = (); my @libdir = ($wrkdir); my @bindir = (); - + #try to get configuration info via identify or convert utilities my $conf = `identify -list Configure 2>$devnull` || `convert -list Configure 2>$devnull`; foreach my $line (split '\n', $conf) { @@ -68,7 +68,7 @@ sub AutodetectWin32gcc { foreach (@i) { push @incdir, $_ if (-e "$_/magick/MagickCore.h") }; } }; - + foreach my $bin (@bindir) { opendir(my $bindir, $bin) or die qq{Cannot opendir $bin: $!}; my @dlls = map {catfile($bin, $_)} grep /^\S*magick[^\+]\S*?\.dll$/i, readdir $bindir; @@ -85,7 +85,7 @@ sub AutodetectWin32gcc { } last if -s "$wrkdir/libMagickCore.a"; } - + unless(@incdir && @libdir && @bindir && (-s "$wrkdir/libMagickCore.a")) { print STDERR <$devnull` || `convert -list format 2>$devnull`; + foreach my $line (split '\n', $conf) { + next unless $line =~ /^DELEGATES\s+/; + my (undef, @delegates) = split /\s+/, $line; + last; + }; + return @delegates; +} # Compute test specification my $delegate_tests='t/*.t'; -my $delegate; -foreach $delegate (qw/@DELEGATES@/) { - if ( -d "t/$delegate" ) { - if ( defined($ENV{'DISPLAY'}) && ($^O ne 'MSWin32') ) { - if ( defined $ENV{'DISPLAY'} ) { - $delegate_tests .= " t/$delegate/*.t"; +my @tested_delegates = qw/bzlib djvu fftw fontconfig freetype jpeg jng jp2 lcms mpeg png rsvg tiff x11 xml wmf zlib/; +my @supported_delegates = AutodetectDelegates(); +# find the intersection of tested and supported delegates +my %seen_delegates = (); +$seen_delegates{$_}++ for @supported_delegates; +foreach my $delegate (@tested_delegates) { + if ( $seen_delegates{$_} ) { + if ( -d "t/$delegate" ) { + if ( defined($ENV{'DISPLAY'}) && ($^O ne 'MSWin32') ) { + if ( defined $ENV{'DISPLAY'} ) { + $delegate_tests .= " t/$delegate/*.t"; + } + next; } - next; + $delegate_tests .= " t/$delegate/*.t"; } - $delegate_tests .= " t/$delegate/*.t"; } } @@ -174,7 +190,7 @@ WriteMakefile 'VERSION' => '@PACKAGE_VERSION@', # Preprocessor defines - 'DEFINE' => '@LFS_CPPFLAGS@ @DEFS@', # e.g., '-DHAVE_SOMETHING' + 'DEFINE' => '@LFS_CPPFLAGS@ @DEFS@', # e.g., '-DHAVE_SOMETHING' # Header search specfication and preprocessor flags 'INC' => $INC_magick, -- 2.50.1