summaryrefslogtreecommitdiff
path: root/lib/sbin
diff options
context:
space:
mode:
authoreschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2010-09-02 23:03:12 +0000
committereschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2010-09-02 23:03:12 +0000
commitdb0273084426e6592507df68423a3f8b5961a026 (patch)
treeca88e5cf903826b8a13d3f505cceb91d23e09113 /lib/sbin
parent742be9f129404cf77cca4d1c4d5bf2e3055d0877 (diff)
Correct handling multi-line BEGIN DEFINE blocks in configurations scripts
I have discovered a bug in the CreateConfigurationBindings.pl script that prevents one from declaring more than one definition via the "BEGIN DEFINE" block in a configuration script. This is because the perl script receives the entire block as a single string, prefixes it with "#define" and then writes to the cctki_THORN.h file. I have modified the script to split the string on newlines and then prefix each line with "#define", which then provides the expected behavior. [Patch from Eric L. Seidel] git-svn-id: http://svn.cactuscode.org/flesh/trunk@4629 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin')
-rw-r--r--lib/sbin/CreateConfigurationBindings.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/sbin/CreateConfigurationBindings.pl b/lib/sbin/CreateConfigurationBindings.pl
index 3f40b7c9..87f63c23 100644
--- a/lib/sbin/CreateConfigurationBindings.pl
+++ b/lib/sbin/CreateConfigurationBindings.pl
@@ -60,7 +60,7 @@ sub CreateConfigurationBindings
}
- # this string goes into the cactus executable directly
+ # this string goes into the cactus executable directly
$linkerflagdirs = '';
$linkerflaglibs = '';
@@ -101,7 +101,9 @@ sub CreateConfigurationBindings
if ($cfg->{"\U$thorn $providedcap\E DEFINE"})
{
- $temp .= "#define " . $cfg->{"\U$thorn $providedcap\E DEFINE"};
+ my $lines = $cfg->{"\U$thorn $providedcap\E DEFINE"};
+ $lines =~ s/^(.*)/#define $1/gm;
+ $temp .= $lines . "\n";
}
&WriteFile("Capabilities/cctki_\U$providedcap\E.h",\$temp);
@@ -126,7 +128,7 @@ sub CreateConfigurationBindings
$linker_thorns{"$thorn"} = $thorn;
$linker_cfg{"\U$thorn\E USES"} = $cfg->{"\U$thorn\E USES THORNS"};
}
- }
+ }
}
}
@@ -184,7 +186,7 @@ sub CreateConfigurationBindings
unlink "./Thorns/cctki_$thorn.h";
unlink "./Thorns/make.$thorn.deps";
}
-
+
}
# Sort the linker thorns