aboutsummaryrefslogtreecommitdiff
path: root/Makefile.PL
diff options
context:
space:
mode:
authormertz2003-09-15 15:22:23 +0000
committermertz2003-09-15 15:22:23 +0000
commit5e7fb971cdd595b69005d7f11eaabf2dde723139 (patch)
treeace13487e7f3e572526ffbb15b9bb30a3a19af3f /Makefile.PL
parent259c9cd014d20ce604b1d80687d8349ba32ae746 (diff)
downloadtkzinc-5e7fb971cdd595b69005d7f11eaabf2dde723139.zip
tkzinc-5e7fb971cdd595b69005d7f11eaabf2dde723139.tar.gz
tkzinc-5e7fb971cdd595b69005d7f11eaabf2dde723139.tar.bz2
tkzinc-5e7fb971cdd595b69005d7f11eaabf2dde723139.tar.xz
corrections so that the usual cpan installation commands are now working
for perl. Makefile.in should be also ok for tcl
Diffstat (limited to 'Makefile.PL')
-rw-r--r--Makefile.PL39
1 files changed, 23 insertions, 16 deletions
diff --git a/Makefile.PL b/Makefile.PL
index bebc206..6951853 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -5,6 +5,7 @@ use 5.00404;
use Cwd;
use Config;
use File::Basename;
+use Carp;
BEGIN
@@ -14,25 +15,35 @@ BEGIN
my %opt = parse_opt();
-# Libraries
-my $tkConfig = $opt{'--tkConfig'};
-my $tclConfig = $opt{'--tclConfig'};
+# tcl / tk libraries are not needed for perl!
+#my $tkConfig = $opt{'--tkConfig'};
+#my $tclConfig = $opt{'--tclConfig'};
-$tkConfig = gess_libs('tkConfig.sh') if (!($tkConfig and -d $tkConfig));
-$tclConfig = gess_libs('tclConfig.sh') if (!($tclConfig and -d $tclConfig));
+#$tkConfig = guess_libs('tkConfig.sh') if (!($tkConfig and -d $tkConfig));
+#$tclConfig = guess_libs('tclConfig.sh') if (!($tclConfig and -d $tclConfig));
-my $gl_lib = gess_libs('libGL.so');
+print "Trying to find a libGL by myself (may be long)...\n";
+my $gl_lib = guess_libs('libGL.so');
if ($gl_lib)
{
+ my $gl_lib_a = guess_libs('libGL.a');
+ if ($gl_lib_a) {
+ warn ("you have both libGL.so [in $gl_lib] and libGL.a [in $gl_lib_a].
+Tk::Zinc may have trouble building a correct libTkzinc3.x.yy.so library.
+We suggest you to put the libGL.a aside ....")
+ }
$gl_lib = 'yes';
}
else
{
- $gl_lib = 'yes';
+ $gl_lib = 'no';
}
# Directories
my $prefix = $Config{'prefix'};
+
+# in fact for the CPAN, the default prefix is /usr/local
+#$prefix = '/usr/local';
$prefix = $opt{'--prefix'} if ($opt{'--prefix'});
@@ -41,15 +52,14 @@ $prefix = $opt{'--prefix'} if ($opt{'--prefix'});
#############################################
# Try to guess which library are to be use for tk and tcl
-sub gess_libs
+sub guess_libs
{
my $lib_name = shift;
- print "No $lib_name specified!!! Trying to find it by myself (may be long)...\n";
my @libs = split(/[ \t]+/, $Config{'libpth'});
foreach my $lib (@libs)
{
- my @configs = `find /usr/lib -name $lib_name`;
+ my @configs = (`find /usr/lib -name $lib_name`, `find /usr/local/lib -name $lib_name` , );
if (@configs)
{
print "Using $configs[0]\n";
@@ -77,17 +87,14 @@ sub parse_opt
-#print "$tkConfig $tclConfig $prefix $gl_lib // $opt{'--tkConfig'} $opt{'--tclConfig'}\n";
+#print "Installing in $prefix gl_lib=$gl_lib\n";
my @args = ("./configure",
"--enable-ptk=yes",
- "--enable-gl=yes",
"--enable-gl=$gl_lib",
"--enable-shared=yes",
- "--with-tk=$tkConfig",
- "--with-tcl=$tclConfig",
- "--prefix=$prefix",
- "INSTALL_PERL=\"yes\""
+# "--prefix=$prefix",
+# INSTALL_PERL=\"yes\""
);
print "\nConfiguring with... ", join (' ', @args), "\n";