version 1.10, 2010/08/29 04:43:24
|
version 1.11, 2011/01/19 20:40:37
|
Line 15 use constant GFORTMINOR => 2; |
|
Line 15 use constant GFORTMINOR => 2; |
|
| |
my($arg); | my($arg); |
my($pos); | my($pos); |
|
my($outdir); |
my($outfile); | my($outfile); |
|
my($customdefsfile); |
my($major); | my($major); |
my($minor); | my($minor); |
my($hasicc); | my($hasicc); |
my($hasifort); | my($hasifort); |
my($hasgcc); | my($hasgcc); |
my($hasgfort); | my($hasgfort); |
|
my($skipautocomp); |
|
my($line); |
| |
while ($arg = shift(@ARGV)) | while ($arg = shift(@ARGV)) |
{ | { |
if (($pos = index($arg, "-f", 0)) == 0) |
if (($pos = index($arg, "-d", 0)) == 0) |
|
{ |
|
$outdir = substr($arg, 2); |
|
} |
|
elsif (($pos = index($arg, "-f", 0)) == 0) |
{ | { |
$outfile = substr($arg, 2); | $outfile = substr($arg, 2); |
} | } |
|
elsif (($pos = index($arg, "-c", 0)) == 0) |
|
{ |
|
$customdefsfile = substr($arg, 2); |
|
} |
} | } |
| |
|
$outfile = "$outdir/$outfile"; |
|
|
$hasicc = 0; | $hasicc = 0; |
$hasifort = 0; | $hasifort = 0; |
$hasgcc = 0; | $hasgcc = 0; |
$hasgfort = 0; | $hasgfort = 0; |
|
$skipautocomp = 0; |
| |
if (defined($outfile)) |
if (defined($outdir) && defined($outfile)) |
|
{ |
|
# Check to see if user does not want to auto-configure compiler make variables |
|
# Read the file containing the defs (right now, customizeddefs.h for Stanford, |
|
# localization.h for non-Stanford). |
|
if (defined($customdefsfile) && -e $customdefsfile) |
|
{ |
|
if (open(DEFSFILE, "<$customdefsfile")) |
|
{ |
|
my($doautocomp) = 0; |
|
|
|
while (defined($line = <DEFSFILE>)) |
|
{ |
|
if ($line =~ /AUTOSELCOMP\s+(.+)/) |
|
{ |
|
$doautocomp = $1; |
|
$skipautocomp = !$doautocomp; |
|
last; |
|
} |
|
} |
|
|
|
close(DEFSFILE); |
|
} |
|
} |
|
|
|
if (!$skipautocomp) |
{ | { |
# Try icc | # Try icc |
$ans = `icc -V 2>&1`; | $ans = `icc -V 2>&1`; |
Line 96 if (defined($outfile)) |
|
Line 136 if (defined($outfile)) |
|
} | } |
} | } |
} | } |
|
} |
| |
open(OUTFILE, ">>$outfile") || die "Couldn't open file $outfile for writing.\n"; | open(OUTFILE, ">>$outfile") || die "Couldn't open file $outfile for writing.\n"; |
| |
# Error messages | # Error messages |
|
if (!$skipautocomp) |
|
{ |
if (!$hasicc && !$hasgcc) | if (!$hasicc && !$hasgcc) |
{ | { |
print "Fatal error: Acceptable C compiler not found! You will be unable to build the DRMS library.\n"; | print "Fatal error: Acceptable C compiler not found! You will be unable to build the DRMS library.\n"; |
Line 125 if (defined($outfile)) |
|
Line 168 if (defined($outfile)) |
|
{ | { |
print OUTFILE "FCOMPILER = gfortran\n"; | print OUTFILE "FCOMPILER = gfortran\n"; |
} | } |
|
} |
| |
# Print out env var override logic - otherwise we lose this logic in make_basic.mk | # Print out env var override logic - otherwise we lose this logic in make_basic.mk |
# as the include of custom.mk comes after this logic in make_basic.mk | # as the include of custom.mk comes after this logic in make_basic.mk |