summaryrefslogtreecommitdiff
path: root/lib/sbin
diff options
context:
space:
mode:
authoreschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2010-12-23 20:23:30 +0000
committereschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2010-12-23 20:23:30 +0000
commitaa5e6558158480ab3983beb4daa1fdadeac95410 (patch)
tree711d141ce2e4351e3a0fe66350dd215801fd336b /lib/sbin
parent9df8577df5231aa503dafb265ba1698e294029be (diff)
Improve optional requirement of capabilities
Thorns can specify that they can make use of a particular capability (for example HDF5), but that it is not absolutely required. It is currently not possible to detect a capability in the source code or make system of a thorn because there is no preprocessor macro and no make variable defined to indicate that the capability is available. Additionally, the preprocessor definitions which are explicitly provided by a capability are written to an include file which is malformed and hence these definitions cannot be read. This commit: * Introduces makefile and preprocessor variables HAVE_CAPABILITY_<cap> for each provided capability * Removes the incorrect definition line causing the include file to be malformed * Renames cctki_Capabilities.h to cctk_Capabilities.h and causes cctk_Capabilities.h to be included from cctk.h by all thorns * Excludes cctk_Capabilities.h from dependency checking (dependencies of the files included from this one will be sufficient) [Patch from Ian Hinder] git-svn-id: http://svn.cactuscode.org/flesh/trunk@4659 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin')
-rw-r--r--lib/sbin/CreateConfigurationBindings.pl9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sbin/CreateConfigurationBindings.pl b/lib/sbin/CreateConfigurationBindings.pl
index 87f63c23..296280d6 100644
--- a/lib/sbin/CreateConfigurationBindings.pl
+++ b/lib/sbin/CreateConfigurationBindings.pl
@@ -90,6 +90,8 @@ sub CreateConfigurationBindings
$temp .= $cfg->{"\U$thorn $providedcap\E MAKE_DEFINITION"};
}
+ $temp .= "HAVE_CAPABILITY_$providedcap = 1\n";
+
&WriteFile("Capabilities/make.\U$providedcap\E.defn",\$temp);
$temp = '';
@@ -106,6 +108,8 @@ sub CreateConfigurationBindings
$temp .= $lines . "\n";
}
+ $temp .= "#define HAVE_CAPABILITY_$providedcap 1\n";
+
&WriteFile("Capabilities/cctki_\U$providedcap\E.h",\$temp);
$temp = '';
@@ -163,7 +167,6 @@ sub CreateConfigurationBindings
{
$defs .= $providedcap . " = 1\n";
$defs .= "include $bindings_dir/Configuration/Capabilities/make.\U$providedcap\E.defn\n";
- $incs .= "#define " . $cfg->{"\U$thorn\E OPTIONAL \U$providedcap\E DEFINE"} . " 1\n";
$incs .= "#include \"../Capabilities/cctki_\U$providedcap\E.h\"\n";
$deps .= "include $bindings_dir/Configuration/Capabilities/make.\U$providedcap\E.deps\n";
}
@@ -205,7 +208,7 @@ sub CreateConfigurationBindings
$temp = $linkerdirs . "\n" . $linkerlibs . "\n";
&WriteFile("make.link",\$temp);
- # write cctki_Capabilities.h file to bindings/include
+ # write cctk_Capabilities.h file to bindings/include
# this file adds the if_i_am_thorn stuff
$temp = '';
foreach $thorn (sort keys %thorns)
@@ -218,7 +221,7 @@ sub CreateConfigurationBindings
$temp .= "\n";
}
}
- &WriteFile("../include/cctki_Capabilities.h",\$temp);
+ &WriteFile("../include/cctk_Capabilities.h",\$temp);
}
return 1;