summaryrefslogtreecommitdiff
path: root/lib/make/configure.pl
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-02-20 17:26:52 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-02-20 17:26:52 +0000
commite864c32e6910469ef4866ad40a72a232ee4bd822 (patch)
tree575511e409b4b31b3e8fd1d374434bfc3055db66 /lib/make/configure.pl
parent4eff4db6899301b7b7d4286a0bc18f7970090914 (diff)
Can now pass options to the configure script
use make <config> options=<option-file-name> when making a new configuration. <option-file-name> has the format of keyword value or keyword = value Note that even though it will allow a vlue to be blank, the configure script itself will ignore this, so it's not so easy to tell it to ignore, say, your f90 compiler. The configure script now uses the f90 compiler for f77, or the f77 compiler if there is no f90 compiler. The configure.pl script will produce a dummy fortran_name perl script if there is no fortran compiler. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@319 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/configure.pl')
-rwxr-xr-xlib/make/configure.pl158
1 files changed, 86 insertions, 72 deletions
diff --git a/lib/make/configure.pl b/lib/make/configure.pl
index 654e417c..a71c43b2 100755
--- a/lib/make/configure.pl
+++ b/lib/make/configure.pl
@@ -12,11 +12,6 @@
$tmphome = shift(@ARGV);
-if(! $compiler)
-{
- $compiler="f90"
-}
-
print "Determining number of fortran underscores...\n";
push(@routines, &test_fortran_name);
@@ -39,10 +34,12 @@ sub test_fortran_name
local($retcode, $line, $name, $case, $n_underscores);
local($underscore_suffix, $normal_suffix, $case_prefix);
- # Create a test file
- open(OUT, ">fname_test.f") || die "Cannot open fname_test.f\n";
+ if($compiler)
+ {
+ # Create a test file
+ open(OUT, ">fname_test.f") || die "Cannot open fname_test.f\n";
- print OUT <<EOT;
+ print OUT <<EOT;
subroutine test_name(a)
integer a
a = 1
@@ -51,94 +48,111 @@ sub test_fortran_name
EOT
- close OUT;
-
- # Compile the test file
- print "Compiling test file with $compiler...\n";
- system("$compiler -c fname_test.f");
+ close OUT;
+
+ # Compile the test file
+ print "Compiling test file with $compiler...\n";
+ system("$compiler -c fname_test.f");
- $retcode = $? >> 8;
+ $retcode = $? >> 8;
- if($retcode > 0)
- {
- print "Failed to compile fname_test.f\n";
- }
+ if($retcode > 0)
+ {
+ print "Failed to compile fname_test.f\n";
+ }
- # Search the object file for the appropriate symbols
- open(IN, "<fname_test.o") || die "Cannot open fname_test.o\n";
+ # Search the object file for the appropriate symbols
+ open(IN, "<fname_test.o") || die "Cannot open fname_test.o\n";
- while(<IN>)
- {
- $line = $_;
- if($line =~ m:(TEST_NAME)(_*):i)
+ while(<IN>)
{
- $name = $1;
- $underscores = $2;
-
- if($name =~ m:TEST_NAME:)
- {
- print "Uppercase - ";
- $case = 1;
- }
- if($name =~ m:test_name:)
- {
- print "Lowercase - ";
- $case = 0;
- }
- if($underscores eq "")
+ $line = $_;
+ if($line =~ m:(TEST_NAME)(_*):i)
{
- 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;
+ $name = $1;
+ $underscores = $2;
+
+ 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.*>;
+ # Delete the temporary files
+ unlink <fname_test.*>;
- # Determine the case and number of underscores
- ($underscore_suffix, $normal_suffix, $case_prefix) = &determine_transformation($n_underscores, $case);
+ # Determine the case and number of underscores
+ ($underscore_suffix, $normal_suffix, $case_prefix) = &determine_transformation($n_underscores, $case);
- $data = "
+ $data = "
sub fortran_name
{
- local(\$old_name) = \@_;
- local(\$new_name);
+ local(\$old_name) = \@_;
+ local(\$new_name);
- \$new_name = \"$case_prefix\$old_name\\E\";
-
- if(\$new_name =~ m:_: )
- {
- \$new_name = \$new_name.\"$underscore_suffix\";
- }
- else
- {
- \$new_name = \$new_name.\"$normal_suffix\";
- }
+ \$new_name = \"$case_prefix\$old_name\\E\";
+
+ if(\$new_name =~ m:_: )
+ {
+ \$new_name = \$new_name.\"$underscore_suffix\";
+ }
+ else
+ {
+ \$new_name = \$new_name.\"$normal_suffix\";
+ }
- return \$new_name;
+ return \$new_name;
}
";
+ }
+ else
+ {
+ print "No Fortran compiler - creating null fortran name conversion routine.\n";
+
+$data = "
+
+sub fortran_name
+{
+ local(\$old_name) = \@_;
+
+ return \"\$old_name\";
+
+}
+";
+}
return $data;
}
+
sub test_fortran_common_name
{
local($data);