3 use ExtUtils::MakeMaker qw(WriteMakefile WriteEmptyMakefile);
7 my $verbose = $ENV{IM_VERBOSE};
11 GetOptions("incpath=s", \@incpaths,
12 "libpath=s" => \@libpaths,
13 "verbose|v" => \$verbose);
17 my $MM_ver = eval $ExtUtils::MakeMaker::VERSION;
21 NAME => 'Imager::File::PNG',
22 VERSION_FROM => 'PNG.pm',
23 OBJECT => 'PNG.o impng.o',
27 if ($BUILDING_IMAGER) {
29 unshift @INC, "../lib";
33 print "PNG: building independently\n";
34 require Imager::ExtUtils;
35 push @inc, Imager::ExtUtils->includes;
36 $opts{TYPEMAPS} = [ Imager::ExtUtils->typemap ];
38 # Imager required configure through use
39 my @Imager_req = ( Imager => "0.77" );
40 if ($MM_ver >= 6.46) {
50 "Test::More" => "0.47",
54 homepage => "http://imager.perl.org/",
57 url => "http://imager.perl.org/svn/trunk/Imager-File-PNG",
58 web => "http://imager.perl.org/svnweb/public/browse/trunk/Imager-File-PNG",
70 require Imager::Probe;
76 pkg => [ qw/libpng14 libpng12 libpng10 libpng/ ],
77 inccheck => sub { -e File::Spec->catfile($_[0], "png.h") },
79 testcode => _png_test_code(),
80 testcodeheaders => [ "png.h", "stdio.h" ],
81 incpath => join($Config{path_sep}, @incpaths),
82 libpath => join($Config{path_sep}, @libpaths),
87 incsuffix => "libpng14",
92 incsuffix => "libpng12",
97 incsuffix => "libpng10",
103 my $probe_res = Imager::Probe->probe(\%probe);
105 push @inc, $probe_res->{INC};
106 $opts{LIBS} = $probe_res->{LIBS};
110 if ($MM_ver > 6.06) {
111 $opts{AUTHOR} = 'Tony Cook <tony@imager.perl.org>';
112 $opts{ABSTRACT} = 'PNG Image file support';
115 WriteMakefile(%opts);
118 if ($BUILDING_IMAGER) {
119 WriteEmptyMakefile(%opts);
123 die "OS unsupported: PNG libraries or headers not found\n";
130 fprintf(stderr, "PNG: library version %ld, header version %ld\n", (long)png_access_version_number(), (long)PNG_LIBPNG_VER);