summaryrefslogtreecommitdiff
path: root/lib/make/setup_configuration.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/setup_configuration.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/setup_configuration.pl')
-rwxr-xr-xlib/make/setup_configuration.pl75
1 files changed, 69 insertions, 6 deletions
diff --git a/lib/make/setup_configuration.pl b/lib/make/setup_configuration.pl
index 1eb0d884..ca28c351 100755
--- a/lib/make/setup_configuration.pl
+++ b/lib/make/setup_configuration.pl
@@ -4,9 +4,11 @@
# @date Fri Jan 8 13:48:48 1999
# @author Tom Goodale
# @desc
-# Prototype setup file for the CCTK
+# Setup file for a new configuration in the CCTK
+# Invocation is
+# setup_configuration [-reconfig] [-config_file=<options>] config_name
# @enddesc
-# @version $Id$
+# @version $Header$
#@@*/
$top = `pwd`;
@@ -42,7 +44,7 @@ if (! -d "configs" && ! -l "configs")
}
-chdir configs;
+chdir "configs";
# The specified configuration doesn't exist
if (! -d "$config" && ! -l "$config")
@@ -56,11 +58,10 @@ if (! -d "$config" && ! -l "$config")
mkdir("build",0755);
mkdir("lib",0755);
mkdir("config-data",0755);
- mkdir("libraries",0755);
chdir "config-data";
- $ENV{"EXE"} = "cctk";
+ &SetConfigureEnv();
system("$configure");
chdir "..";
@@ -76,9 +77,71 @@ if($reconfig)
chdir "config-data";
- $ENV{"EXE"} = "cctk";
+ &SetConfigureEnv();
system("$configure");
chdir "..";
chdir "..";
}
+
+#/*@@
+# @routine
+# @date Fri Feb 19 19:53:48 1999
+# @author Tom Goodale
+# @desc
+# Sets the environment for running the configure script.
+# @enddesc
+# @calls
+# @calledby
+# @history
+#
+# @endhistory
+#
+#@@*/
+sub SetConfigureEnv
+{
+ local($line_number) = 0;
+ # Set a default name for the configuration
+ $ENV{"EXE"} = "cactus_$config";
+
+ if($config_file)
+ {
+ # The user has specified a configuration file
+
+ print "Using configuration options from $config_file...\n";
+ open(INFILE, "<$top/$config_file") || die "Cannot open configuration file $config_file";
+
+ while(<INFILE>)
+ {
+ $line_number++;
+
+ #Ignore comments.
+ s/\#(.*)$//g;
+
+ s/\n//g; # Different from chop...
+
+ #Ignore blank lines
+ next if (m:^\s*$:);
+
+ # Match lines of the form
+ # keyword value
+ # or keyword = value
+ m/\s*([^\s=]*)([\s]*=?\s*)(.*)\s*/;
+
+ if($1 && $2)
+ {
+ print "Setting $1 to '$3'\n";
+ $ENV{"$1"} = $3;
+ }
+ else
+ {
+ print "Could not parse configuration line $line_number...\n'$_'\n";
+ }
+
+ }
+ print "End of options from $config_file.\n";
+
+ close(INFILE);
+ }
+
+}