summaryrefslogtreecommitdiff
path: root/lib/make
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-09-23 11:06:47 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-09-23 11:06:47 +0000
commit8b88cffae80aea8a769eedc5ab991fd3a5e3b723 (patch)
tree5bba377917fc7a37709cc0fe89f5b78490de1426 /lib/make
parent34e6a955efce92156a277973cd299488bf93bbf9 (diff)
Give better warning when no fortran compiler is found.
Cactus/789 git-svn-id: http://svn.cactuscode.org/flesh/trunk@2380 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make')
-rwxr-xr-xlib/make/configure.pl261
1 files changed, 147 insertions, 114 deletions
diff --git a/lib/make/configure.pl b/lib/make/configure.pl
index 491e7765..3667b107 100755
--- a/lib/make/configure.pl
+++ b/lib/make/configure.pl
@@ -14,9 +14,11 @@ $tmphome = shift(@ARGV);
print "Determining number of fortran underscores...\n";
-push(@routines, &test_fortran_name);
+($retcode,$data) = test_fortran_name();
+push(@routines, $data);
# Some compilers do something really strange with common blocks.
-push(@routines, &test_fortran_common_name);
+($retcode,$data) = test_fortran_common_name();
+push(@routines, $data);
push(@routines, "1;");
# Create the perl module to map the fortran names.
@@ -27,6 +29,13 @@ foreach $line (@routines)
print OUT "$line\n";
}
+close(OUT);
+
+if ($retcode > 0)
+{
+ print "Fortran compilation failed ...\n";
+ print "COMPILATION WILL FAIL WITH ANY FORTRAN SOURCE CODE\n";
+}
sub test_fortran_name
{
@@ -40,13 +49,19 @@ sub test_fortran_name
if($compiler_f77 && $compiler_f77 ne "" && $compiler_f77 !~ /none/)
{
- ($case, $n_underscores) = &compile_fortran_name($compiler_f77,$opts_f77);
- $use_f77 = 1;
+ ($retcode,$case, $n_underscores) = &compile_fortran_name($compiler_f77,$opts_f77);
+ if ($retcode <= 0)
+ {
+ $use_f77 = 1
+ };
}
elsif ($compiler_f90 && $compiler_f90 ne "" && $compiler_f90 !~ /none/)
{
- ($case, $n_underscores) = &compile_fortran_name($compiler_f90,$opts_f90);
- $use_f90 = 1;
+ ($retcode,$case, $n_underscores) = &compile_fortran_name($compiler_f90,$opts_f90);
+ if ($retcode <= 0)
+ {
+ $use_f90 = 1
+ };
}
if($use_f90 || $use_f77)
@@ -78,8 +93,14 @@ sub fortran_name
}
else
{
- print "No Fortran compiler - creating null fortran name conversion routine.\n";
-
+ if ($retcode <= 0)
+ {
+ print "No Fortran compiler - creating null fortran name conversion routine.\n";
+ }
+ else
+ {
+ print "Creating null fortran name conversion routine\n";
+ }
$data = "
sub fortran_name
@@ -90,9 +111,9 @@ sub fortran_name
}
";
-}
+ }
- return $data;
+ return ($retcode,$data);
}
@@ -107,13 +128,13 @@ sub test_fortran_common_name
if($compiler_f77 && $compiler_f77 ne "" && $compiler_f77 !~ /none/)
{
- ($case, $n_underscores) = &compile_fortran_common_name($compiler_f77,$opts_f77);
- $use_f77 = 1;
+ ($retcode,$case, $n_underscores) = &compile_fortran_common_name($compiler_f77,$opts_f77);
+ if ($retcode <=0) {$use_f77 = 1};
}
elsif ($compiler_f90 && $compiler_f90 ne "" && $compiler_f90 !~ /none/)
{
- ($case, $n_underscores) = &compile_fortran_common_name($compiler_f90,$opts_f90);
- $use_f90 = 1;
+ ($retcode,$case, $n_underscores) = &compile_fortran_common_name($compiler_f90,$opts_f90);
+ if ($retcode<=0) {$use_f90 = 1};
}
if($use_f90 || $use_f77)
@@ -146,6 +167,14 @@ sub fortran_common_name
}
else
{
+ if ($retcode <= 0)
+ {
+ print "No Fortran compiler - creating null fortran common name conversion routine.\n";
+ }
+ else
+ {
+ print "Creating null fortran common name conversion routine.\n";
+ }
$data = "
sub fortran_common_name
@@ -158,7 +187,7 @@ sub fortran_common_name
";
}
- return $data;
+ return ($retcode,$data);
}
sub determine_transformation
@@ -228,67 +257,68 @@ EOT
{
print "Failed to compile fname_test.f\n";
}
-
-
- # Search the object file for the appropriate symbols
- open(IN, "<fname_test.o") || open(IN, "<fname_test.obj") || die "Cannot open fname_test.o\n";
-
- while(<IN>)
+ else
{
- $line = $_;
- if($line =~ m:(_[\w_]*)?(TEST_COMMON)(_*):i)
+
+ # Search the object file for the appropriate symbols
+ open(IN, "<fname_test.o") || open(IN, "<fname_test.obj") || die "Cannot open fname_test.o\n";
+
+ while(<IN>)
{
- $prefix = $1;
- $name = $2;
- $underscores = $3;
+ $line = $_;
+ if($line =~ m:(_[\w_]*)?(TEST_COMMON)(_*):i)
+ {
+ $prefix = $1;
+ $name = $2;
+ $underscores = $3;
- # This is a pain. If all symbols have underscores, need to remove
- # the first one here.
+ # This is a pain. If all symbols have underscores, need to remove
+ # the first one here.
- if($symbols_preceeded_by_underscores)
- {
- if($prefix =~ m:^_(.*):)
+ if($symbols_preceeded_by_underscores)
{
- $prefix = $1;
+ if($prefix =~ m:^_(.*):)
+ {
+ $prefix = $1;
+ }
}
- }
- if($name =~ m:TEST_COMMON:)
- {
- print "Uppercase - ";
- $case = 1;
- }
- if($name =~ m:test_common:)
- {
- print "Lowercase - ";
- $case = 0;
- }
- if($underscores eq "")
- {
- print " No trailing underscore\n";
- $n_underscores = 0;
- }
- if($underscores eq "_")
- {
- print "One trailing underscore\n";
- $n_underscores = 1;
- }
- if($underscores eq "__")
- {
- print "Two trailing underscores\n";
- $n_underscores = 2;
- }
+ if($name =~ m:TEST_COMMON:)
+ {
+ print "Uppercase - ";
+ $case = 1;
+ }
+ if($name =~ m:test_common:)
+ {
+ print "Lowercase - ";
+ $case = 0;
+ }
+ if($underscores eq "")
+ {
+ print " No trailing underscore\n";
+ $n_underscores = 0;
+ }
+ if($underscores eq "_")
+ {
+ print "One trailing underscore\n";
+ $n_underscores = 1;
+ }
+ if($underscores eq "__")
+ {
+ print "Two trailing underscores\n";
+ $n_underscores = 2;
+ }
- last;
+ last;
+ }
}
- }
-
- close IN;
+ close IN;
+ }
# Delete the temporary files
unlink <fname_test.*>;
- return ($case,$n_underscores);
+ return ($retcode,$case,$n_underscores);
}
@@ -324,66 +354,69 @@ EOT
{
print "Failed to compile fname_test.f\n";
}
+ else
+ {
-
- # Search the object file for the appropriate symbols
- open(IN, "<fname_test.o") || open(IN, "<fname_test.obj") || die "Cannot open fname_test.o\n";
-
- while(<IN>)
- {
- $line = $_;
- if($line =~ m:(TEST_NAME)(_*):i)
+ # Search the object file for the appropriate symbols
+ open(IN, "<fname_test.o") || open(IN, "<fname_test.obj") || die "Cannot open fname_test.o\n";
+
+ while(<IN>)
{
- $name = $1;
- $underscores = $2;
-
- # Extremely quick hack to sort out problems later on with common block
- # names.
-
- if($_ =~ m:_TEST_NAME:i)
- {
- $symbols_preceeded_by_underscores=1;
- }
- else
+ $line = $_;
+ if($line =~ m:(TEST_NAME)(_*):i)
{
- $symbols_preceeded_by_underscores=0;
- }
+ $name = $1;
+ $underscores = $2;
- # Find out suffices.
- if($name =~ m:TEST_NAME:)
- {
- print "Uppercase - ";
- $case = 1;
- }
- if($name =~ m:test_name:)
- {
- print "Lowercase - ";
- $case = 0;
- }
- if($underscores eq "")
- {
- print " No trailing underscore\n";
- $n_underscores = 0;
- }
- if($underscores eq "_")
- {
- print "One trailing underscore\n";
- $n_underscores = 1;
- }
- if($underscores eq "__")
- {
- print "Two trailing underscores\n";
- $n_underscores = 2;
- }
+ # Extremely quick hack to sort out problems later on with common block
+ # names.
+
+ if($_ =~ m:_TEST_NAME:i)
+ {
+ $symbols_preceeded_by_underscores=1;
+ }
+ else
+ {
+ $symbols_preceeded_by_underscores=0;
+ }
+
+ # Find out suffices.
+ if($name =~ m:TEST_NAME:)
+ {
+ print "Uppercase - ";
+ $case = 1;
+ }
+ if($name =~ m:test_name:)
+ {
+ print "Lowercase - ";
+ $case = 0;
+ }
+ if($underscores eq "")
+ {
+ print " No trailing underscore\n";
+ $n_underscores = 0;
+ }
+ if($underscores eq "_")
+ {
+ print "One trailing underscore\n";
+ $n_underscores = 1;
+ }
+ if($underscores eq "__")
+ {
+ print "Two trailing underscores\n";
+ $n_underscores = 2;
+ }
- last;
+ last;
+ }
}
- }
+
+ close IN;
- close IN;
+ }
# Delete the temporary files
unlink <fname_test.*>;
- return ($case,$n_underscores);
+ return ($retcode,$case,$n_underscores);
}