]> git.imager.perl.org - imager.git/blobdiff - PNG/Makefile.PL
note .dSYM clean up change
[imager.git] / PNG / Makefile.PL
index a73a684b0c954daa1a0ccdf18fd0d61f5e9c3d90..bc735966b66fc09bc58cfbf6b9d8ce4c95e80b1a 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,6 +13,7 @@ GetOptions("incpath=s", \@incpaths,
            "verbose|v" => \$verbose);
 
 our $BUILDING_IMAGER;
+our %IMAGER_LIBS;
 
 my $MM_ver = eval $ExtUtils::MakeMaker::VERSION;
 
@@ -37,7 +38,7 @@ else {
   $opts{TYPEMAPS} = [ Imager::ExtUtils->typemap ];
 
   # Imager required configure through use
-  my @Imager_req = ( Imager => "0.77" );
+  my @Imager_req = ( Imager => "0.90" );
   if ($MM_ver >= 6.46) {
     $opts{META_MERGE} =
       {
@@ -53,28 +54,49 @@ else {
        resources =>
        {
        homepage => "http://imager.perl.org/",
-       repository =>
-       {
-        url => "http://imager.perl.org/svn/trunk/Imager/PNG",
-        web => "http://imager.perl.org/svnweb/public/browse/trunk/Imager/PNG",
-        type => "svn",
-       },
+       repository => "git://git.imager.perl.org/imager.git",
+       bugtracker => "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Imager",
        },
       };
     $opts{PREREQ_PM} =
       {
        @Imager_req,
+       XSLoader => 0,
       };
   }
 }
 
 require Imager::Probe;
 
+my @alts =
+  (
+   {
+    altname => "v1.5",
+    incsuffix => "libpng15",
+    libbase => "png15",
+   },
+   {
+    altname => "v1.4",
+    incsuffix => "libpng14",
+    libbase => "png14",
+   },
+   {
+    altname => "v1.2",
+    incsuffix => "libpng12",
+    libbase => "png12",
+   },
+   {
+    altname => "v1.0",
+    incsuffix => "libpng10",
+    libbase => "png10",
+   },
+  );
+
 my %probe =
   (
    name => "PNG",
    altname => "Generic",
-   pkg => [ qw/libpng14 libpng12 libpng10 libpng/ ],
+   pkg => [ qw/libpng15 libpng14 libpng12 libpng10 libpng/ ],
    inccheck => sub { -e File::Spec->catfile($_[0], "png.h") },
    libbase => "png",
    testcode => _png_test_code(),
@@ -83,41 +105,42 @@ my %probe =
    libpath => \@libpaths,
    alternatives =>
    [
+    @alts,
     {
-     altname => "v1.4",
-     incsuffix => "libpng14",
-     libbase => "png14",
-    },
-    {
-     altname => "v1.2",
-     incsuffix => "libpng12",
-     libbase => "png12",
-    },
-    {
-     altname => "v1.0",
-     incsuffix => "libpng10",
-     libbase => "png10",
+     altname => "base (+libz)",
+     libbase => [ "png", "z" ],
     },
+    ( # a static libpng may require libz too
+     map +{
+          %$_,
+          altname => "$_->{altname} (+libz)",
+          libbase => [ $_->{libbase}, "z" ],
+         }, @alts
+    ),
    ],
   );
 
 my $probe_res = Imager::Probe->probe(\%probe);
 if ($probe_res) {
+  $IMAGER_LIBS{PNG} = 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{AUTHOR} = 'Tony Cook <tonyc@cpan.org>';
     $opts{ABSTRACT} = 'PNG Image file support';
   }
   
   WriteMakefile(%opts);
 }
 else {
+  $IMAGER_LIBS{PNG} = 0;
+
   if ($BUILDING_IMAGER) {
-    WriteEmptyMakefile(%opts);
+    ExtUtils::MakeMaker::WriteEmptyMakefile(%opts);
   }
   else {
     # fail in good way