my $KEEP_FILES = $ENV{IMAGER_KEEP_FILES};
+# make sure --verbose will dump environment settings
+if (grep $_ =~ /^--?v(?:erbose)?$/, @ARGV) {
+ $VERBOSE = 1;
+}
+
getenv(); # get environment variables
my $lext=$Config{'so'}; # Get extensions of libraries
kerning and hinting information and generally yield good
visual quality esp on low resultions. The freetype library is
used to rasterize for us. The only drawback is that there
-are alot of badly designed fonts out there.}
+are alot of badly designed fonts out there.
+
+This driver uses Freetype 1.x which is obsolete}
};
# Make fix indent
for (keys %formats) { $formats{$_}->{docs} =~ s/^\s+/ /mg; }
sub gen {
my $V = $ENV{$_[0]};
+ print " $_[0]: '$V'\n"
+ if $VERBOSE && defined $V;
defined($V) ? $V : "";
}
sub getenv {
- ($VERBOSE,
- $INCPATH,
+ $VERBOSE ||= gen("IM_VERBOSE");
+
+ print "Environment config:\n" if $VERBOSE;
+
+ ($INCPATH,
$LIBPATH,
$NOLOG,
$DEBUG_MALLOC,
$MANUAL,
$CFLAGS,
$LFLAGS,
- $DFLAGS) = map { gen $_ } qw(IM_VERBOSE
- IM_INCPATH
+ $DFLAGS) = map { gen $_ } qw(IM_INCPATH
IM_LIBPATH
IM_NOLOG
IM_DEBUG_MALLOC
IM_CFLAGS
IM_LFLAGS
IM_DFLAGS);
-
}
# populate the environment so that sub-modules get the same info
INCS:
for my $inc (@incs) {
for my $subdir (qw/freetype freetype1/) {
+ print "TT: include check ", File::Spec->catdir($inc, $subdir), "\n"
+ if $VERBOSE;
my $path = File::Spec->catfile($inc, $subdir, 'freetype.h');
-e $path or next;
$path = File::Spec->catfile($inc, $subdir, 'fterrors.h');
-e $path and next;
+ print "TT: Found!\n"
+ if $VERBOSE;
+
$found_inc = File::Spec->catdir($inc, $subdir);
last INCS;
}
for my $lib (@libs) {
my $a_path = File::Spec->catfile($lib, "libttf$aext");
my $l_path = File::Spec->catfile($lib, "libttf.$lext");
+ print "TT: lib check $lib\n"
+ if $VERBOSE;
if (-e $a_path || -e $l_path) {
$found_lib = $lib;
+ print "TT: Found!\n"
+ if $VERBOSE;
last LIBS;
}
}
use Config;
use Cwd ();
-our $VERSION = "1.003";
+our $VERSION = "1.004";
my @alt_transfer = qw/altname incsuffix libbase/;
sub _lib_paths {
my ($req) = @_;
+ print "$req->{name} IM_LIBPATH: $ENV{IM_LIBPATH}\n"
+ if $req->{verbose} && defined $ENV{IM_LIBPATH};
+ print "$req->{name} LIB: $ENV{IM_LIBPATH}\n"
+ if $req->{verbose} && defined $ENV{LIB} && $^O eq "MSWin32";
+ my $lp = $req->{libpath};
+ print "$req->{name} libpath: ", ref $lp ? join($Config{path_sep}, @$lp) : $lp, "\n"
+ if $req->{verbose} && defined $lp;
+
return _paths
(
$ENV{IM_LIBPATH},
sub _inc_paths {
my ($req) = @_;
+ print "$req->{name} IM_INCPATH: $ENV{IM_INCPATH}\n"
+ if $req->{verbose} && defined $ENV{IM_INCPATH};
+ print "$req->{name} INCLUDE: $ENV{INCLUDE}\n"
+ if $req->{verbose} && defined $ENV{INCLUDE} && $^O eq "MSWin32";
+ my $ip = $req->{incpath};
+ print "$req->{name} incpath: ", ref $ip ? join($Config{path_sep}, @$ip) : $ip, "\n"
+ if $req->{verbose} && defined $req->{incpath};
+
my @paths = _paths
(
$ENV{IM_INCPATH},