aboutsummaryrefslogtreecommitdiff
path: root/Perl/Makefile.PL
diff options
context:
space:
mode:
authorlecoanet2004-04-30 11:45:38 +0000
committerlecoanet2004-04-30 11:45:38 +0000
commitdb078e2e84e5f248735165dbdbac8380a30db892 (patch)
tree1c6c8329e772437e07c2b5f393822cb4d5edc845 /Perl/Makefile.PL
parent7084e899fd33aeb13b1be18ff6abe94b10b3cb9f (diff)
downloadtkzinc-db078e2e84e5f248735165dbdbac8380a30db892.zip
tkzinc-db078e2e84e5f248735165dbdbac8380a30db892.tar.gz
tkzinc-db078e2e84e5f248735165dbdbac8380a30db892.tar.bz2
tkzinc-db078e2e84e5f248735165dbdbac8380a30db892.tar.xz
Tweaks for a better configuration on all platforms and
to compile (finally) under Windows.
Diffstat (limited to 'Perl/Makefile.PL')
-rw-r--r--Perl/Makefile.PL30
1 files changed, 18 insertions, 12 deletions
diff --git a/Perl/Makefile.PL b/Perl/Makefile.PL
index d679879..de5430a 100644
--- a/Perl/Makefile.PL
+++ b/Perl/Makefile.PL
@@ -1,5 +1,6 @@
use 5.006;
use Tk;
+use Config;
use Tk::Config;
use ExtUtils::MakeMaker;
use strict;
@@ -23,14 +24,10 @@ if (!$TkLibDir)
print "Configuring version $VERSION for $platform platform...\n";
print "Using $TkLibDir as Tk library...\n";
-#
-# Humm! inclusion of Zinc.c here is needed to include Zinc.o in the link but it create
-# a circular dependancy in the generated Makefile. Another solution ?
-#
my @GENERIC_C = ('Track.c', 'Tabular.c', 'Reticle.c', 'Map.c', 'Rectangle.c', 'Arc.c', 'Curve.c',
'Item.c', 'PostScript.c', 'MapInfo.c', 'Attrs.c', 'Draw.c', 'Geo.c', 'List.c',
'perfos.c', 'Transfo.c', 'Group.c', 'Icon.c', 'Text.c', 'Image.c', 'Color.c',
- 'Field.c', 'Triangles.c', 'Window.c', 'tkZinc.c', 'Zinc.c');
+ 'Field.c', 'Triangles.c', 'Window.c', 'tkZinc.c');
my @LIBTESS_C = ('dict.c', 'geom.c', 'memalloc.c', 'mesh.c', 'normal.c', 'priorityq.c',
'render.c', 'sweep.c', 'tess.c', 'tessmono.c');
@@ -45,9 +42,13 @@ my $WIN = ($platform =~ /win/i);
push @C, @LIBTESS_C, @GENERIC_C ;
+my $NeededLibs = ['-L/usr/X11R6/lib -lXext -lX11 -lGL -L.'];
+
if ($WIN) {
push @C, @WIN_C;
+ $NeededLibs = ['-lopengl32']
}
+my $ZincObj = "Zinc" . $Config{"_o"};
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
@@ -56,15 +57,15 @@ WriteMakefile(
'NAME' => 'Tk::Zinc',
'VERSION' => $VERSION,
'PREREQ_PM' => {Tk => 8.0},
- 'LIBS' => ['-L/usr/X11R6/lib -lXext -lX11 -lGL -L.'],
+ 'LIBS' => $NeededLibs,
'DEFINE' => &get_flags,
- 'INC' => "-I. -I$TkLibDir -I$TkLibDir/pTk $Tk::Config::inc",
+ 'INC' => "-I. -I$TkLibDir -I$TkLibDir/pTk -I$TkLibDir/X11",
'C' => [@C],
'XS_VERSION' => $Tk::Config::VERSION,
'XS' => {'Zinc.xs' => 'Zinc.c'},
'linkext' => {LINKTYPE => 'dynamic'},
- 'depend' => {'Zinc.o' => '$(O_FILES) Zinc.o'},
- 'LDFROM' => '$(O_FILES)',
+ 'depend' => {$ZincObj => '$(O_FILES) Zinc.c'},
+ 'LDFROM' => "\$(O_FILES) $ZincObj",
);
sub get_flags {
@@ -95,12 +96,17 @@ sub get_flags {
}
}
- #
- # No shape extension on Windows (planned later).
+ my $defines = '-DPTK';
+
if ($WIN) {
+ #
+ # No shape extension on Windows (planned later).
$DEF_FLAGS{'SHAPE'} = 0;
+ #
+ # Visual C++ does not define __STDC__ by default
+ $defines .= ' -D__STDC__';
}
- my $defines = '-DPTK';
+
print "Configuring with:\n ";
foreach my $flag (keys %DEF_FLAGS) {
print "$flag=", $DEF_FLAGS{$flag} ? 'ok' : 'no', " ";