]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
improve header inclusion process in a few small ways:
authorKevin P. Fleming <kpfleming@digium.com>
Sat, 27 Sep 2008 15:00:48 +0000 (15:00 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Sat, 27 Sep 2008 15:00:48 +0000 (15:00 +0000)
  - it is no longer necessary to forcibly include asterisk/autoconfig.h; every module already includes asterisk.h as its first header (even before system headers), which serves the same purpose
  - astmm.h is now included by asterisk.h when needed, instead of being forced by the Makefile; this means external modules will build properly against installed headers with MALLOC_DEBUG enabled
  - simplify the usage of some of these headers in the AEL-related stuff in the utils directory

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@144924 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 files changed:
Makefile
Makefile.moddir_rules
include/asterisk.h
main/ast_expr2.c
main/ast_expr2.fl
main/ast_expr2.y
main/ast_expr2f.c
main/stdtime/localtime.c
pbx/ael/ael.flex
pbx/ael/ael.tab.c
pbx/ael/ael.y
pbx/ael/ael_lex.c
pbx/pbx_ael.c
utils/Makefile
utils/ael_main.c

index 545cfbcb2a052fd6b272d7432f64e0283b2ff466..bb4adcb62c3dbf04a20a8d393e60a2b8005e0bed 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -203,8 +203,6 @@ endif
 
 ASTCFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
 
-ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/autoconfig.h
-
 ifeq ($(AST_DEVMODE),yes)
   ASTCFLAGS+=-Werror  -Wunused $(AST_DECLARATION_AFTER_STATEMENT)
 endif
index f73bc83e9346f4333e53b9c6d6ae71fd429de822..eebad80e6e5bbafa36047aebc71a49b74ef02d70 100644 (file)
 # the GNU General Public License
 #
 
-ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
- ifeq ($(findstring astmm.h,$(ASTCFLAGS)),)
-  ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
- endif
-endif
-
 ifeq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
   ASTCFLAGS+=${GC_CFLAGS}
 endif
index 4fcb5f8edd4eeed1a0510aa923ffc0137af3011f..e5202bb58c92835e9cc8ac9ab07de6318edf474b 100644 (file)
 #ifndef _ASTERISK_H
 #define _ASTERISK_H
 
-/* The include of 'autoconfig.h' is not necessary for any modules that
-   are part of the Asterisk source tree, because the top-level Makefile
-   will forcibly include that header in all compilations before all
-   other headers (even system headers). However, leaving this here will
-   help out-of-tree module builders, and doesn't cause any harm for the
-   in-tree modules.
-*/
 #include "asterisk/autoconfig.h"
 
+#if !defined(STANDALONE_AEL) && defined(MALLOC_DEBUG)
+#include "asterisk/astmm.h"
+#endif
+
 #include "asterisk/compat.h"
 
 #include "asterisk/paths.h"
index 4acd56d54c4ab13e64e57af2737e786f45a66308..9133e76ea2185f7b1365d1c254276044940a3709 100644 (file)
 
 #include "asterisk.h"
 
-#ifndef STANDALONE
+#if !defined(STANDALONE_AEL)
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #endif
 
index 68db5042805383f8ba6f5837b01dcf0c27d15ca3..67dd3aa6a9d4dba6fb161e0ccbcf2335df63f796 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "asterisk.h"
 
-#ifndef STANDALONE
+#if !defined(STANDALONE_AEL)
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #endif
 
index e47c2e721a75a6b19d9381bd0dbe1190851e75fb..b2faf374d02b3e637ae9a6101eee9d77a331589c 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "asterisk.h"
 
-#ifndef STANDALONE
+#if !defined(STANDALONE_AEL)
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #endif
 
index 9b8ef15325a266174f2c0218d0235067f82be5c8..f4b7dd0dc7b59e53ebbba1480666b775f2827390 100644 (file)
@@ -504,7 +504,7 @@ static yyconst flex_int16_t yy_chk[127] =
 
 #include "asterisk.h"
 
-#ifndef STANDALONE
+#if !defined(STANDALONE_AEL)
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #endif
 
index 1da0fe012e46cd799c4c2b857a85fe696371179a..75968f7876fa0fbabcadec326d30f70559f6a1bd 100644 (file)
@@ -44,6 +44,8 @@
 
 /*LINTLIBRARY*/
 
+#include "asterisk.h"
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -55,7 +57,6 @@
 
 #include "private.h"
 #include "tzfile.h"
-#include "asterisk.h"
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
index 2bf00695b667a665b78fc79d41f0a9b00cb495a4..6eb305843eada42d6bfc30b60617763f473c5f56 100644 (file)
@@ -60,7 +60,9 @@
 %option bison-locations
 
 %{
+#if !defined(STANDALONE_AEL)
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#endif
 
 #include <sys/types.h>
 #include <sys/stat.h>
index 78986ec09cc7f360defb6b7fc56139a5ef850fb0..df2f4e265c9f434bc9606cae3fa20f8c9568e88a 100644 (file)
 
 #include "asterisk.h"
 
+#if !defined(STANDALONE_AEL)
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
index 3ddcee8f0177b9a4f7eff3c7a3d3a96aa5f06b71..c5668487b79ec53688f208d08695634031072a9c 100644 (file)
@@ -24,7 +24,9 @@
 
 #include "asterisk.h"
 
+#if !defined(STANDALONE_AEL)
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
index 537ee0ea84a5be336d0db886569688e041754073..8729649e1eea4702a580eaafd3e67c90575c1745 100644 (file)
@@ -817,7 +817,9 @@ static yyconst flex_int16_t yy_chk[1073] =
  * bison-locations is probably not needed.
  */
 #line 63 "ael.flex"
+#if !defined(STANDALONE_AEL)
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#endif
 
 #include <sys/types.h>
 #include <sys/stat.h>
index 71282d71b1ca08ce07fd75fa12433667b114b59e..d68c7c547e6c7be34acaad8a2c768f1f9c2ea1ab 100644 (file)
@@ -24,7 +24,9 @@
 
 #include "asterisk.h"
 
+#if !defined(STANDALONE_AEL)
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#endif
 
 #include <sys/types.h>
 #include <stdlib.h>
index 07896260f4e42ef0ca4bf27b1c460290cd4712db..a31172b27b48009c98126bbfff6124293de1b02b 100644 (file)
@@ -83,6 +83,8 @@ strcompat.c: ../main/strcompat.c
 ast_expr2.c: ../main/ast_expr2.c
        @cp $< $@
 
+ast_expr2.o: ASTCFLAGS+=-DSTANDALONE_AEL
+
 ast_expr2f.c: ../main/ast_expr2f.c
        @cp $< $@
 
@@ -93,13 +95,14 @@ check_expr: check_expr.o ast_expr2.o ast_expr2f.o
 aelbison.c: ../pbx/ael/ael.tab.c
        @cp $< $@
 aelbison.o: aelbison.c ../pbx/ael/ael.tab.h ../include/asterisk/ael_structs.h
-aelbison.o: ASTCFLAGS+=-I../pbx
+aelbison.o: ASTCFLAGS+=-I../pbx -DSTANDALONE_AEL
 
 pbx_ael.c: ../pbx/pbx_ael.c
        @cp $< $@
 pbx_ael.o: ASTCFLAGS+=-DSTANDALONE_AEL
 
 ael_main.o: ael_main.c ../include/asterisk/ael_structs.h
+ael_main.o: ASTCFLAGS+=-DSTANDALONE_AEL
 
 aelparse.c: ../pbx/ael/ael_lex.c
        @cp $< $@
index 6c8f3d39055da1bd54f7a9ea76b63f24110ac072..85a2cc835e91b98216bb2c1089af1ed5e6410fb9 100644 (file)
@@ -1,3 +1,5 @@
+#include "asterisk.h"
+
 #include <sys/types.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -78,10 +80,7 @@ char last_exten[18000];
 char ast_config_AST_CONFIG_DIR[PATH_MAX];
 char ast_config_AST_VAR_DIR[PATH_MAX];
 
-void ast_add_profile(void);
 void ast_cli_register_multiple(void);
-void ast_register_file_version(void);
-void ast_unregister_file_version(void);
 int ast_add_extension2(struct ast_context *con,
                                           int replace, const char *extension, int priority, const char *label, const char *callerid,
                                                const char *application, void *data, void (*datad)(void *),
@@ -115,12 +114,6 @@ struct ast_app *pbx_findapp(const char *app)
        return (struct ast_app*)1; /* so as not to trigger an error */
 }
 
-void ast_add_profile(void)
-{
-       if (!no_comp)
-               printf("Executed ast_add_profile();\n");
-}
-
 int ast_loader_register(int (*updater)(void))
 {
        return 1;
@@ -145,20 +138,6 @@ void ast_cli_register_multiple(void)
                printf("Executed ast_cli_register_multiple();\n");
 }
 
-void ast_register_file_version(void)
-{
-       /* if(!no_comp)
-               printf("Executed ast_register_file_version();\n"); */
-       /* I'm erasing this, because I don't think anyone really ever needs to see it anyway */
-}
-
-void ast_unregister_file_version(void)
-{
-       /* if(!no_comp)
-               printf("Executed ast_unregister_file_version();\n"); */
-       /* I'm erasing this, because I don't think anyone really ever needs to see it anyway */
-
-}
 void pbx_substitute_variables_helper(struct ast_channel *c,const char *cp1,char *cp2,int count);
 void pbx_substitute_variables_helper(struct ast_channel *c,const char *cp1,char *cp2,int count)
 {