In one of my modules I have the following piece of code:
my $C_support = Module::Build::ConfigData->feature("C_support")
my $builder = Module::Build->new(
...
config_data => {
C_support => $C_support
}
);
$builder->xs_files({}) if not $C_support;
Then in the code I detect it by loading Module_name::ConfigData and calling the config method.
if (Module_name::ConfigData->config("C_support")) {
XSLoader::load(__PACKAGE__, $VERSION);
}
if (not defined &somefunction) {
#define it
}
Leon Timmermans
2010-04-07 08:32:19