--- ExtUtils-F77-1.15/F77.pm- 2005-02-03 18:12:49 +0300 +++ ExtUtils-F77-1.15/F77.pm 2006-05-22 14:01:09 +0400 @@ -170,28 +170,29 @@ ### Generic GNU-77 or F2C system ### $F77config{Generic}{G77}{Link} = sub { - my @libs = ('g2c', 'f2c'); +foreach my $ext qw(so a) { + my @libs = ('gfortran', 'g2c', 'f2c'); my ($dir, $lib, $test); foreach $test (@libs) { - $dir = `g77 -print-file-name=lib$test.a`; + $dir = `g77 -print-file-name=lib$test.$ext`; chomp $dir; # Note that -print-file-name returns just the library name # if it cant be found - make sure that we only accept the # directory if it returns a proper path (or matches a /) - if (defined $dir && $dir ne "lib$test.a") { + if (defined $dir && $dir ne "lib$test.$ext") { $lib = $test; # Found an existing library last; } } if( defined $dir && defined $lib) { - $dir =~ s,/lib$lib.a$,,; + $dir =~ s,/lib$lib.$ext$,,; } else { $dir = "/usr/local/lib"; $lib = "f2c"; } return( "-L$dir -L/usr/lib -l$lib -lm" ); -}; +}}; $F77config{Generic}{G77}{Trail_} = 1; $F77config{Generic}{G77}{Compiler} = find_in_path('g77','f77','fort77'); $F77config{Generic}{G77}{Cflags} = '-O'; @@ -219,6 +220,7 @@ $F77config{Linux}{G77} = $F77config{Generic}{G77}; $F77config{Linux}{F2c} = $F77config{Generic}{G77}; $F77config{Linux}{DEFAULT} = 'G77'; +$F77config{Linux}{G77}{Cflags} = $Config{optimize}; ### DEC OSF/1 ###