diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-06-24 16:49:51 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-06-24 16:49:51 +0000 |
commit | 1b1ed402da4b65e4e018f58f5945359142a5c6ee (patch) | |
tree | 2ff7cea84219a746401dd01d5d54b0a7a0cc7718 /lib/sbin/BuildHeaders.pl | |
parent | 65ba261c81e1414af1da7783ab92247ce5d3ef44 (diff) |
A problem with my last commit for putting IsThornActive around built
include files is that I only did it for C ! Fortran isn't so easy to
add because of having to declare stuff ... IsThornActive for fortran
is commented out while I think how to do it.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1703 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/BuildHeaders.pl')
-rw-r--r-- | lib/sbin/BuildHeaders.pl | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/sbin/BuildHeaders.pl b/lib/sbin/BuildHeaders.pl index 265803b6..aa404429 100644 --- a/lib/sbin/BuildHeaders.pl +++ b/lib/sbin/BuildHeaders.pl @@ -19,7 +19,7 @@ require "$sbin_dir/CSTUtils.pl"; sub BuildHeaders { my($cctk_home,$bindings_dir,%database) = @_; - my($start_dir,$thorn,$inc_file,$inc_file1,$inc_file2); + my($start_dir,$thorn,$inc_file,$inc_file1,$inc_file2,$tmpline); $start_dir = `pwd`; chdir $bindings_dir; @@ -85,19 +85,30 @@ sub BuildHeaders # 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"; + $tmpline = "#include \"$arrangement/$thorn/src/$inc_file1\"\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"; + $tmpline = "#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"} .= "#ifdef FCODE\n"; +# $data{"$inc_file2"} .= " if (CCTK_IsThornActive(\"$thorn\").eq.1) then\n"; + $data{"$inc_file2"} .= "#else\n"; + $data{"$inc_file2"} .= "if (CCTK_IsThornActive(\"$thorn\")){\n"; + $data{"$inc_file2"} .= "#endif\n"; + $data{"$inc_file2"} .= "$tmpline\n"; + $data{"$inc_file2"} .= "#ifdef FCODE\n"; +# $data{"$inc_file2"} .= " end if\n"; + $data{"$inc_file2"} .= "#else\n"; + $data{"$inc_file2"} .= "\n}\n"; + $data{"$inc_file2"} .= "#endif\n"; + $data{"$inc_file2"} .= "/* End of include source file $inc_file1 from $thorn */\n"; } } |