summaryrefslogtreecommitdiff
path: root/lib/make/setup_configuration.pl
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-09-23 11:13:26 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-09-23 11:13:26 +0000
commitd8f6ea6ed0e1713b07b3f52a6f54e19298066388 (patch)
tree237c1e91af54b3a8bba31bc15a552675acf75598 /lib/make/setup_configuration.pl
parent8b88cffae80aea8a769eedc5ab991fd3a5e3b723 (diff)
Implemented default users, option file and command line options for
configurations as described in the Spec http://www.cactuscode.org/Development/Specs/UserCustom.txt Also, the configuration flags line in configs/<config>/config-info now contains the exact resulting options used from these three sources (These options can now be seen with a new make target gmake <config>-configinfo) This changes previous behaviour in that the COMMAND LINE OPTIONS override all OPTIONS FILE options git-svn-id: http://svn.cactuscode.org/flesh/trunk@2381 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/setup_configuration.pl')
-rwxr-xr-xlib/make/setup_configuration.pl65
1 files changed, 51 insertions, 14 deletions
diff --git a/lib/make/setup_configuration.pl b/lib/make/setup_configuration.pl
index 13dafabe..322da557 100755
--- a/lib/make/setup_configuration.pl
+++ b/lib/make/setup_configuration.pl
@@ -94,21 +94,9 @@ else
chdir "$config" || die "Internal error - could't enter $configs_dir/$config";
-open(INFO, ">config-info") || die "Internal error - couldn't create $configs_dir/$config/config-info";
-
-print INFO "CONFIG : $config\n";
-print INFO "CONFIG-FLAGS : " . $ENV{"MAKEFLAGS"} . "\n";
-print INFO "CONFIG-DATE : " . gmtime(time()) . "\n";
-
-$host = `hostname`;
-
-chop $host;
-
-print INFO "CONFIG-HOST : " . $host . "\n";
-
chdir "config-data" || die "Internal error - could't enter $configs_dir/$config/config-data";
-&SetConfigureEnv();
+%CONFIGURED = &SetConfigureEnv();
$configure_command = &DetermineConfigureCommand($configure, %ENV);
@@ -118,7 +106,24 @@ $retcode = $? >> 8;
chdir "..";
-print INFO "CONFIG-STATUS : $retcode\n";
+open(INFO, ">config-info") || die "Internal error - couldn't create $configs_dir/$config/config-info";
+
+print INFO "CONFIG : $config\n";
+print INFO "CONFIG-FLAGS : ";
+foreach $setting (keys %CONFIGURED)
+{
+ print INFO "$setting=$CONFIGURED{\"$setting\"} ";
+}
+print INFO "\n";
+print INFO "CONFIG-DATE : " . gmtime(time()) . "\n";
+
+$host = `hostname`;
+
+chop $host;
+
+print INFO "CONFIG-HOST : " . $host . "\n";
+
+print INFO "CONFIG-STATUS : $retcode\n\n";
close(INFO);
@@ -178,6 +183,8 @@ sub SetConfigureEnv
{
print "Setting $1 to '$3'\n";
$ENV{"$1"} = $3;
+ # Remember it for writing to config-info
+ $CONFIGURED{"$1"} = $3;
}
else
{
@@ -185,6 +192,7 @@ sub SetConfigureEnv
}
}
print "End of options from user defaults.\n";
+
close(INFILE);
}
@@ -227,6 +235,8 @@ sub SetConfigureEnv
{
print "Setting $1 to '$3'\n";
$ENV{"$1"} = $3;
+ # Remember it for writing to config-info
+ $CONFIGURED{"$1"} = $3;
}
else
{
@@ -239,6 +249,33 @@ sub SetConfigureEnv
close(INFILE);
}
+ $commandline = $ENV{"MAKEFLAGS"};
+ $used_commandline = 0;
+ while ($commandline =~ /^(.*)\s+(\w*)\s*=\s*([\w\\\s]*)\s*$/)
+ {
+ if ($2 ne "options")
+ {
+ if (!$used_commandline)
+ {
+ print "Using configuration options from configure line\n";
+ }
+ $used_commandline = 1;
+ $ENV{"$2"} = $3;
+ # Remember it for writing to config-info
+ $CONFIGURED{"$2"} = $3;
+
+ print "Setting $2 to $3\n";
+ }
+ $commandline=$1;
+ # print "New commandline = <$commandline>\n";
+ }
+ if ($used_commandline)
+ {
+ print "End of options from configure line\n";
+ }
+
+ return %CONFIGURED;
+
}
sub DetermineConfigureCommand