Skip Menu |

This queue is for tickets about the GD CPAN distribution.

Report information
The Basics
Id: 42083
Status: patched
Priority: 0/
Queue: GD

People
Owner: Nobody in particular
Requestors: gyles19 [...] visi.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.41
Fixed in: 2.41



Subject: Patched Makefile.PL to detect GD version below 2.0.28
I have GD 2.0.15 and that version already provides gdlib-config. The current Makefile.PL reads the version but does not check that it matches the minimum required version as in the README. This allows the build to proceed further than it should, and since the tests don't check for the version, they fail oddly on various missing symbols. I have attached a patch that enhances Makefile.PL to check for 2.0.28 and die if an older version is found. This honors the --ignore-missing-gd option. I tested my patch by running 'perl Makefile.PL' with my old libgd 2.0.15 to watch the install die with the new error. I also did this with the --ignore- missing-gd option, which built but failed its tests, as expected. Then I installed libgd 2.0.35 and ran 'perl Makefile.PL', which succeeded. And an FYI, the gd-2.0.35.tar.gz unpacks into directory gd-2.0.35, but it failed to make until I created an empty configure.in file, and then it built. However, the library installed reports its internal version as 2.0.34, so the libgd folks need to tweak the 2.0.35 build. The libgd website shows a fix for the version issue, but not the build issue I experienced.
Subject: add_GD_version_test.patch
diff --git a/Makefile.PL b/Makefile.PL index 4365139..cd99053 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -21,7 +21,7 @@ my ($options,$lib_gd_path,$lib_ft_path,$lib_png_path,$lib_jpeg_path,$lib_xpm_pat use Getopt::Long; GetOptions("ignore_missing_gd" => \$force); -unless (try_to_autoconfigure(\$options,\$lib_gd_path,\@INC,\@LIBPATH,\@LIBS) || $force) { +unless (try_to_autoconfigure(\$options,\$lib_gd_path,\@INC,\@LIBPATH,\@LIBS, $force) || $force) { die <<END; **UNRECOVERABLE ERROR** Could not find gdlib-config in the search path. Please install libgd 2.0.28 or higher. @@ -255,7 +255,7 @@ WriteMakefile( exit 0; sub try_to_autoconfigure { - my ($options,$lib_gd_path,$INC,$LIBPATH,$LIBS) = @_; + my ($options,$lib_gd_path,$INC,$LIBPATH,$LIBS,$force) = @_; my $config = `gdlib-config --all`; return unless $config; $AUTOCONFIG++; @@ -280,7 +280,8 @@ sub try_to_autoconfigure { $$options = $features; my ($major, $middle, $minor) = $version =~ /^(\d+)\.(\d+)\.(\d+)$/; - if ( !$force && (( $major < 2 ) or ( "$major.middle" eq "2.0" && $minor < 28 ) )) { + $DB::single=1; + if ( !$force && (( $major < 2 ) or ( "$major.$middle" eq "2.0" && $minor < 28 ) )) { die <<END; **UNRECOVERABLE ERROR** Your GD library version $version is too old. Please install libgd 2.0.28 or higher.
Subject: Patched Makefile.PL to detect GD version below 2.0.28 CORRECTED
I attached the wrong patch file on my original report. This is the correct patch file.
diff --git a/Makefile.PL b/Makefile.PL index 6a1ea34..ca43568 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -21,7 +21,7 @@ my ($options,$lib_gd_path,$lib_ft_path,$lib_png_path,$lib_jpeg_path,$lib_xpm_pat use Getopt::Long; GetOptions("ignore_missing_gd" => \$force); -unless (try_to_autoconfigure(\$options,\$lib_gd_path,\@INC,\@LIBPATH,\@LIBS) || $force) { +unless (try_to_autoconfigure(\$options,\$lib_gd_path,\@INC,\@LIBPATH,\@LIBS, $force) || $force) { die <<END; **UNRECOVERABLE ERROR** Could not find gdlib-config in the search path. Please install libgd 2.0.28 or higher. @@ -255,7 +255,7 @@ WriteMakefile( exit 0; sub try_to_autoconfigure { - my ($options,$lib_gd_path,$INC,$LIBPATH,$LIBS) = @_; + my ($options,$lib_gd_path,$INC,$LIBPATH,$LIBS,$force) = @_; my $config = `gdlib-config --all`; return unless $config; $AUTOCONFIG++; @@ -279,7 +279,14 @@ sub try_to_autoconfigure { ($$lib_gd_path = $libdir) =~ s!/[^/]+$!!; $$options = $features; - my ($minor) = $version =~ /^2\.\d+\.(\d+)$/; + my ($major, $middle, $minor) = $version =~ /^(\d+)\.(\d+)\.(\d+)$/; + if ( !$force && (( $major < 2 ) or ( "$major.$middle" eq "2.0" && $minor < 28 ) )) { + die <<END; +**UNRECOVERABLE ERROR** +Your GD library version $version is too old. Please install libgd 2.0.28 or higher. +If you want to try to compile anyway, please rerun this script with the option --ignore_missing_gd. +END + } $$options .= " GD_UNCLOSEDPOLY GD_ANIMGIF GD_FTCIRCLE VERSION_33" if defined($minor) && $minor >= 33; my @correct_inc = map {s/^-I// && $_} split /\s+/,$cflags;
I don't think this 2.0.28 check is needed anymore. We protected all old symbols with #ifdef VERSION_33 in the XS. But I haven't tested it yet with such an old libgd, will do eventually. -- Reini Urban