]> git.imager.perl.org - imager.git/blobdiff - JPEG/Makefile.PL
avoid an unneeded check in the FT1 has_chars() method implementation
[imager.git] / JPEG / Makefile.PL
index 270fa11d33c0d0f17d78e21f492211dad29f875e..ab5a8615d9b73f97a573a4743b18ce915d7d0399 100644 (file)
@@ -1,6 +1,6 @@
 #!perl -w
 use strict;
-use ExtUtils::MakeMaker qw(WriteMakefile WriteEmptyMakefile);
+use ExtUtils::MakeMaker;
 use Getopt::Long;
 use Config;
 
@@ -13,16 +13,45 @@ GetOptions("incpath=s", \@incpaths,
            "verbose|v" => \$verbose);
 
 our $BUILDING_IMAGER;
-
-my $MM_ver = eval $ExtUtils::MakeMaker::VERSION;
+our %IMAGER_LIBS;
 
 my %opts = 
   (
    NAME => 'Imager::File::JPEG',
    VERSION_FROM => 'JPEG.pm',
-   OBJECT => 'JPEG.o imjpeg.o imexif.o',
+   OBJECT => 'JPEG.o imjpeg.o',
+   clean => { FILES => 'testout' },
   );
 
+if (eval { ExtUtils::MakeMaker->VERSION('6.46'); 1 }) {
+  $opts{LICENSE} = "perl_5";
+  $opts{AUTHOR} = 'Tony Cook <tonyc@cpan.org>';
+  $opts{ABSTRACT} = 'JPEG Image file support for Imager';
+  $opts{META_MERGE} =
+    {
+     'meta-spec' =>
+     {
+      version => "2",
+      url => "https://metacpan.org/pod/CPAN::Meta::Spec",
+     },
+     resources =>
+     {
+      homepage => "http://imager.perl.org/",
+      repository =>
+      {
+       type => "git",
+       url => "git://git.imager.perl.org/imager.git",
+       web => "http://git.imager.perl.org/imager.git",
+      },
+      bugtracker =>
+      {
+       web => "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Imager",
+       mailto => 'bug-Imager@rt.cpan.org',
+      },
+     },
+    };
+}
+
 my @inc;
 if ($BUILDING_IMAGER) {
   push @inc, "-I..";
@@ -36,33 +65,44 @@ else {
   $opts{TYPEMAPS} = [ Imager::ExtUtils->typemap ];
 
   # Imager required configure through use
-  my @Imager_req = ( Imager => "0.77" );
-  if ($MM_ver >= 6.46) {
-    $opts{META_MERGE} =
+  my @Imager_req = ( Imager => "1.008" );
+  if (eval { ExtUtils::MakeMaker->VERSION('6.46'); 1 }) {
+    $opts{META_MERGE}{prereqs} =
       {
-       configure_requires => 
+       configure =>
+       {
+       requires =>
+       {
+        @Imager_req,
+       },
+       },
+       build =>
        {
-       @Imager_req,
+       requires =>
+       {
+        @Imager_req,
+        "Test::More" => "0.47",
+       }
        },
-       build_requires => 
+       runtime =>
        {
-       @Imager_req,
-       "Test::More" => "0.47",
+       requires =>
+       {
+        @Imager_req,
+       }
        },
-       resources =>
+       test =>
        {
-       homepage => "http://imager.perl.org/",
-       repository =>
+       requires =>
        {
-        url => "http://imager.perl.org/svn/trunk/Imager-File-JPEG",
-        web => "http://imager.perl.org/svnweb/public/browse/trunk/Imager-File-JPEG",
-        type => "svn",
-       },
+        "Test::More" => "0.47",
+       }
        },
       };
     $opts{PREREQ_PM} =
       {
        @Imager_req,
+       XSLoader => 0,
       };
   }
 }
@@ -76,27 +116,27 @@ my %probe =
    libbase => "jpeg",
    testcode => _jpeg_test_code(),
    testcodeheaders => [ "stdio.h", "stddef.h", "jpeglib.h" ],
-   incpath => join($Config{path_sep}, @incpaths),
-   libpath => join($Config{path_sep}, @libpaths),
+   incpath => \@incpaths,
+   libpath => \@libpaths,
+   verbose => $verbose,
   );
 
 my $probe_res = Imager::Probe->probe(\%probe);
 if ($probe_res) {
+  $IMAGER_LIBS{JPEG} = 1;
+
   push @inc, $probe_res->{INC};
   $opts{LIBS} = $probe_res->{LIBS};
-  
+  $opts{DEFINE} = $probe_res->{DEFINE};
   $opts{INC} = "@inc";
-  
-  if ($MM_ver > 6.06) {
-    $opts{AUTHOR} = 'Tony Cook <tony@imager.perl.org>';
-    $opts{ABSTRACT} = 'JPEG Image file support';
-  }
-  
+
   WriteMakefile(%opts);
 }
 else {
+  $IMAGER_LIBS{JPEG} = 0;
+
   if ($BUILDING_IMAGER) {
-    WriteEmptyMakefile(%opts);
+    ExtUtils::MakeMaker::WriteEmptyMakefile(%opts);
   }
   else {
     # fail in good way