r2463 - in packages/libextutils-f77-perl/branches/upstream/current:
. t
Krzysztof Krzyzaniak
eloy at costa.debian.org
Tue Mar 21 12:41:45 UTC 2006
Author: eloy
Date: 2006-03-21 12:41:44 +0000 (Tue, 21 Mar 2006)
New Revision: 2463
Modified:
packages/libextutils-f77-perl/branches/upstream/current/CHANGES
packages/libextutils-f77-perl/branches/upstream/current/F77.pm
packages/libextutils-f77-perl/branches/upstream/current/t/require.t
Log:
Load /tmp/tmp.V2Fcon/libextutils-f77-perl-1.15 into
packages/libextutils-f77-perl/branches/upstream/current.
Modified: packages/libextutils-f77-perl/branches/upstream/current/CHANGES
===================================================================
--- packages/libextutils-f77-perl/branches/upstream/current/CHANGES 2006-03-20 14:00:23 UTC (rev 2462)
+++ packages/libextutils-f77-perl/branches/upstream/current/CHANGES 2006-03-21 12:41:44 UTC (rev 2463)
@@ -1,6 +1,15 @@
ExtUtils::F77 Changes list
--------------------------
+v1.15 released Jan 3rd, 2006
+----------------------------
+
+* Jim Edwards f90 patch for SGI irix64
+* Added version number print to the startup
+* Solaris patches from Diab Jerius
+* OSX warning patch from Doug Burke
+* Win32 patches from Rob - Sisyphus <kalinabears at iinet.net.au> (2005/1/25)
+
v1.14 released Jun 15th 2001
----------------------------
Modified: packages/libextutils-f77-perl/branches/upstream/current/F77.pm
===================================================================
--- packages/libextutils-f77-perl/branches/upstream/current/F77.pm 2006-03-20 14:00:23 UTC (rev 2462)
+++ packages/libextutils-f77-perl/branches/upstream/current/F77.pm 2006-03-21 12:41:44 UTC (rev 2463)
@@ -2,6 +2,7 @@
package ExtUtils::F77;
use Config;
+use File::Spec;
=head1 NAME
@@ -32,8 +33,10 @@
=cut
-$VERSION = "1.14";
+$VERSION = "1.15";
+warn "\nExtUtils::F77: Version $VERSION\n";
+
# Database starts here. Basically we have a large hash specifying
# entries for each os/compiler combination. Entries can be code refs
# in which case they are executed and the returned value used. This
@@ -83,7 +86,7 @@
$F77config{Solaris}{F77}{Link} = sub {
my $NSPATH;
my $dir;
-
+
#find the SUNWspro entry of nonstandard inst. in LD_LIBRARY_PATH
if ( defined $ENV{'LD_LIBRARY_PATH'} &&
$ENV{'LD_LIBRARY_PATH'} =~ m{([^:]*SUNWspro[^/]*)} )
@@ -122,7 +125,40 @@
}
return "" unless $dir; # Failure
print "$Pkg: Found Fortran latest version lib dir $dir\n";
- return "-L$dir -lF77 -lM77 -lsunmath -lm";
+
+ my @libs;
+
+ # determine libraries. Forte 7 doesn't have F77 or M77
+ if ( qx/$F77config{Solaris}{F77}{Compiler} -V 2>&1/
+ =~ /Forte Developer 7/ )
+ {
+ push @libs, qw/
+ -lf77compat
+ -lfui
+ -lfai
+ -lfai2
+ -lfsumai
+ -lfprodai
+ -lfminlai
+ -lfmaxlai
+ -lfminvai
+ -lfmaxvai
+ -lfsu
+ -lsunmath
+ -lm
+ /;
+ }
+ else
+ {
+ push @libs, qw/
+ -lF77
+ -lM77
+ -lsunmath
+ -lm
+ /;
+ }
+
+ join( ' ', "-L$dir", @libs );
};
@@ -229,12 +265,12 @@
if ( $abi eq "-64" ){
$libs = ( (-r "/usr/lib64/$mips_dir") && (-d _) && (-x _) ) ?
"-L/usr/lib64/$mips_dir" : "";
- $libs .= " -L/usr/lib64 -lftn -lm";
+ $libs .= " -L/usr/lib64 -lfortran -lm";
}
if ( $abi eq "-n32" ){
$libs = ( (-r "/usr/lib32/$mips_dir") && (-d _) && (-x _) ) ?
"-L/usr/lib32/$mips_dir" : "";
- $libs .= " -L/usr/lib32 -lftn -lm";
+ $libs .= " -L/usr/lib32 -lfortran -lm";
}
if ( $abi eq "-o32" ){
$libs = "-L/usr/lib -lF77 -lI77 -lU77 -lisam -lm";
@@ -291,6 +327,7 @@
# a lot of the answers depend on a lot of the guesswork.
sub import {
+ no warnings; # Shuts up complaints on Win32 when running PDL tests
$Pkg = shift;
my $system = ucfirst(shift); # Set package variables
my $compiler = ucfirst(shift);
@@ -302,17 +339,18 @@
$system = 'Cygwin' if $system =~ /Cygwin/;
$compiler = get $F77config{$system}{DEFAULT} unless $compiler;
- print "$Pkg: Using system=$system compiler=$compiler\n";
-
+ print "$Pkg: Using system=$system compiler=" .
+ (defined $compiler ? $compiler : "<undefined>") . "\n";
+
if (defined($ENV{F77LIBS})) {
print "Overriding Fortran libs from value of enviroment variable F77LIBS = $ENV{F77LIBS}\n";
$Runtime = $ENV{F77LIBS};
}
else {
-
+
# Try this combination
- if (defined( $F77config{$system} )){
+ if ( defined( $compiler ) and defined( $F77config{$system} )){
my $flibs = get ($F77config{$system}{$compiler}{Link});
if ($flibs ne "") {
$Runtime = $flibs;# . gcclibs();
@@ -345,13 +383,13 @@
print "$Pkg: Well that didn't appear to validate. Well I will try it anyway.\n"
unless $Runtime && $ok;
}
-
+
$RuntimeOK = $ok;
-
+
} # Not overriding
# Now get the misc info for the methods.
-
+
if (defined( $F77config{$system}{$compiler}{Trail_} )){
$Trail_ = get $F77config{$system}{$compiler}{Trail_};
}
@@ -363,9 +401,9 @@
EOD
$Trail_ = 1;
}
-
+
if (defined( $F77config{$system}{$compiler}{Compiler} )) {
- $Compiler = $F77config{$system}{$compiler}{Compiler};
+ $Compiler = get $F77config{$system}{$compiler}{Compiler};
} else {
print << "EOD";
$Pkg: There does not appear to be any configuration info about
@@ -376,7 +414,7 @@
print "$Pkg: Compiler: $Compiler\n";
if (defined( $F77config{$system}{$compiler}{Cflags} )) {
- $Cflags = $F77config{$system}{$compiler}{Cflags};
+ $Cflags = get $F77config{$system}{$compiler}{Cflags} ;
} else {
print << "EOD";
$Pkg: There does not appear to be any configuration info about
@@ -387,7 +425,7 @@
}
print "$Pkg: Cflags: $Cflags\n";
-
+
} # End of import ()
=head1 METHODS
@@ -466,7 +504,7 @@
return pop @sorted_dirs; # Highest N
}
-
+
# Validate a string of form "-Ldir -lfoo -lbar"
sub validate_libs {
@@ -502,8 +540,10 @@
sub testcompiler {
-
- my $file = "/tmp/testf77$$";
+
+ my $file = File::Spec->tmpdir . "/testf77$$";
+ $file =~ s/\\/\//g; # For Win32
+
my $ret;
open(OUT,">$file.f");
print OUT " print *, 'Hello World'\n";
@@ -555,7 +595,12 @@
sub find_in_path {
my @names = @_;
- my @path = split(":",$ENV{PATH});
+ my @path;
+ if($^O =~ /mswin32/i) {
+ for(@names) { $_ .= '.exe'}
+ @path = split(";", $ENV{PATH});
+ }
+ else {@path = split(":",$ENV{PATH})}
my ($name,$dir);
for $name (@names) {
for $dir (@path) {
Property changes on: packages/libextutils-f77-perl/branches/upstream/current/F77.pm
___________________________________________________________________
Name: svn:executable
-
+ *
Modified: packages/libextutils-f77-perl/branches/upstream/current/t/require.t
===================================================================
--- packages/libextutils-f77-perl/branches/upstream/current/t/require.t 2006-03-20 14:00:23 UTC (rev 2462)
+++ packages/libextutils-f77-perl/branches/upstream/current/t/require.t 2006-03-21 12:41:44 UTC (rev 2463)
@@ -5,8 +5,48 @@
use strict;
use vars qw/$loaded/;
-BEGIN { $| = 1; print "1..1\n"; }
+BEGIN { $| = 1; print "1..2\n"; }
END {print "not ok 1\n" unless $loaded;}
use ExtUtils::F77;
$loaded = 1;
print "ok 1\n";
+
+# try compiling ?
+
+open(FH,">hello.f");
+print FH "
+ subroutine hello_fortran
+ print *, 'Hello from the wonderful world of fortran'
+c $ExtUtils::F77::Compiler $ExtUtils::F77::Cflags $ExtUtils::F77::Runtime
+ return
+ end
+";
+
+close FH;
+unlink "hello.o" if(-e "hello.o");
+my $compile_command = "$ExtUtils::F77::Compiler $ExtUtils::F77::Cflags -c hello.f ";
+my $rc = system($compile_command);
+$rc = 0xffff & $rc;
+if($rc){
+ if($rc == 0xff00){
+ print "2 ERROR: $compile_command failed: $!";
+ }elsif ($rc > 0x80) {
+ $rc >>= 8;
+ print "2 WARNING: $compile_command returned non-zero exit status $rc\n";
+ }else{
+ if($rc & 0x80){
+ print "2 $compile_command coredumped from signal $rc";
+ }else{
+ print "2 $compile_command returned signal $rc";
+ }
+ }
+}else{
+ unlink "hello.f","hello.o";
+ print "ok 2\n"
+}
+
+# how about linking - too complicated?
+
+
+
+
More information about the Pkg-perl-cvs-commits
mailing list