From: Tony Cook Date: Fri, 15 Apr 2016 23:35:13 +0000 (+1000) Subject: Revert the ivdformat probing X-Git-Tag: v1.005~2 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/9318b8f1a5f7e80b1dcd241710f5b5339f08b25f Revert the ivdformat probing Devel::CheckLib isn't really capable of probing standard library functions - it wants a library name to probe for and the standard library functions aren't always loaded from something called "libc.ext". Due to the structure of Devel::CheckLib if you don't provide a library name to probe for the running code checks are skipped entirely, passing by default. So remove this for now. I have a work-in-progress branch with a modified Devel::CheckLib, but since I push Devel::CheckLib changes out to the JPEG, TIFF, etc dists it would mean meaningless new releases for those too. Meaningless because the changes to D::CL would have no effect on them beyond a version bump. --- diff --git a/Makefile.PL b/Makefile.PL index 835ecb6f..abf50602 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -277,9 +277,7 @@ if ($MM_ver >= 6.46) { }; } -my $ivdformat = probe_ivdformat(); - -make_imconfig(\@defines, $ivdformat); +make_imconfig(\@defines); if ($VERBOSE) { print Dumper(\%opts); } mkdir('testout',0777); # since we cannot include it in the archive. @@ -558,7 +556,7 @@ sub setenv { } sub make_imconfig { - my ($defines, $ivdformat) = @_; + my ($defines) = @_; open CONFIG, "> imconfig.h" or die "Cannot create imconfig.h: $!\n"; @@ -611,7 +609,7 @@ EOS This is intended for formatting i_img_dim values. */ typedef $Config{ivtype} i_dim_format_t; -#define i_DF $ivdformat +#define i_DF $Config{ivdformat} EOS print CONFIG "\n#endif\n"; @@ -643,49 +641,6 @@ EOS } -# at least one CPAN tester has an incorrect ivdformat, make sure it's -# valid. -# Or at least it isn't valid with the built-in sprintf() -sub probe_ivdformat { - if (_test_ivdformat($Config{ivdformat})) { - return $Config{ivdformat}; - } - my @test_fmt = grep $_ ne $Config{ivdformat}, qw(ld d lld zd I64d); - for my $fmt (@test_fmt) { - if (_test_ivdformat($fmt)) { - print "ivdformat: Found a valid ivdformat\n"; - return $fmt; - } - } - die "OS unsupported: Invalid ivdformat ($Config{ivdformat}) in this perl\n"; -} - -sub _test_ivdformat { - my ($fmt) = @_; - require Devel::CheckLib; - my @headers = ( "stdio.h", "string.h" ); - if ($Config{i_inttypes}) { - push @headers, "inttypes.h"; - } - my $good = - Devel::CheckLib::check_lib - ( - debug => $VERBOSE, - LIBS => [], - INC => "", - header => \@headers, - function => <