summaryrefslogtreecommitdiff
path: root/lib/sbin/CST
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-05-17 11:20:51 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-05-17 11:20:51 +0000
commit8ac5f09bc61d203c9663855e42881ed651ecd089 (patch)
treea4f3a9b9897bbe787464ca17a481b644d63fb772 /lib/sbin/CST
parentdb650730ec09e5cba07219dada04dde9a1f07401 (diff)
Allow a thorn, which PROVIDES a certain capability, to also REQUIRE it.
In this case the REQUIRES clause will be silently ignored to avoid cyclic dependencies in the makefile as well as for the tsort algorithm. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3739 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/CST')
-rw-r--r--lib/sbin/CST21
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/sbin/CST b/lib/sbin/CST
index d85e608d..9966e54b 100644
--- a/lib/sbin/CST
+++ b/lib/sbin/CST
@@ -6,7 +6,7 @@
# @desc
# Parses the the configuration files for thorns.
# @enddesc
-# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/sbin/CST,v 1.69 2004-05-09 23:01:24 tradke Exp $
+# @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/sbin/CST,v 1.70 2004-05-17 11:20:51 tradke Exp $
#@@*/
# Global parameter to track the number of errors from the CST
@@ -414,7 +414,7 @@ sub CreateThornDependencyList
# my $line = "USESTHORNS_$thorn = Cactus CactusBindings";
foreach my $dep (sort (split (' ', $configuration_database->{"\U$thorn\E USES THORNS"})))
{
- $line .= " $dep";
+ $line .= " $dep" if ($dep ne $thorn);
}
push (@varlist, $line);
push (@deplist, "\$(CCTK_LIBDIR)/\$(LIBNAME_PREFIX)$thorn\$(LIBNAME_SUFFIX): \$(USESTHORNS_$thorn:%=\$(CCTK_LIBDIR)/\$(LIBNAME_PREFIX)%\$(LIBNAME_SUFFIX))");
@@ -566,18 +566,17 @@ sub TopoSort
{
next if ("\U$thorn\E" eq "CACTUS");
- my @temp = split (' ', $cfg->{"\U$thorn\E USES THORNS"});
+ my @uses_thorns = split (' ', $cfg->{"\U$thorn\E USES THORNS"});
- if ($cfg->{"\U$thorn\E USES THORNS"} eq '')
+ my $uses_thorns = '';
+ foreach (@uses_thorns)
{
- $data .= "dummy $thorn\n";
- }
-
- $ending_value = scalar(@temp);
- for($counter=0 ; $counter < $ending_value ; $counter++)
- {
- $data .= "$thorn" . " " . "$temp[$counter]" . "\n";
+ # ignore if a thorn wants to use only itself
+ # otherwise we'll get a cyclic list later in the topological sort
+ $uses_thorns .= "$thorn $_\n" if ($thorn ne $_);
}
+ $uses_thorns = "dummy $thorn\n" if (! $uses_thorns);
+ $data .= $uses_thorns;
}
if ($data)