3 use ExtUtils::MakeMaker;
8 use ExtUtils::Manifest qw(maniread);
10 use vars qw(%formats $VERBOSE $INCPATH $LIBPATH $NOLOG $DEBUG_MALLOC $MANUAL $CFLAGS $LFLAGS $DFLAGS);
14 # EU::MM runs Makefile.PL all in the same process, so sub-modules will
16 our $BUILDING_IMAGER = 1;
19 # IM_INCPATH colon seperated list of paths to extra include paths
20 # IM_LIBPATH colon seperated list of paths to extra library paths
22 # IM_VERBOSE turns on verbose mode for the library finding and such
23 # IM_MANUAL to manually select which libraries are used and which not
24 # IM_ENABLE to programmatically select which libraries are used
26 # IM_NOLOG if true logging will not be compiled into the module
27 # IM_DEBUG_MALLOC if true malloc debbuging will be compiled into the module
28 # do not use IM_DEBUG_MALLOC in production - this slows
29 # everything down by alot
30 # IM_CFLAGS Extra flags to pass to the compiler
31 # IM_LFLAGS Extra flags to pass to the linker
32 # IM_DFLAGS Extra flags to pass to the preprocessor
34 my $KEEP_FILES = $ENV{IMAGER_KEEP_FILES};
36 getenv(); # get environment variables
38 my $lext=$Config{'so'}; # Get extensions of libraries
39 my $aext=$Config{'_a'};
41 my $help; # display help if set
42 my @enable; # list of drivers to enable
43 my @disable; # or list of drivers to disable
44 my @incpaths; # places to look for headers
45 my @libpaths; # places to look for libraries
46 my $noexif; # non-zero to disable EXIF parsing of JPEGs
47 my $no_gif_set_version; # disable calling EGifSetGifVersion
48 my $coverage; # build for coverage testing
49 my $assert; # build with assertions
50 GetOptions("help" => \$help,
51 "enable=s" => \@enable,
52 "disable=s" => \@disable,
53 "incpath=s", \@incpaths,
54 "libpath=s" => \@libpaths,
55 "verbose|v" => \$VERBOSE,
58 "nogifsetversion" => \$no_gif_set_version,
59 'coverage' => \$coverage,
60 "assert|a" => \$assert);
64 if ($ENV{AUTOMATED_TESTING}) {
69 print "Verbose mode\n";
71 import Data::Dumper qw(Dumper);
80 if ($NOLOG) { print "Logging not compiled into module\n"; }
82 push @defines, [ IMAGER_LOG => 1, "Logging system" ];
86 push @defines, [ IM_ASSERT => 1, "im_assert() are effective" ];
90 push @defines, [ IMAGER_DEBUG_MALLOC => 1, "Use Imager's DEBUG malloc()" ];
91 print "Malloc debugging enabled\n";
94 if (@enable && @disable) {
95 print STDERR "Only --enable or --disable can be used, not both, try --help\n";
101 my @incs; # all the places to look for headers
102 my @libs; # all the places to look for libraries
104 init(); # initialize global data
105 pathcheck(); # Check if directories exist
107 if (exists $ENV{IM_ENABLE}) {
108 my %en = map { $_, 1 } split ' ', $ENV{IM_ENABLE};
109 for my $key (keys %formats) {
110 delete $formats{$key} unless $en{$key};
114 my %en = map { $_ => 1 } map { split /,/ } @enable;
115 for my $key (keys %formats) {
116 delete $formats{$key} unless $en{$key};
120 delete @formats{map { split /,/ } @disable};
123 # Pick what libraries are used
130 # Make sure there isn't a clash between the gif libraries.
137 for my $frmkey (sort { $formats{$a}{order} <=> $formats{$b}{order} } keys %formats) {
138 my $frm = $formats{$frmkey};
139 push @defines, [ $frm->{def}, 1, "$frmkey available" ];
140 $F_OBJECT .= ' ' .$frm->{objfiles};
141 if ($frm->{cflags}) {
142 $lib_cflags .= ' ' .$frm->{cflags};
143 ++$definc{$_} for map { /^-I(.*)$/ ? ($1) : () }
144 grep /^-I./, split ' ', $frm->{cflags};
146 if ($frm->{lflags}) {
147 $lib_lflags .= ' ' . $frm->{lflags};
150 $F_LIBS .= ' ' .$frm->{libfiles};
156 print "EXIF support enabled\n";
157 push @defines, [ 'IMEXIF_ENABLE', 1, "Enable experimental EXIF support" ];
158 $F_OBJECT .= ' imexif.o';
161 my $F_INC = join ' ', map "-I$_", map / / ? qq{"$_"} : $_,
162 grep !$definc{$_}, @incs;
163 $F_LIBS = join(' ',map "-L$_", map / / ? qq{"$_"} : $_,
164 grep !$deflib{$_}++, @libs) . $F_LIBS;
167 my $OSDEF = "-DOS_$^O";
169 if ($^O eq 'hpux') { $OSLIBS .= ' -ldld'; }
170 if (defined $Config{'d_dlsymun'}) { $OSDEF .= ' -DDLSYMUN'; }
172 my @objs = qw(Imager.o draw.o polygon.o image.o io.o iolayer.o
173 log.o gaussian.o conv.o pnm.o raw.o feat.o font.o
174 filters.o dynaload.o stackmach.o datatypes.o
175 regmach.o trans2.o quant.o error.o convert.o
176 map.o tags.o palimg.o maskimg.o img16.o rotate.o
177 bmp.o tga.o color.o fills.o imgdouble.o limits.o hlines.o
178 imext.o scale.o rubthru.o render.o paste.o compose.o flip.o);
182 'VERSION_FROM' => 'Imager.pm',
183 'LIBS' => "$LFLAGS -lm $lib_lflags $OSLIBS $F_LIBS",
184 'DEFINE' => "$OSDEF $CFLAGS",
185 'INC' => "$lib_cflags $DFLAGS $F_INC",
186 'OBJECT' => join(' ', @objs, $F_OBJECT),
187 clean => { FILES=>'testout rubthru.c scale.c conv.c filters.c gaussian.c render.c rubthru.c' },
189 PREREQ_PM => { 'Test::More' => 0.47 },
193 if ($Config{gccversion}) {
194 push @ARGV, 'OPTIMIZE=-ftest-coverage -fprofile-arcs';
195 #$opts{dynamic_lib} = { OTHERLDFLAGS => '-ftest-coverage -fprofile-arcs' };
198 die "Don't know the coverage C flags for your compiler\n";
202 # eval to prevent warnings about versions with _ in them
203 my $MM_ver = eval $ExtUtils::MakeMaker::VERSION;
204 if ($MM_ver > 6.06) {
205 $opts{AUTHOR} = 'Tony Cook <tony@imager.perl.org>, Arnar M. Hrafnkelsson';
206 $opts{ABSTRACT} = 'Perl extension for Generating 24 bit Images';
209 if ($MM_ver >= 6.46) {
214 "Parse::RecDescent" => 0
221 make_imconfig(\@defines);
223 if ($VERBOSE) { print Dumper(\%opts); }
224 mkdir('testout',0777); # since we cannot include it in the archive.
226 -d "probe" and rmdir "probe";
228 WriteMakefile(%opts);
235 my $perl = $self->{PERLRUN} ? '$(PERLRUN)' : '$(PERL)';
238 my @ims = grep /\.im$/, keys %$mani;
240 dyntest.$(MYEXTLIB) : dynfilt/Makefile
241 cd dynfilt && $(MAKE) $(PASTHRU)
243 lib/Imager/Regops.pm : regmach.h regops.perl
244 $(PERL) regops.perl regmach.h lib/Imager/Regops.pm
246 imconfig.h : Makefile.PL
247 $(ECHO) "imconfig.h out-of-date with respect to $?"
248 $(PERLRUN) Makefile.PL
249 $(ECHO) "==> Your Makefile has been rebuilt - re-run your make command <=="
251 lib/Imager/APIRef.pod : \$(C_FILES) \$(H_FILES) apidocs.perl
252 $perl apidocs.perl lib/Imager/APIRef.pod
254 !.join('', map _im_rule($perl, $_), @ims)
259 my ($perl, $im) = @_;
261 (my $c = $im) =~ s/\.im$/.c/;
264 $c: $im lib/Imager/Preprocess.pm
265 $perl -Ilib -MImager::Preprocess -epreprocess $im $c
271 # manual configuration of helper libraries
276 Please answer the following questions about
277 which formats are avaliable on your computer
279 press <return> to continue
282 <STDIN>; # eat one return
284 for my $frm(sort { $formats{$b}{order} <=> $formats{$a}{order} } keys %formats) {
286 if ($formats{$frm}{docs}) { print "\n",$formats{$frm}{docs},"\n\n"; }
287 print "Enable $frm support: ";
290 if ($gz =~ m/^(y|yes|n|no)/i) {
291 $gz=substr(lc($gz),0,1);
293 delete $formats{$frm};
300 # automatic configuration of helper libraries
303 print "Automatic probing:\n" if $VERBOSE;
304 for my $frm (sort { $formats{$a}{order} <=> $formats{$b}{order} } keys %formats) {
305 delete $formats{$frm} if !checkformat($frm);
311 if ($formats{'gif'} and $formats{'ungif'}) {
312 print "ungif and gif can not coexist - removing ungif support\n";
313 delete $formats{'ungif'};
316 for my $frm (qw(gif ungif)) {
317 checkformat($frm) if ($MANUAL and $formats{$frm});
321 for my $frm (grep $formats{$_}, qw(gif ungif)) {
322 push(@dirs, @{$formats{$frm}{incdir}}) if $formats{$frm}{incdir};
326 FILES: for my $dir (@dirs) {
327 my $h = "$dir/gif_lib.h";
328 open H, "< $h" or next;
330 if (/GIF_LIB_VERSION\s+"\s*version\s*(\d+)\.(\d+)/i) {
340 # we need the version in a #ifdefable form
342 push @defines, [ IM_GIFMAJOR => $major, "Parsed giflib version" ];
343 push @defines, [ IM_GIFMINOR => $minor ];
344 push @defines, [ IM_NO_SET_GIF_VERSION => 1, "Disable EGifSetGifVersion" ]
345 if $no_gif_set_version;
352 # print "checking path $path\n";
353 if ( !opendir(DH,$path) ) {
354 warn "Cannot open dir $path: $!\n";
357 my @l=grep { $chk->($_) } readdir(DH);
360 return map $path, @l;
364 my ($format, $frm) = @_;
366 my $lib_check=$formats{$frm}{'libcheck'};
367 my $inc_check=$formats{$frm}{'inccheck'};
372 push(@l, grep_directory($lp,$lib_check));
377 push(@i, $ip) if $inc_check->($ip,$frm);
380 printf("%10s: includes %s - libraries %s\n",$frm,(@i?'found':'not found'),(@l?'found':'not found'));
381 $formats{$frm}{incdir} = \@i;
382 $formats{$frm}{libdir} = \@l;
383 return 1 if scalar(@i && @l);
386 printf("%10s: not available\n", $frm);
395 print " checkformat($frm)\n" if $VERBOSE;
397 my $format = $formats{$frm};
400 if (my $code = $format->{'code'}) {
401 if (ref $code eq 'ARRAY') {
402 push @probes, @$code;
408 push @probes, \&_probe_default;
410 print " Calling probe function\n" if $VERBOSE;
412 for my $func (@probes) {
413 if ($func->($format, $frm)) {
421 if ($format->{postcheck}) {
422 print " Calling postcheck function\n" if $VERBOSE;
423 $format->{postcheck}->($format, $frm)
434 print " Include paths:\n";
435 for (@incs) { print $_,"\n"; }
437 @incs=grep { -d $_ && -r _ && -x _ or ( print(" $_ doesnt exist or is unaccessible - removed.\n"),0) } @incs;
440 print "\nLibrary paths:\n";
441 for (@libs) { print $_,"\n"; }
443 @libs=grep { -d $_ && -r _ && -x _ or ( print(" $_ doesnt exist or is unaccessible - removed.\n"),0) } @libs;
448 # Format data initialization
450 # format definition is:
452 # default include path
453 # files needed for include (boolean perl code)
456 # files needed for link (boolean perl code)
457 # object files needed for the format
462 my @definc = qw(/usr/include);
463 @definc{@definc}=(1) x @definc;
466 split(/\Q$Config{path_sep}/, $INCPATH),
467 map _tilde_expand($_), map { split /\Q$Config{path_sep}/ } @incpaths
469 if ($Config{locincpth}) {
470 push @incs, grep -d, split ' ', $Config{locincpth};
472 if ($^O =~ /win32/i && $Config{cc} =~ /\bcl\b/i) {
473 push(@incs, split /;/, $ENV{INCLUDE}) if exists $ENV{INCLUDE};
475 if ($Config{incpath}) {
476 push @incs, grep -d, split /\Q$Config{path_sep}/, $Config{incpath};
480 /usr/include/freetype2
481 /usr/local/include/freetype2
482 /usr/local/include/freetype1/freetype
483 /usr/include /usr/local/include /usr/include/freetype
484 /usr/local/include/freetype);
485 if ($Config{ccflags}) {
486 my @hidden = map { /^-I(.*)$/ ? ($1) : () } split ' ', $Config{ccflags};
488 @definc{@hidden} = (1) x @hidden;
491 @libs= ( split(/\Q$Config{path_sep}/,$LIBPATH),
492 map _tilde_expand($_), map { split /\Q$Config{path_sep}/} @libpaths );
493 if ($Config{loclibpth}) {
494 push @libs, grep -d, split ' ', $Config{loclibpth};
497 push @libs, grep -d, qw(/sw/lib), split(/ /, $Config{'libpth'});
498 push @libs, grep -d, split / /, $Config{libspath} if $Config{libspath};
499 if ($^O =~ /win32/i && $Config{cc} =~ /\bcl\b/i) {
500 push(@libs, split /;/, $ENV{LIB}) if exists $ENV{LIB};
502 if ($^O eq 'cygwin') {
503 push(@libs, '/usr/lib/w32api') if -d '/usr/lib/w32api';
504 push(@incs, '/usr/include/w32api') if -d '/usr/include/w32api';
506 if ($Config{ldflags}) {
507 # some builds of perl put -Ldir into ldflags without putting it in
508 # loclibpth, let's extract them
509 my @hidden = grep -d, map { /^-L(.*)$/ ? ($1) : () }
510 split ' ', $Config{ldflags};
512 # don't mark them as seen - EU::MM will remove any libraries
513 # it can't find and it doesn't look for -L in ldflags
514 #@deflib{@hidden} = @hidden;
516 push @libs, grep -d, qw(/usr/local/lib);
521 inccheck=>sub { -e catfile($_[0], 'jpeglib.h') },
522 libcheck=>sub { $_[0] eq "libjpeg$aext" or $_ eq "libjpeg.$lext" },
526 In order to use jpeg with this module you need to have libjpeg
527 installed on your computer}
533 inccheck=>sub { -e catfile($_[0], 'tiffio.h') },
534 libcheck=>sub { $_[0] eq "libtiff$aext" or $_ eq "libtiff.$lext" },
538 In order to use tiff with this module you need to have libtiff
539 installed on your computer},
540 postcheck => \&postcheck_tiff,
545 # def=>'HAVE_LIBPNG',
546 # inccheck=>sub { -e catfile($_[0], 'png.h') },
547 # libcheck=>sub { $_[0] eq "libpng$aext" or $_[0] eq "libpng.$lext" },
548 # libfiles=>$^O eq 'MSWin32' ? '-lpng -lzlib' : '-lpng -lz',
551 # Png stands for Portable Network Graphics and is intended as
552 # a replacement for gif on the web. It is patent free and
553 # is recommended by the w3c, you need libpng to use these formats},
554 # code => \&png_probe,
560 inccheck=>sub { -e catfile($_[0], 'gif_lib.h') },
561 libcheck=>sub { $_[0] eq "libgif$aext" or $_[0] eq "libgif.$lext" },
565 gif is the de facto standard for webgraphics at the moment,
566 it does have some patent problems. If you have giflib and
567 are not in violation with the unisys patent you should use
568 this instead of the 'ungif' option. Note that they cannot
569 be in use at the same time}
575 inccheck=>sub { -e catfile($_[0], 'gif_lib.h') },
576 libcheck=>sub { $_[0] eq "libungif$aext" or $_[0] eq "libungif.$lext" },
580 gif is the de facto standard for webgraphics at the moment,
581 it does have some patent problems. If you have libungif and
582 want to create images free from LZW patented compression you
583 should use this option instead of the 'gif' option}
586 $formats{'T1-fonts'}={
589 inccheck=>sub { -e catfile($_[0], 't1lib.h') },
590 libcheck=>sub { $_[0] eq "libt1$aext" or $_[0] eq "libt1.$lext" },
594 postscript t1 fonts are scalable fonts. They can include
595 ligatures and kerning information and generally yield good
596 visual quality. We depend on libt1 to rasterize the fonts
600 $formats{'TT-fonts'}=
604 inccheck=>sub { -e catfile($_[0], 'freetype.h')
605 && !-e catfile($_[0], 'fterrors.h') },
606 libcheck=>sub { $_[0] eq "libttf$aext" or $_[0] eq "libttf.$lext" },
609 code => \&freetype1_probe,
611 Truetype fonts are scalable fonts. They can include
612 kerning and hinting information and generally yield good
613 visual quality esp on low resultions. The freetype library is
614 used to rasterize for us. The only drawback is that there
615 are alot of badly designed fonts out there.}
620 inccheck=>sub { -e catfile($_[0], 'windows.h') },
621 libcheck=>sub { lc $_[0] eq 'gdi32.lib'
622 || lc $_[0] eq 'libgdi32.a' },
623 libfiles=>$^O eq 'cygwin' ? '-lgdi32' : '',
626 Uses the Win32 GDI for rendering text.
628 This currently only works on under normal Win32 and cygwin.
631 $formats{'freetype2'} =
635 # we always use a probe function
636 #inccheck=>sub { -e catfile($_[0], 'ft2build.h') },
637 #libcheck=>sub { $_[0] eq "libfreetype$aext" or $_[0] eq "libfreetype.$lext" },
638 libfiles=>'-lfreetype',
639 objfiles=>'freetyp2.o',
641 Freetype 2 supports both Truetype and Type 1 fonts, both of which are
642 scalable. It also supports a variety of other fonts.
646 \&freetype2_probe_ftconfig,
647 \&freetype2_probe_scan
652 for (keys %formats) { $formats{$_}->{docs} =~ s/^\s+/ /mg; }
659 defined($V) ? $V : "";
663 # Get information from environment variables
675 $DFLAGS) = map { gen $_ } qw(IM_VERBOSE
687 # populate the environment so that sub-modules get the same info
689 $ENV{IM_VERBOSE} = 1 if $VERBOSE;
690 $ENV{IM_INCPATH} = join $Config{path_sep}, @incpaths if @incpaths;
691 $ENV{IM_LIBPATH} = join $Config{path_sep}, @libpaths if @libpaths;
697 open CONFIG, "> imconfig.h"
698 or die "Cannot create imconfig.h: $!\n";
700 /* This file is automatically generated by Makefile.PL.
701 Don't edit this file, since any changes will be lost */
703 #ifndef IMAGER_IMCONFIG_H
704 #define IMAGER_IMCONFIG_H
706 for my $define (@$defines) {
708 print CONFIG "\n/*\n $define->[2]\n*/\n\n";
710 print CONFIG "#define $define->[0] $define->[1]\n";
712 print CONFIG "\n#endif\n";
716 # use pkg-config to probe for libraries
717 # works around the junk that pkg-config dumps on FreeBSD
721 is_exe('pkg-config') or return;
723 my $redir = $^O eq 'MSWin32' ? '' : '2>/dev/null';
725 !system("pkg-config $pkg --exists $redir");
728 # probes for freetype1 by scanning @incs for the includes and
729 # @libs for the libs. This is done separately because freetype's headers
730 # are stored in a freetype or freetype1 directory under PREFIX/include.
732 # we could find the files with the existing mechanism, but it won't set
733 # -I flags correctly.
735 # This could be extended to freetype2 too, but freetype-config catches
737 sub freetype1_probe {
738 my ($frm, $frmkey) = @_;
742 for my $inc (@incs) {
743 for my $subdir (qw/freetype freetype1/) {
744 my $path = File::Spec->catfile($inc, $subdir, 'freetype.h');
746 $path = File::Spec->catfile($inc, $subdir, 'fterrors.h');
749 $found_inc = File::Spec->catdir($inc, $subdir);
756 for my $lib (@libs) {
757 my $a_path = File::Spec->catfile($lib, "libttf$aext");
758 my $l_path = File::Spec->catfile($lib, "libttf.$lext");
759 if (-e $a_path || -e $l_path) {
765 return unless $found_inc && $found_lib;
766 printf("%10s: includes %s - libraries %s\n", $frmkey,
767 ($found_inc ? 'found' : 'not found'),
768 ($found_lib ? 'found' : 'not found'));
770 $frm->{cflags} = "-I$found_inc";
771 $frm->{libfiles} = "-lttf";
776 # probes for freetype2 by trying to run freetype-config
777 sub freetype2_probe_ftconfig {
778 my ($frm, $frmkey) = @_;
780 is_exe('freetype-config') or return;
782 my $cflags = `freetype-config --cflags`
786 my $lflags = `freetype-config --libs`
790 # before 2.1.5 freetype-config --cflags could output
791 # the -I options in the wrong order, causing a conflict with
792 # freetype1.x installed with the same --prefix
795 # - both -Iprefix/include and -Iprefix/include/freetype2 are in cflags
797 # - freetype 1.x headers are in prefix/include/freetype
798 my @incdirs = map substr($_, 2), grep /^-I/, split ' ', $cflags;
800 && $incdirs[1] eq "$incdirs[0]/freetype2"
801 && -e "$incdirs[0]/freetype/freetype.h"
802 && -e "$incdirs[0]/freetype/fterrid.h") {
803 print "** freetype-config provided -I options out of order, correcting\n"
805 $cflags = join(' ', grep(!/-I/, split ' ', $cflags),
806 map "-I$_", reverse @incdirs);
808 $frm->{cflags} = $cflags;
809 $frm->{lflags} = $lflags;
811 printf "%10s: configured via freetype-config\n", $frmkey;
816 # attempt to probe for freetype2 by scanning directories
817 # we can't use the normal scan since we need to find the directory
818 # containing most of the includes
819 sub freetype2_probe_scan {
820 my ($frm, $frmkey) = @_;
825 for my $inc (@incs) {
826 my $path = File::Spec->catfile($inc, 'ft2build.h');
829 # try to find what it's including
831 open FT2BUILD, "< $path"
834 if (m!^\s*\#\s*include\s+<([\w/.]+)>!
835 || m!^\s*\#\s*include\s+"([\w/.]+)"!) {
843 # non-Unix installs put this directly under the same directory in
845 if (-e File::Spec->catfile($inc, $ftheader)) {
849 for my $subdir (qw/freetype2 freetype/) {
850 $path = File::Spec->catfile($inc, $subdir, 'fterrors.h');
854 $found_inc2 = File::Spec->catdir($inc, $subdir);
861 for my $lib (@libs) {
862 my $a_path = File::Spec->catfile($lib, "libfreetype$aext");
863 my $l_path = File::Spec->catfile($lib, "libfreetype.$lext");
864 if (-e $a_path || -e $l_path) {
870 printf("%10s: includes %s - libraries %s\n", $frmkey,
871 ($found_inc ? 'found' : 'not found'),
872 ($found_lib ? 'found' : 'not found'));
874 return unless $found_inc && $found_lib;
876 $frm->{cflags} = _make_I($found_inc);
877 $frm->{cflags} .= " " . _make_I($found_inc2) if $found_inc2;
878 $frm->{libfiles} = "-lfreetype";
889 $inc_dir =~ / / ? qq!-I"$inc_dir"! : "-I$inc_dir";
892 # probes for libpng via pkg-config
894 my ($frm, $frmkey) = @_;
896 is_exe('pkg-config') or return;
899 for my $check_conf (qw(libpng libpng12 libpng10)) {
900 if (_pkg_probe($check_conf)) {
901 $config = $check_conf;
907 my $cflags = `pkg-config $config --cflags`
910 my $lflags = `pkg-config $config --libs`
915 $frm->{cflags} = $cflags;
916 $frm->{lflags} = $lflags;
918 printf "%10s: configured via `pkg-config $config ...`\n", $frmkey;
924 return File::Spec->catfile(@_);
930 my @exe_suffix = $Config{_exe};
931 if ($^O eq 'MSWin32') {
932 push @exe_suffix, qw/.bat .cmd/;
935 for my $dir (File::Spec->path) {
936 for my $suffix (@exe_suffix) {
937 -x catfile($dir, "$name$suffix")
947 Usage: $0 [--enable feature1,feature2,...] [other options]
948 $0 [--disable feature1,feature2,...] [other options]
950 Possible feature names are:
951 png gif ungif jpeg tiff T1-fonts TT-fonts freetype2
954 Verbose library probing (or set IM_VERBOSE in the environment)
956 Disable logging (or set IM_NOLOG in the environment)
958 Add to the include search path
960 Add to the library search path
962 Build for coverage testing.
964 Build with assertions active.
966 Disable EXIF parsing.
972 # generate the PM MM argument
973 # I'd prefer to modify the public version, but there doesn't seem to be
974 # a public API to do that
977 my $instbase = '$(INST_LIBDIR)';
979 # first the basics, .pm and .pod files
980 $pm{"Imager.pm"} = "$instbase/Imager.pm";
982 my $mani = maniread();
984 for my $filename (keys %$mani) {
985 if ($filename =~ m!^lib/! && $filename =~ /\.(pm|pod)$/) {
986 (my $work = $filename) =~ s/^lib//;
987 $pm{$filename} = $instbase . $work;
992 $pm{typemap} = $instbase . '/Imager/typemap';
994 # and the core headers
995 for my $filename (keys %$mani) {
996 if ($filename =~ /^\w+\.h$/) {
997 $pm{$filename} = $instbase . '/Imager/include/' . $filename;
1001 # and the generated header
1002 $pm{"imconfig.h"} = $instbase . '/Imager/include/imconfig.h';
1011 if ($path =~ m!^~[/\\]!) {
1012 defined $home or $home = $ENV{HOME};
1013 if (!defined $home && $^O eq 'MSWin32'
1014 && defined $ENV{HOMEDRIVE} && defined $ENV{HOMEPATH}) {
1015 $home = $ENV{HOMEDRIVE} . $ENV{HOMEPATH};
1017 unless (defined $home) {
1018 $home = eval { (getpwuid($<))[7] };
1020 defined $home or die "You supplied $path, but I can't find your home directory\n";
1022 $path = File::Spec->catdir($home, $path);
1028 sub postcheck_tiff {
1029 my ($format, $frm) = @_;
1031 -d "probe" or mkdir "probe";
1033 my $tiffver_name = "probe/tiffver.txt";
1036 if ($Config{cc} =~ /\b(cl|bcc)\b/) {
1043 # setup LD_RUN_PATH to match link time
1044 my $lopts = join " " , map("-L$_", @{$format->{libdir}}), " -ltiff";
1045 my ($extra, $bs_load, $ld_load, $ld_run_path) =
1046 ExtUtils::Liblist->ext($lopts, $VERBOSE);
1047 local $ENV{LD_RUN_PATH};
1050 print "Setting LD_RUN_PATH=$ld_run_path for TIFF probe\n" if $VERBOSE;
1051 $ENV{LD_RUN_PATH} = $ld_run_path;
1059 incpath => $format->{incdir},
1060 libpath => $format->{libdir},
1062 header => [ qw(stdio.h tiffio.h) ],
1063 function => <<FUNCTION,
1065 const char *vers = TIFFGetVersion();
1066 FILE *f = fopen("$tiffver_name", "wb");
1079 unless ($good && -s $tiffver_name
1080 && open(VERS, "< $tiffver_name")) {
1081 unlink $tiffver_name unless $KEEP_FILES;
1083 **tiff: cannot determine libtiff version number
1089 # version file seems to be there, load it up
1090 my $ver_str = do { local $/; <VERS> };
1092 unlink $tiffver_name unless $KEEP_FILES;
1094 my ($version) = $ver_str =~ /(\d+\.\d+\.\d+)/;
1096 if ($version eq '3.9.0') {
1098 **tiff: libtiff 3.9.0 introduced a serious bug, please install 3.9.1
1107 # This isn't a module, but some broken tools, like
1108 # Module::Depends::Instrusive insist on treating it like one.
1110 # http://rt.cpan.org/Public/Bug/Display.html?id=21229