enum ast_module_flags {
AST_MODFLAG_DEFAULT = 0,
AST_MODFLAG_GLOBAL_SYMBOLS = (1 << 0),
+ AST_MODFLAG_BUILDSUM = (1 << 1),
};
struct ast_module_info {
AST_MODULE, \
desc, \
keystr, \
- flags_to_set, \
+ flags_to_set | AST_MODFLAG_BUILDSUM, \
AST_BUILDOPT_SUM, \
}; \
static void __attribute__ ((constructor)) __reg_module(void) \
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...) \
static struct ast_module_info __mod_info = { \
.name = AST_MODULE, \
- .flags = flags_to_set, \
+ .flags = flags_to_set | AST_MODFLAG_BUILDSUM, \
.description = desc, \
.key = keystr, \
.buildopt_sum = AST_BUILDOPT_SUM, \
return 1;
}
- if (!ast_strlen_zero(mod->info->buildopt_sum) &&
- strcmp(buildopt_sum, mod->info->buildopt_sum)) {
+ if (!ast_test_flag(mod->info, AST_MODFLAG_BUILDSUM)) {
+ ast_log(LOG_WARNING, "Module '%s' was not compiled against a recent version of Asterisk and may cause instability.\n", mod->resource);
+ } else if (!ast_strlen_zero(mod->info->buildopt_sum) &&
+ strcmp(buildopt_sum, mod->info->buildopt_sum)) {
ast_log(LOG_WARNING, "Module '%s' was not compiled with the same compile-time options as this version of Asterisk.\n", mod->resource);
ast_log(LOG_WARNING, "Module '%s' will not be initialized as it may cause instability.\n", mod->resource);
return 1;