diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-02-17 15:04:24 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-02-17 15:04:24 +0300 |
commit | 2300ff734633aa85f5ef52d6310c7253ecc5b4bc (patch) | |
tree | ae67f35413ceb82257304fefbe08c3f74bbb518f /utils | |
parent | 0fd2682e113c400af6c43da72543bd75448e5be8 (diff) | |
download | rspamd-2300ff734633aa85f5ef52d6310c7253ecc5b4bc.tar.gz rspamd-2300ff734633aa85f5ef52d6310c7253ecc5b4bc.zip |
* Add issue to cmake to make perl module as well
* Fix some portability issues (to FreeBSD mainly)
* Add script to make modules list
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/gen-modules.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/utils/gen-modules.sh b/utils/gen-modules.sh new file mode 100755 index 000000000..ec8191c66 --- /dev/null +++ b/utils/gen-modules.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# +# This script generate modules.c and modules.h for rspamd +# Used by build system + +echo "#ifndef MODULES_H" > modules.h +echo "#include \"config.h\"" >> modules.h +echo "#include \"modules.h\"" > modules.c +echo "module_t modules[] = {" >> modules.c; + +for arg in $@ ; do + IFS=/ + for comp in ${arg} ; do + echo $comp | egrep '^[^/]+.c$' > /dev/null 2>&1 + if [ $? -eq 0 ] ; then + mod=`echo $comp | sed -e 's/.c$//'` + fi + done + if [ "F${mod}" != "F" ] ; then + echo "{\"${mod}\", ${mod}_module_init, ${mod}_module_config, ${mod}_module_reconfig}," >> modules.c + echo "int ${mod}_module_init(struct config_file *cfg, struct module_ctx **ctx);" >> modules.h + echo "int ${mod}_module_config(struct config_file *cfg);" >> modules.h + echo "int ${mod}_module_reconfig(struct config_file *cfg);" >> modules.h + fi + IFS=" " +done + +echo "};" >> modules.c +echo "#endif" >> modules.h |