diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2018-11-05 11:19:23 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2018-11-05 11:19:23 +0200 |
commit | 29583de41d70ec5ef37e87fa1ddddc0f7a15539f (patch) | |
tree | 2d2c8763b5df90ce8f642bb99c54ba6a50e49117 /src | |
parent | 53d0561ca828459d280cbfa5d2b3950e133da81e (diff) | |
download | mailfromd-29583de41d70ec5ef37e87fa1ddddc0f7a15539f.tar.gz mailfromd-29583de41d70ec5ef37e87fa1ddddc0f7a15539f.tar.bz2 |
Change generation of debug names for built-in modules
* src/builtin/Makefile.am (.bi.c): Don't define SOURCE
* src/builtin/snarf.m4 (MF_SOURCE_DEBUG_NAME): Remove.
(MF_MODULE_DEBUG_NAME): New macro.
(_init_builtin): Use MF_MODULE_DEBUG_NAME
Diffstat (limited to 'src')
-rw-r--r-- | src/builtin/Makefile.am | 2 | ||||
-rw-r--r-- | src/builtin/snarf.m4 | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/builtin/Makefile.am b/src/builtin/Makefile.am index 7d5db661..e9ee8e20 100644 --- a/src/builtin/Makefile.am +++ b/src/builtin/Makefile.am | |||
@@ -79,17 +79,17 @@ AM_CPPFLAGS = \ | |||
79 | -I$(top_srcdir)\ | 79 | -I$(top_srcdir)\ |
80 | $(DSPAM_CFLAGS) | 80 | $(DSPAM_CFLAGS) |
81 | 81 | ||
82 | builtin.h: Makefile.am builtin.def init.m4 | 82 | builtin.h: Makefile.am builtin.def init.m4 |
83 | 83 | ||
84 | $(BI_FILES:.bi=.c): snarf.m4 init.m4 | 84 | $(BI_FILES:.bi=.c): snarf.m4 init.m4 |
85 | 85 | ||
86 | SUFFIXES = .bi .c .def .h .mfi .mf | 86 | SUFFIXES = .bi .c .def .h .mfi .mf |
87 | 87 | ||
88 | M4=m4 | 88 | M4=m4 |
89 | 89 | ||
90 | .bi.c: | 90 | .bi.c: |
91 | $(AM_V_GEN)$(M4) --prefix -s -DSOURCE="$<" $(top_srcdir)/src/builtin/snarf.m4 $< > $@ | 91 | $(AM_V_GEN)$(M4) --prefix -s $(top_srcdir)/src/builtin/snarf.m4 $< > $@ |
92 | 92 | ||
93 | .def.h: | 93 | .def.h: |
94 | $(AM_V_GEN) $(M4) --prefix $(top_srcdir)/src/builtin/init.m4 $(BI_FILES) $< > $@ | 94 | $(AM_V_GEN) $(M4) --prefix $(top_srcdir)/src/builtin/init.m4 $(BI_FILES) $< > $@ |
95 | 95 | ||
diff --git a/src/builtin/snarf.m4 b/src/builtin/snarf.m4 index 2a32b02a..acb05ed9 100644 --- a/src/builtin/snarf.m4 +++ b/src/builtin/snarf.m4 | |||
@@ -74,30 +74,30 @@ __mf_define_fun([<$1>])>]) | |||
74 | m4_pushdef([<MF_MODULE_NAME>]) | 74 | m4_pushdef([<MF_MODULE_NAME>]) |
75 | 75 | ||
76 | /* MF_BUILTIN_MODULE([NAME]) | 76 | /* MF_BUILTIN_MODULE([NAME]) |
77 | * ------------------------- | 77 | * ------------------------- |
78 | * Start MFL built-in module text. Optional NAME is the name of the module. | 78 | * Start MFL built-in module text. Optional NAME is the name of the module. |
79 | * If not supplied, the name is defined as the base name of the module file. | 79 | * If not supplied, the name is defined as the base name of the module file. |
80 | */ | 80 | */ |
81 | m4_define([<MF_BUILTIN_MODULE>],m4_dnl | 81 | m4_define([<MF_BUILTIN_MODULE>],m4_dnl |
82 | [<m4_pushdef([<MF_MODULE_NAME>],m4_dnl | 82 | [<m4_pushdef([<MF_MODULE_NAME>],m4_dnl |
83 | m4_ifelse([<$1>],,[<m4_dnl | 83 | m4_ifelse([<$1>],,[<m4_dnl |
84 | m4_patsubst(m4___file__,\(.*/\)?\(.*\)\.bi,\2)>],[<$1>]))>])m4_dnl | 84 | m4_patsubst(m4___file__,\(.*/\)?\(.*\)\.bi,\2)>],[<$1>]))>])m4_dnl |
85 | 85 | ||
86 | /* MF_SOURCE_DEBUG_NAME(MODULE) | 86 | /* MF_MODULE_DEBUG_NAME |
87 | * ---------------------------- | 87 | * -------------------- |
88 | * Expand to the "debug" name for the MODULE. | 88 | * Expand to the "debug" name for the MODULE. |
89 | */ | 89 | */ |
90 | m4_define([<MF_SOURCE_DEBUG_NAME>],[<m4_dnl | 90 | m4_define([<MF_MODULE_DEBUG_NAME>],[<m4_dnl |
91 | m4_translit(m4_patsubst($1,\(.*/\)?\(.*\)\.bi,bi_\2),[<A-Z->],[<a-z_>])>]) | 91 | [<bi_>]m4_translit(MF_MODULE_NAME,[<A-Z->],[<a-z_>])>]) |
92 | 92 | ||
93 | /* MF_MODULE_IDX() | 93 | /* MF_MODULE_IDX() |
94 | * --------------- | 94 | * --------------- |
95 | * Expand to the BUILTIN_IDX_ constant for the current module. | 95 | * Expand to the BUILTIN_IDX_ constant for the current module. |
96 | */ | 96 | */ |
97 | m4_define([<MF_MODULE_IDX>],[<m4_dnl | 97 | m4_define([<MF_MODULE_IDX>],[<m4_dnl |
98 | [<BUILTIN_IDX_>]MF_MODULE_NAME()>]) | 98 | [<BUILTIN_IDX_>]MF_MODULE_NAME()>]) |
99 | 99 | ||
100 | /* __mf_argtype(arg) | 100 | /* __mf_argtype(arg) |
101 | * ----------------- | 101 | * ----------------- |
102 | * Expand to Mailfromd value type code corresponding to ARG: | 102 | * Expand to Mailfromd value type code corresponding to ARG: |
103 | * | 103 | * |
@@ -941,28 +941,28 @@ m4_define([<MF_INIT>],m4_dnl | |||
941 | [<m4_pushdef([<__MF_INIT_SEQUENCE>],[<$1>])>]) | 941 | [<m4_pushdef([<__MF_INIT_SEQUENCE>],[<$1>])>]) |
942 | 942 | ||
943 | /* Expand to the generated text upon the end of input. | 943 | /* Expand to the generated text upon the end of input. |
944 | */ | 944 | */ |
945 | m4_m4wrap([< | 945 | m4_m4wrap([< |
946 | m4_ifelse(MF_MODULE_NAME,,[<m4_errprint([<MF_BUILTIN_MODULE is missing | 946 | m4_ifelse(MF_MODULE_NAME,,[<m4_errprint([<MF_BUILTIN_MODULE is missing |
947 | >]) | 947 | >]) |
948 | m4_m4exit(1)>]) | 948 | m4_m4exit(1)>]) |
949 | m4_undefine([<__MF_PRIV_ID__>])m4_dnl | 949 | m4_undefine([<__MF_PRIV_ID__>])m4_dnl |
950 | m4_ifdef([<__MF_COND_SYMBOL>],[<#endif /[<>]* __MF_COND_SYMBOL */ | 950 | m4_ifdef([<__MF_COND_SYMBOL>],[<#endif /[<>]* __MF_COND_SYMBOL */ |
951 | >]) | 951 | >]) |
952 | void | 952 | void |
953 | MF_MODULE_NAME()_init_builtin() | 953 | MF_MODULE_NAME()_init_builtin(void) |
954 | { | 954 | { |
955 | m4_ifdef([<__MF_DEBUG>],[<m4_dnl | 955 | m4_ifdef([<__MF_DEBUG>],[<m4_dnl |
956 | debug_handle = mu_debug_register_category("MF_SOURCE_DEBUG_NAME(SOURCE)"); | 956 | debug_handle = mu_debug_register_category("MF_MODULE_DEBUG_NAME"); |
957 | >]) | 957 | >]) |
958 | m4_ifdef([<__MF_COND_SYMBOL>],[<#ifdef __MF_COND_SYMBOL | 958 | m4_ifdef([<__MF_COND_SYMBOL>],[<#ifdef __MF_COND_SYMBOL |
959 | pp_define("__MF_COND_SYMBOL"); | 959 | pp_define("__MF_COND_SYMBOL"); |
960 | >])m4_dnl | 960 | >])m4_dnl |
961 | m4_undivert(1) | 961 | m4_undivert(1) |
962 | __MF_INIT_SEQUENCE | 962 | __MF_INIT_SEQUENCE |
963 | m4_popdef([<__MF_INIT_SEQUENCE>])m4_dnl | 963 | m4_popdef([<__MF_INIT_SEQUENCE>])m4_dnl |
964 | m4_ifdef([<__MF_COND_SYMBOL>],[<#endif /[<>]* __MF_COND_SYMBOL */ | 964 | m4_ifdef([<__MF_COND_SYMBOL>],[<#endif /[<>]* __MF_COND_SYMBOL */ |
965 | m4_popdef([<__MF_COND_SYMBOL>])>])m4_dnl | 965 | m4_popdef([<__MF_COND_SYMBOL>])>])m4_dnl |
966 | } | 966 | } |
967 | m4_divert(0)m4_dnl | 967 | m4_divert(0)m4_dnl |
968 | /* -*- buffer-read-only: t -*- vi: set ro: | 968 | /* -*- buffer-read-only: t -*- vi: set ro: |