diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-02-18 08:27:53 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-02-18 08:27:53 +0000 |
commit | 2727b5f02529c012200b1d6cac263ff0664eb3aa (patch) | |
tree | bc137fb31ced4f2e4f226020d2668831ccecf632 /lib | |
parent | 6b7d42620b675fa0ce5cf91634cdd7466d6cab62 (diff) |
Should now work properly if there is no fortran compiler.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1393 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/make/configure.pl | 153 |
1 files changed, 85 insertions, 68 deletions
diff --git a/lib/make/configure.pl b/lib/make/configure.pl index 8b78bed6..b857dd73 100755 --- a/lib/make/configure.pl +++ b/lib/make/configure.pl @@ -34,7 +34,7 @@ sub test_fortran_name local($retcode, $line, $name, $case, $n_underscores); local($underscore_suffix, $normal_suffix, $case_prefix); - if($compiler) + if($compiler && $compiler ne "") { # Create a test file open(OUT, ">fname_test.f") || die "Cannot open fname_test.f\n"; @@ -172,10 +172,12 @@ sub test_fortran_common_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 && $compiler ne "") + { + # 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 real b common /test_common/b @@ -185,82 +187,82 @@ sub test_fortran_common_name EOT - close OUT; - - # Compile the test file - print "Compiling test file with $compiler...\n"; - system("$compiler -c fname_test.f"); - - $retcode = $? >> 8; - - if($retcode > 0) - { - print "Failed to compile fname_test.f\n"; - } + close OUT; + # Compile the test file + print "Compiling test file with $compiler...\n"; + system("$compiler -c fname_test.f"); + + $retcode = $? >> 8; + + if($retcode > 0) + { + print "Failed to compile fname_test.f\n"; + } - # Search the object file for the appropriate symbols + + # 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:(_[\w_]*)?(TEST_COMMON)(_*):i) + + while(<IN>) { - $prefix = $1; - $name = $2; - $underscores = $3; - - # This is a pain. If all symbols have underscores, need to remove - # the first one here. - - if($symbols_preceeded_by_underscores) + $line = $_; + if($line =~ m:(_[\w_]*)?(TEST_COMMON)(_*):i) { - if($prefix =~ m:^_(.*):) + $prefix = $1; + $name = $2; + $underscores = $3; + + # This is a pain. If all symbols have underscores, need to remove + # the first one here. + + 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; - - # Delete the temporary files - unlink <fname_test.*>; + } + + close IN; + + # 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_common_name { local(\$old_name) = \@_; @@ -282,6 +284,21 @@ sub fortran_common_name "; + } + else + { + $data = " + +sub fortran_common_name +{ + local(\$old_name) = \@_; + + return \"\$old_name\"; + +} +"; +} + return $data; } |