present (and for the GIF library version) rather than putting them
into CFLAGS
pm_to_blib
Imager.bs
t1lib.log
pm_to_blib
Imager.bs
t1lib.log
and pkg-config to configure libpng.
- avoid complaining about include/lib directories we pull from
perl's config or we have built-in
and pkg-config to configure libpng.
- avoid complaining about include/lib directories we pull from
perl's config or we have built-in
+- Makefile.PL now builds imconfig.h with #defines for libraries
+ present (and for the GIF library version) rather than putting them
+ into CFLAGS
=================================================================
=================================================================
init(); # initialize global data
pathcheck(); # Check if directories exist
init(); # initialize global data
pathcheck(); # Check if directories exist
# Pick what libraries are used
if ($MANUAL) {
manual();
# Pick what libraries are used
if ($MANUAL) {
manual();
gifcheck();
my $lib_cflags = '';
gifcheck();
my $lib_cflags = '';
-for $frm(values %formats) {
- $F_DEFINE .= ' -D'.$frm->{def};
+for my $frmkey (keys %formats) {
+ my $frm = $formats{$frmkey};
+ push @defines, [ $frm->{def}, 1, "$frmkey available" ];
$F_LIBS .= ' ' .$frm->{libfiles};
$F_OBJECT .= ' ' .$frm->{objfiles};
$lib_cflags .= ' ' .$frm->{cflags} if $frm->{cflags};
$F_LIBS .= ' ' .$frm->{libfiles};
$F_OBJECT .= ' ' .$frm->{objfiles};
$lib_cflags .= ' ' .$frm->{cflags} if $frm->{cflags};
'NAME' => 'Imager',
'VERSION_FROM' => 'Imager.pm',
'LIBS' => "$LFLAGS -lm $OSLIBS $F_LIBS",
'NAME' => 'Imager',
'VERSION_FROM' => 'Imager.pm',
'LIBS' => "$LFLAGS -lm $OSLIBS $F_LIBS",
- 'DEFINE' => "$F_DEFINE $EXTDEF $OSDEF $CFLAGS",
+ 'DEFINE' => "$OSDEF $CFLAGS",
'INC' => "$lib_cflags $DFLAGS $F_INC",
'OBJECT' => join(' ', @objs, $F_OBJECT),
clean => { FILES=>'testout' },
'INC' => "$lib_cflags $DFLAGS $F_INC",
'OBJECT' => join(' ', @objs, $F_OBJECT),
clean => { FILES=>'testout' },
+make_imconfig(\@defines);
+
if ($VERBOSE) { print Dumper(\%opts); }
mkdir('testout',0777); # since we cannot include it in the archive.
WriteMakefile(%opts);
if ($VERBOSE) { print Dumper(\%opts); }
mkdir('testout',0777); # since we cannot include it in the archive.
WriteMakefile(%opts);
lib/Imager/Regops.pm : regmach.h regops.perl
$(PERL) regops.perl regmach.h lib/Imager/Regops.pm
lib/Imager/Regops.pm : regmach.h regops.perl
$(PERL) regops.perl regmach.h lib/Imager/Regops.pm
+
+imconfig.h: Makefile.PL
+ $(ECHO) "imconfig.h out-of-date with respect to $?"
+ $(PERLRUN) Makefile.PL
+ $(ECHO) "==> Your Makefile has been rebuilt - re-run your make command <=="
# we need the version in a #ifdefable form
# we need the version in a #ifdefable form
- $F_DEFINE .= "-DIM_GIFMAJOR=$major -DIM_GIFMINOR=$minor";
+ push @defines, [ IM_GIFMAJOR, $major, "Parsed giflib version" ];
+ push @defines, [ IM_GIFMINOR, $minor ];
if ($VERBOSE) { print "Verbose mode\n"; require Data::Dumper; import Data::Dumper qw(Dumper);}
if ($NOLOG) { print "Logging not compiled into module\n"; }
if ($VERBOSE) { print "Verbose mode\n"; require Data::Dumper; import Data::Dumper qw(Dumper);}
if ($NOLOG) { print "Logging not compiled into module\n"; }
- else { $EXTDEF.=' -DIMAGER_LOG'; }
+ else {
+ push @defines, [ IMAGER_LOG => 1, "Logging system" ];
+ }
- $EXTDEF.=' -DIMAGER_DEBUG_MALLOC';
+ push @defines, [ IMAGER_DEBUG_MALLOC => 1, "Use Imager's DEBUG malloc()" ];
print "Malloc debugging enabled\n";
}
}
print "Malloc debugging enabled\n";
}
}
+sub make_imconfig {
+ my ($defines) = @_;
+
+ open CONFIG, "> imconfig.h"
+ or die "Cannot create imconfig.h: $!\n";
+ print CONFIG <<EOS;
+/* This file is automatically generated by Makefile.PL.
+ Don't edit this file, since any changes will be lost */
+
+#ifndef IMAGER_IMCONFIG_H
+#define IMAGER_IMCONFIG_H
+EOS
+ for my $define (@$defines) {
+ if ($define->[2]) {
+ print CONFIG "\n/*\n $define->[2]\n*/\n\n";
+ }
+ print CONFIG "#define $define->[0] $define->[1]\n";
+ }
+ print CONFIG "\n#endif\n";
+ close CONFIG;
+}
+
# probes for freetype2 by trying to run freetype-config
sub freetype2_probe {
my ($frm, $frmkey) = @_;
# probes for freetype2 by trying to run freetype-config
sub freetype2_probe {
my ($frm, $frmkey) = @_;
#ifndef _IMAGE_H_
#define _IMAGE_H_
#ifndef _IMAGE_H_
#define _IMAGE_H_
#include "imio.h"
#include "iolayer.h"
#include "log.h"
#include "imio.h"
#include "iolayer.h"
#include "log.h"
#include "log.h"
#define DTBUFF 50
#include "log.h"
#define DTBUFF 50