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',
24 clean => { FILES => 'testout' },
28 if ($BUILDING_IMAGER) {
30 unshift @INC, "../lib";
34 print "PNG: building independently\n";
35 require Imager::ExtUtils;
36 push @inc, Imager::ExtUtils->includes;
37 $opts{TYPEMAPS} = [ Imager::ExtUtils->typemap ];
39 # Imager required configure through use
40 my @Imager_req = ( Imager => "0.78" );
41 if ($MM_ver >= 6.46) {
51 "Test::More" => "0.47",
55 homepage => "http://imager.perl.org/",
58 url => "http://imager.perl.org/svn/trunk/Imager/PNG",
59 web => "http://imager.perl.org/svnweb/public/browse/trunk/Imager/PNG",
71 require Imager::Probe;
77 pkg => [ qw/libpng14 libpng12 libpng10 libpng/ ],
78 inccheck => sub { -e File::Spec->catfile($_[0], "png.h") },
80 testcode => _png_test_code(),
81 testcodeheaders => [ "png.h", "stdio.h" ],
82 incpath => \@incpaths,
83 libpath => \@libpaths,
88 incsuffix => "libpng14",
93 incsuffix => "libpng12",
98 incsuffix => "libpng10",
104 my $probe_res = Imager::Probe->probe(\%probe);
106 push @inc, $probe_res->{INC};
107 $opts{LIBS} = $probe_res->{LIBS};
111 if ($MM_ver > 6.06) {
112 $opts{AUTHOR} = 'Tony Cook <tony@imager.perl.org>';
113 $opts{ABSTRACT} = 'PNG Image file support';
116 WriteMakefile(%opts);
119 if ($BUILDING_IMAGER) {
120 WriteEmptyMakefile(%opts);
124 die "OS unsupported: PNG libraries or headers not found\n";
131 fprintf(stderr, "PNG: library version %ld, header version %ld\n", (long)png_access_version_number(), (long)PNG_LIBPNG_VER);