summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-01-08 14:20:58 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-01-08 14:20:58 +0000
commit673f037abca59a419000b33a729a9fa611ba3191 (patch)
tree88f82b27447596ad237ff35788905d6e497f19cf /lib
parent08df01ef52806e5e5bf03159dd360e690557ba1e (diff)
Fixed bug when opening test fortran file (didn't specify opening for writing).
Added comments. Added unlinking of temporary files. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@41 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib')
-rw-r--r--lib/sbin/configure.pl21
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/sbin/configure.pl b/lib/sbin/configure.pl
index c7fcc95e..87193dc4 100644
--- a/lib/sbin/configure.pl
+++ b/lib/sbin/configure.pl
@@ -1,8 +1,19 @@
#!/bin/perl
+#/*@@
+# @file configure.pl
+# @date Fri Jan 8 15:06:22 1999
+# @author Tom Goodale
+# @desc
+# Prototype configure script for the CCTK
+# @enddesc
+#@@*/
$tmphome = shift(@ARGV);
-open(OUT, "fname_test.f") || die "Cannot open fname_test.f\n";
+print "Determining number of fortran underscores...\n";
+
+# Create a test file
+open(OUT, ">fname_test.f") || die "Cannot open fname_test.f\n";
print OUT <<EOT;
subroutine test_name(a)
@@ -15,6 +26,7 @@ EOT
close OUT;
+# Compile the test file
system("f90 -c fname_test.f");
$retcode = $? >> 8;
@@ -25,6 +37,7 @@ if($retcode > 0)
}
+# Search the object file for the appropriate symbols
open(IN, "<fname_test.o") || die "Cannot open fname_test.o\n";
while(<IN>)
@@ -66,6 +79,10 @@ while(<IN>)
close IN;
+# Delete the temporary files
+unlink <fname_test.*>;
+
+# Determine the case and number of underscores
if($n_underscores == 0)
{
$normal_suffix = "";
@@ -94,7 +111,7 @@ if($case = 1)
}
-
+# Create the perl module to map the fortran names.
open(OUT, ">$tmphome/fortran_name.pl") || die "Cannot create fortran_name.pl\n";
print OUT <<EOT;
#!/bin/perl