]> git.imager.perl.org - imager.git/blobdiff - Makefile.PL
avoid ignoring the result of i_io_getc()
[imager.git] / Makefile.PL
index 835ecb6f67027bd77640cab3af82cfbd906b9f91..80ceb9944c332bd473cff3b5d8733607c0145921 100644 (file)
@@ -150,7 +150,7 @@ my @objs = qw(Imager.o context.o draw.o polygon.o image.o io.o iolayer.o
               map.o tags.o palimg.o maskimg.o img8.o img16.o rotate.o
               bmp.o tga.o color.o fills.o imgdouble.o limits.o hlines.o
               imext.o scale.o rubthru.o render.o paste.o compose.o flip.o
-             perlio.o);
+             perlio.o imexif.o);
 
 my $lib_define = '';
 my $lib_inc = '';
@@ -239,22 +239,50 @@ if ($coverage) {
     }
 }
 
-# eval to prevent warnings about versions with _ in them
-my $MM_ver = eval $ExtUtils::MakeMaker::VERSION;
-if ($MM_ver > 6.06) {
+if (eval { ExtUtils::MakeMaker->VERSION('6.06'); 1 }) {
   $opts{AUTHOR} = 'Tony Cook <tonyc@cpan.org>, Arnar M. Hrafnkelsson';
   $opts{ABSTRACT} = 'Perl extension for Generating 24 bit Images';
 }
 
-if ($MM_ver >= 6.46) {
+if (eval { ExtUtils::MakeMaker->VERSION('6.46'); 1 }) {
+  $opts{LICENSE} = "perl_5";
   $opts{META_MERGE} =
     {
-     recommends =>
+     'meta-spec' =>
      {
-      "Parse::RecDescent" => 0
+      version => "2",
+      url => "https://metacpan.org/pod/CPAN::Meta::Spec",
      },
-     license => "perl",
-     dynamic_config => 1,
+     prereqs =>
+     {
+      runtime =>
+      {
+       recommends =>
+       {
+        "Parse::RecDescent" => 0
+       },
+       requires =>
+       {
+       'Scalar::Util' => "1.00",
+       XSLoader => 0,
+       },
+      },
+      build =>
+      {
+       requires =>
+       {
+       XSLoader => 0,
+       },
+      },
+      test =>
+      {
+       requires =>
+       {
+       'Test::More' => "0.99",
+       },
+      },
+     },
+     dynamic_config => 0,
      no_index =>
      {
       directory =>
@@ -271,15 +299,22 @@ if ($MM_ver >= 6.46) {
      resources =>
      {
       homepage => "http://imager.perl.org/",
-      repository => "git://git.imager.perl.org/imager.git",
-      bugtracker => "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Imager",
+      repository =>
+      {
+       url => "git://git.imager.perl.org/imager.git",
+       web => "http://git.imager.perl.org/imager.git",
+       type => "git",
+      },
+      bugtracker =>
+      {
+       web => "https://rt.cpan.org/Dist/Display.html?Name=Imager",
+       mailto => 'bug-Imager@rt.cpan.org',
+      },
      },
     };
 }
 
-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 +593,7 @@ sub setenv {
 }
 
 sub make_imconfig {
-  my ($defines, $ivdformat) = @_;
+  my ($defines) = @_;
 
   open CONFIG, "> imconfig.h"
     or die "Cannot create imconfig.h: $!\n";
@@ -611,7 +646,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 +678,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 => <<CODE,
-char buf[80];
-$Config{ivtype} x = 10;
-sprintf(buf, "%" $fmt " %" $fmt, x, x);
-if (strcmp(buf, "10 10")) {
-    printf("ivformat: " $fmt " is invalid\n");
-    return 1;
-}
-CODE
-      );
-}
-
 # generate the PM MM argument
 # I'd prefer to modify the public version, but there doesn't seem to be 
 # a public API to do that
@@ -750,7 +742,7 @@ TT_Error error;
 error = TT_Init_FreeType(&engine);
 if (error) {
    printf("FT1: Could not initialize engine\n");
-   return 1;
+   exit(1);
 }
 
 return 0;