diff options
author | lecoanet | 2004-09-24 12:22:38 +0000 |
---|---|---|
committer | lecoanet | 2004-09-24 12:22:38 +0000 |
commit | 28de4d50b04e981d3b78119fb87b5df18245cc1f (patch) | |
tree | 40ce4208672c9d253abd390512c627f1dde0800c /Perl/Makefile.PL | |
parent | c448ff8c151c403b813334f499d4ae8a338cb4d5 (diff) | |
download | tkzinc-28de4d50b04e981d3b78119fb87b5df18245cc1f.zip tkzinc-28de4d50b04e981d3b78119fb87b5df18245cc1f.tar.gz tkzinc-28de4d50b04e981d3b78119fb87b5df18245cc1f.tar.bz2 tkzinc-28de4d50b04e981d3b78119fb87b5df18245cc1f.tar.xz |
Version numbers are managed from configure.in
Diffstat (limited to 'Perl/Makefile.PL')
-rw-r--r-- | Perl/Makefile.PL | 140 |
1 files changed, 0 insertions, 140 deletions
diff --git a/Perl/Makefile.PL b/Perl/Makefile.PL deleted file mode 100644 index 2539b7a..0000000 --- a/Perl/Makefile.PL +++ /dev/null @@ -1,140 +0,0 @@ -use 5.006; -use Tk; -use Config; -use Tk::Config; -use ExtUtils::MakeMaker; -use strict; - -my $TkLibDir = $Tk::library; -my $platform = $Tk::platform; - -my $VERSION = CONF_VERS; - - -if (!$TkLibDir) -{ - print stderr "==================================================================\n"; - print stderr "Could not find the Perl/Tk (pTk) library.\n"; - print stderr "Please, install first Perl/Tk interface before installing Tk::Zinc\n"; - print stderr "==================================================================\n"; - die; -} - - -print "Configuring version $VERSION for $platform platform...\n"; -print "Using $TkLibDir as Tk library...\n"; - -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'); - -my @LIBTESS_C = ('dict.c', 'geom.c', 'memalloc.c', 'mesh.c', 'normal.c', 'priorityq.c', - 'render.c', 'sweep.c', 'tess.c', 'tessmono.c'); - -my @OM_C = ('OverlapMan.c'); - -my @WIN_C = ('WinPort.c'); - -my @C; - -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"}; - -my $INC = "-I. -I$TkLibDir -I$TkLibDir/pTk -I$TkLibDir/X11"; - -unless ($WIN) { - $INC .= " -I/usr/X11R6/include"; -} - -# See lib/ExtUtils/MakeMaker.pm for details of how to influence -# the contents of the Makefile that is written. -WriteMakefile( - 'ABSTRACT' => 'a canvas offering groups, tranformations, transparency, color gradient...', - 'AUTHOR' => 'Patrick Lecoanet <lecoanet@cena.fr>', - 'NAME' => 'Tk::Zinc', - 'VERSION' => $VERSION, - 'PREREQ_PM' => $WIN ? {Tk => 8.004} : {Tk => 8.0}, - 'LIBS' => $NeededLibs, - 'DEFINE' => &get_flags, - 'INC' => $INC, - 'C' => [@C], - 'XS_VERSION' => $Tk::Config::VERSION, - 'XS' => {'Zinc.xs' => 'Zinc.c'}, - 'linkext' => {LINKTYPE => 'dynamic'}, - 'depend' => {$ZincObj => '$(O_FILES) Zinc.c'}, - 'LDFROM' => "\$(O_FILES) $ZincObj", - ); - -sub get_flags { - my %DEF_FLAGS = ('GL' => 1, - 'SHAPE' => 1, - 'GL_DAMAGE' => 1, - 'OM' => 1 - ); - - foreach my $arg (@ARGV) { - print "$arg ....\n"; - my ($name, $value) = split(/[=]+/, $arg); - if ($name =~ /(with-gl)/i) { - if ($value =~ /no/i) { - $DEF_FLAGS{'GL'} = 0; - $DEF_FLAGS{'GL_DAMAGE'} = 0; - } - } - elsif ($name =~ /(with-om)/i) { - if ($value =~ /no/i) { - $DEF_FLAGS{'OM'} = 0; - } - } - elsif ($name =~ /(with-shape)/i) { - if ($value =~ /no/i) { - $DEF_FLAGS{'SHAPE'} = 0; - } - } - } - - 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__'; - } - - print "Configuring with:\n "; - foreach my $flag (keys %DEF_FLAGS) { - print "$flag=", $DEF_FLAGS{$flag} ? 'ok' : 'no', " "; - if ($DEF_FLAGS{$flag}) { - $defines = $defines . " " . "-D$flag"; - if ($flag eq 'OM') { - push @C, @OM_C - } - } - } - if ($Tk::VERSION =~ /^800/) { - $defines .= " -DPTK_800"; - print "PTK=800"; - } else { - print "PTK=804"; - } - print "\n"; - return $defines; -} - -# -# For the demo -# -# perl -Mblib demos/zinc-demos |