summaryrefslogtreecommitdiff
path: root/lib/sbin/BuildHeaders.pl
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-06-24 14:53:03 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-06-24 14:53:03 +0000
commit50682e25a2a4ba7f21ff52e00495fe902d9e94a6 (patch)
tree80337d9765508c59cf81d79549ee200b6a1dd623 /lib/sbin/BuildHeaders.pl
parent193817db308f10a76b51ad9e7b6771497ff274dc (diff)
Changes to the build include files mechanism to differentiate between source code includes (which are protected by a call to "IsThornActive" and header includes which are not.
New notation is INCLUDES HEADER: (=INCLUDES:) INCLUDES SOURCE: USES INCLUDE HEADER: (=USES INCLUDE:) USES INCLUDE SOURCE: git-svn-id: http://svn.cactuscode.org/flesh/trunk@1697 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/BuildHeaders.pl')
-rw-r--r--lib/sbin/BuildHeaders.pl46
1 files changed, 42 insertions, 4 deletions
diff --git a/lib/sbin/BuildHeaders.pl b/lib/sbin/BuildHeaders.pl
index e6a667a7..265803b6 100644
--- a/lib/sbin/BuildHeaders.pl
+++ b/lib/sbin/BuildHeaders.pl
@@ -30,8 +30,11 @@ sub BuildHeaders
{
foreach $inc_file (split(" ",$interface_database{"\U$thorn USES HEADER"}))
{
-# $data{"$inc_file"} = "/* Include file $inc_file used by $thorn */\n\n";
- $data{"$inc_file"} = "/* Include file $inc_file */\n\n";
+ $data{"$inc_file"} = "/* Include header file $inc_file */\n\n";
+ }
+ foreach $inc_file (split(" ",$interface_database{"\U$thorn USES SOURCE"}))
+ {
+ $data{"$inc_file"} = "/* Include source file $inc_file */\n\n";
}
}
@@ -49,7 +52,7 @@ sub BuildHeaders
$inc_file2 = $interface_database{"\U$thorn ADD HEADER $inc_file1 TO"};
# Write information to the global include file
- $data{"$inc_file2"} .= "/* Including file $inc_file1 from $thorn */\n";
+ $data{"$inc_file2"} .= "/* Including header file $inc_file1 from $thorn */\n";
# Now have to find the include file and copy it
if (-e "$cctk_home/arrangements/$arrangement/$thorn/src/$inc_file1")
@@ -65,9 +68,40 @@ sub BuildHeaders
$message = "Include file $inc_file1 not found in $arrangement/$thorn\n";
&CST_error(0,$message,__LINE__,__FILE__);
}
- $data{"$inc_file2"} .= "/* End of include file $inc_file1 from $thorn */\n";
+ $data{"$inc_file2"} .= "/* End of include header file $inc_file1 from $thorn */\n";
+ }
+ }
+
+ foreach $inc_file1 (split(" ",$interface_database{"\U$thorn ADD SOURCE"}))
+ {
+ if ($inc_file1 !~ /^\s*$/)
+ {
+ $inc_file1 =~ s/ //g;
+ $inc_file2 = $interface_database{"\U$thorn ADD SOURCE $inc_file1 TO"};
+
+ # Write information to the global include file
+ $data{"$inc_file2"} .= "/* Including source file $inc_file1 from $thorn */\n";
+
+ # Now have to find the include file and copy it
+ if (-e "$cctk_home/arrangements/$arrangement/$thorn/src/$inc_file1")
+ {
+ $data{"$inc_file2"} .= "if (CCTK_IsThornActive(\"$thorn\")){\n";
+ $data{"$inc_file2"} .= "#include \"$arrangement/$thorn/src/$inc_file1\"\n}\n";
+ }
+ elsif (-e "$cctk_home/arrangements/$arrangement/$thorn/src/include/$inc_file1")
+ {
+ $data{"$inc_file2"} .= "if (CCTK_IsThornActive(\"$thorn\")){\n";
+ $data{"$inc_file2"} .= "#include \"$arrangement/$thorn/src/include/$inc_file1\"\n}\n";
+ }
+ else
+ {
+ $message = "Include file $inc_file1 not found in $arrangement/$thorn\n";
+ &CST_error(0,$message,__LINE__,__FILE__);
+ }
+ $data{"$inc_file2"} .= "/* End of include source file $inc_file1 from $thorn */\n";
}
}
+
}
foreach $thorn (split(" ",$interface_database{"THORNS"}))
@@ -76,6 +110,10 @@ sub BuildHeaders
{
&WriteFile($inc_file1,\$data{"$inc_file1"});
}
+ foreach $inc_file1 (split(" ",$interface_database{"\U$thorn USES SOURCE"}))
+ {
+ &WriteFile($inc_file1,\$data{"$inc_file1"});
+ }
}
chdir $start_dir;