From: cristy Date: Fri, 9 Oct 2009 01:49:39 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~10554 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e9d0a41e3565c2dc0e11166cc18122a7314a1069;p=imagemagick --- diff --git a/PerlMagick/Changelog b/PerlMagick/Changelog index 24efdefc2..e99641d2f 100644 --- a/PerlMagick/Changelog +++ b/PerlMagick/Changelog @@ -1,3 +1,6 @@ +2009-10-08 6.5.6-10 + * Improve PerlMagick.PL to work with Strawberry Perl under Windows. + 2009-08-02 6.5.4-8 Cristy * Create a image registry to track which image objects must be cloned when a Perl thread is created. diff --git a/PerlMagick/Makefile.PL b/PerlMagick/Makefile.PL index 397d39b9d..a17c7b5e6 100644 --- a/PerlMagick/Makefile.PL +++ b/PerlMagick/Makefile.PL @@ -23,6 +23,105 @@ use ExtUtils::MakeMaker; use Config; +use File::Spec::Functions qw/catfile catdir devnull catpath splitpath/; +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) { + if ($line =~ /^Path:\s+(.*)/) { + my ($vol,$dir,$file) = splitpath($1); + next unless $dir; + my $dirpath = catpath( $vol, $dir); + my (@l,@b,@i) = ( (),(),() ); + + # try to detect 'lib' dir + push @l, catfile($dirpath,'..','lib'); + push @l, catfile($dirpath,'..','..','lib'); + push @l, catfile($dirpath,'..','..','..','lib'); + foreach (@l) { push @libdir, $_ if (-d $_) }; + + # try to detect 'bin' dir + push @b, catfile($dirpath,'..'); + push @b, catfile($dirpath,'..','bin'); + push @b, catfile($dirpath,'..','..'); + push @b, catfile($dirpath,'..','..','bin'); + push @b, catfile($dirpath,'..','..','..'); + push @b, catfile($dirpath,'..','..','..','bin'); + foreach (@b) { push @bindir, $_ if (-e "$_/convert.exe" || -e "$_/identify.exe") }; + + # try to detect 'include' dir + push @i, catfile($dirpath,'..','include'); + push @i, catfile($dirpath,'..','include','ImageMagick'); + push @i, catfile($dirpath,'..','..','include'); + push @i, catfile($dirpath,'..','..','include','ImageMagick'); + push @i, catfile($dirpath,'..','..','..','include'); + push @i, catfile($dirpath,'..','..','..','include','ImageMagick'); + 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; + foreach my $d (@dlls) { + unlink "$wrkdir/libMagickCore.def", "$wrkdir/libMagickCore.a"; + system("pexports \"$d\" >\"$wrkdir/libMagickCore.def\" 2>$devnull"); + open(DEF, "<$wrkdir/libMagickCore.def"); + my @found = grep(/InitializeMagickResources/, ); #checking if we have taken the right DLL + close(DEF); + next unless(@found); + print STDERR "Gonna create 'libMagickCore.a' from '$d'\n"; + system("dlltool -D \"$d\" -d \"$wrkdir/libMagickCore.def\" -l \"$wrkdir/libMagickCore.a\" 2>$devnull"); + last if -s "$wrkdir/libMagickCore.a"; + } + last if -s "$wrkdir/libMagickCore.a"; + } + + unless(@incdir && @libdir && @bindir && (-s "$wrkdir/libMagickCore.a")) { + print STDERR < ' -D_LARGE_FILES=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING' # Header search specfication and preprocessor flags - 'INC' => '-I../ -I.. -I/usr/include/freetype2 -I/usr/include/libxml2 -I"' . $Config{'usrinc'} . '/ImageMagick"', + 'INC' => $INC_magick, # C compiler #'CC' => 'gcc -std=gnu99', @@ -68,7 +177,7 @@ WriteMakefile # 'CPPFLAGS' => "$Config{'cppflags'} -I/usr/include/freetype2 -I/usr/include/libxml2", # C compiler flags (e.g. -O -g) - 'CCFLAGS' => "$Config{'ccflags'} -fopenmp -g -O2 -Wall -W -pthread", + 'CCFLAGS' => $CCFLAGS_magick, # Linker #'LD' => $Config{'ld'} == $Config{'cc'} ? 'gcc -std=gnu99' : $Config{'ld'}, @@ -83,7 +192,7 @@ WriteMakefile 'INSTALLBIN' => '/usr/local/bin', # Library specification - 'LIBS' => [ '-L../magick/.libs -lMagickCore -L../wand/.libs -lperl -lm' ], + 'LIBS' => [ $LIBS_magick ], # Perl binary name (if a Perl binary is built) 'MAP_TARGET' => 'PerlMagick', diff --git a/PerlMagick/Makefile.PL.in b/PerlMagick/Makefile.PL.in index e188cf218..4066e2f05 100644 --- a/PerlMagick/Makefile.PL.in +++ b/PerlMagick/Makefile.PL.in @@ -23,6 +23,105 @@ use ExtUtils::MakeMaker; use Config; +use File::Spec::Functions qw/catfile catdir devnull catpath splitpath/; +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) { + if ($line =~ /^Path:\s+(.*)/) { + my ($vol,$dir,$file) = splitpath($1); + next unless $dir; + my $dirpath = catpath( $vol, $dir); + my (@l,@b,@i) = ( (),(),() ); + + # try to detect 'lib' dir + push @l, catfile($dirpath,'..','lib'); + push @l, catfile($dirpath,'..','..','lib'); + push @l, catfile($dirpath,'..','..','..','lib'); + foreach (@l) { push @libdir, $_ if (-d $_) }; + + # try to detect 'bin' dir + push @b, catfile($dirpath,'..'); + push @b, catfile($dirpath,'..','bin'); + push @b, catfile($dirpath,'..','..'); + push @b, catfile($dirpath,'..','..','bin'); + push @b, catfile($dirpath,'..','..','..'); + push @b, catfile($dirpath,'..','..','..','bin'); + foreach (@b) { push @bindir, $_ if (-e "$_/convert.exe" || -e "$_/identify.exe") }; + + # try to detect 'include' dir + push @i, catfile($dirpath,'..','include'); + push @i, catfile($dirpath,'..','include','ImageMagick'); + push @i, catfile($dirpath,'..','..','include'); + push @i, catfile($dirpath,'..','..','include','ImageMagick'); + push @i, catfile($dirpath,'..','..','..','include'); + push @i, catfile($dirpath,'..','..','..','include','ImageMagick'); + 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; + foreach my $d (@dlls) { + unlink "$wrkdir/libMagickCore.def", "$wrkdir/libMagickCore.a"; + system("pexports \"$d\" >\"$wrkdir/libMagickCore.def\" 2>$devnull"); + open(DEF, "<$wrkdir/libMagickCore.def"); + my @found = grep(/InitializeMagickResources/, ); #checking if we have taken the right DLL + close(DEF); + next unless(@found); + print STDERR "Gonna create 'libMagickCore.a' from '$d'\n"; + system("dlltool -D \"$d\" -d \"$wrkdir/libMagickCore.def\" -l \"$wrkdir/libMagickCore.a\" 2>$devnull"); + last if -s "$wrkdir/libMagickCore.a"; + } + last if -s "$wrkdir/libMagickCore.a"; + } + + unless(@incdir && @libdir && @bindir && (-s "$wrkdir/libMagickCore.a")) { + print STDERR < '@LFS_CPPFLAGS@ @DEFS@', # e.g., '-DHAVE_SOMETHING' # Header search specfication and preprocessor flags - 'INC' => '-I../ -I@top_srcdir@ @CPPFLAGS@ -I"' . $Config{'usrinc'} . '/ImageMagick"', + 'INC' => $INC_magick, # C compiler #'CC' => '@CC@', @@ -68,7 +177,7 @@ WriteMakefile # 'CPPFLAGS' => "$Config{'cppflags'} @CPPFLAGS@", # C compiler flags (e.g. -O -g) - 'CCFLAGS' => "$Config{'ccflags'} @CFLAGS@", + 'CCFLAGS' => $CCFLAGS_magick, # Linker #'LD' => $Config{'ld'} == $Config{'cc'} ? '@CC@' : $Config{'ld'}, @@ -83,7 +192,7 @@ WriteMakefile 'INSTALLBIN' => '@BIN_DIR@', # Library specification - 'LIBS' => [ '-L../magick/.libs -lMagickCore -L../wand/.libs -lperl @MATH_LIBS@' ], + 'LIBS' => [ $LIBS_magick ], # Perl binary name (if a Perl binary is built) 'MAP_TARGET' => 'PerlMagick', diff --git a/config/configure.xml b/config/configure.xml index d1609d233..4f983ae53 100644 --- a/config/configure.xml +++ b/config/configure.xml @@ -9,7 +9,7 @@ - + diff --git a/magick/version.h b/magick/version.h index 748ec077c..a6484d8c4 100644 --- a/magick/version.h +++ b/magick/version.h @@ -31,7 +31,7 @@ extern "C" { #define MagickLibVersionText "6.5.6" #define MagickLibVersionNumber 2,0,0 #define MagickLibSubversion "-10" -#define MagickReleaseDate "2009-10-06" +#define MagickReleaseDate "2009-10-08" #define MagickChangeDate "20091004" #define MagickAuthoritativeURL "http://www.imagemagick.org" #define MagickHomeURL "file:///usr/local/share/doc/ImageMagick-6.5.6/index.html"