aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-27 15:00:48 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-27 15:00:48 +0000
commit3be602e6c84bd15d5399be3352435b49e1329500 (patch)
tree8d6a23c06dea5cc67f34f27623fb8dd2514f02c5
parent4af2c0074afcb295979d5d857477db3272b9c99c (diff)
improve header inclusion process in a few small ways:
- 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: http://svn.digium.com/svn/asterisk/branches/1.4@144924 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--Makefile2
-rw-r--r--Makefile.moddir_rules6
-rw-r--r--include/asterisk.h11
-rw-r--r--main/ast_expr2.c2
-rw-r--r--main/ast_expr2.fl2
-rw-r--r--main/ast_expr2.y2
-rw-r--r--main/ast_expr2f.c2
-rw-r--r--main/stdtime/localtime.c3
-rw-r--r--pbx/ael/ael.flex2
-rw-r--r--pbx/ael/ael.tab.c2
-rw-r--r--pbx/ael/ael.y2
-rw-r--r--pbx/ael/ael_lex.c2
-rw-r--r--pbx/pbx_ael.c2
-rw-r--r--utils/Makefile5
-rw-r--r--utils/ael_main.c25
15 files changed, 26 insertions, 44 deletions
diff --git a/Makefile b/Makefile
index 545cfbcb2..bb4adcb62 100644
--- 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
diff --git a/Makefile.moddir_rules b/Makefile.moddir_rules
index f73bc83e9..eebad80e6 100644
--- a/Makefile.moddir_rules
+++ b/Makefile.moddir_rules
@@ -11,12 +11,6 @@
# 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
diff --git a/include/asterisk.h b/include/asterisk.h
index 4fcb5f8ed..e5202bb58 100644
--- a/include/asterisk.h
+++ b/include/asterisk.h
@@ -18,15 +18,12 @@
#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"
diff --git a/main/ast_expr2.c b/main/ast_expr2.c
index 4acd56d54..9133e76ea 100644
--- a/main/ast_expr2.c
+++ b/main/ast_expr2.c
@@ -131,7 +131,7 @@
#include "asterisk.h"
-#ifndef STANDALONE
+#if !defined(STANDALONE_AEL)
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#endif
diff --git a/main/ast_expr2.fl b/main/ast_expr2.fl
index 68db50428..67dd3aa6a 100644
--- a/main/ast_expr2.fl
+++ b/main/ast_expr2.fl
@@ -24,7 +24,7 @@
#include "asterisk.h"
-#ifndef STANDALONE
+#if !defined(STANDALONE_AEL)
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#endif
diff --git a/main/ast_expr2.y b/main/ast_expr2.y
index e47c2e721..b2faf374d 100644
--- a/main/ast_expr2.y
+++ b/main/ast_expr2.y
@@ -14,7 +14,7 @@
#include "asterisk.h"
-#ifndef STANDALONE
+#if !defined(STANDALONE_AEL)
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#endif
diff --git a/main/ast_expr2f.c b/main/ast_expr2f.c
index 9b8ef1532..f4b7dd0dc 100644
--- a/main/ast_expr2f.c
+++ b/main/ast_expr2f.c
@@ -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
diff --git a/main/stdtime/localtime.c b/main/stdtime/localtime.c
index 1da0fe012..75968f787 100644
--- a/main/stdtime/localtime.c
+++ b/main/stdtime/localtime.c
@@ -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$")
diff --git a/pbx/ael/ael.flex b/pbx/ael/ael.flex
index 2bf00695b..6eb305843 100644
--- a/pbx/ael/ael.flex
+++ b/pbx/ael/ael.flex
@@ -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>
diff --git a/pbx/ael/ael.tab.c b/pbx/ael/ael.tab.c
index 78986ec09..df2f4e265 100644
--- a/pbx/ael/ael.tab.c
+++ b/pbx/ael/ael.tab.c
@@ -179,7 +179,9 @@
#include "asterisk.h"
+#if !defined(STANDALONE_AEL)
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#endif
#include <stdio.h>
#include <stdlib.h>
diff --git a/pbx/ael/ael.y b/pbx/ael/ael.y
index 3ddcee8f0..c5668487b 100644
--- a/pbx/ael/ael.y
+++ b/pbx/ael/ael.y
@@ -24,7 +24,9 @@
#include "asterisk.h"
+#if !defined(STANDALONE_AEL)
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#endif
#include <stdio.h>
#include <stdlib.h>
diff --git a/pbx/ael/ael_lex.c b/pbx/ael/ael_lex.c
index 537ee0ea8..8729649e1 100644
--- a/pbx/ael/ael_lex.c
+++ b/pbx/ael/ael_lex.c
@@ -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>
diff --git a/pbx/pbx_ael.c b/pbx/pbx_ael.c
index 71282d71b..d68c7c547 100644
--- a/pbx/pbx_ael.c
+++ b/pbx/pbx_ael.c
@@ -24,7 +24,9 @@
#include "asterisk.h"
+#if !defined(STANDALONE_AEL)
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#endif
#include <sys/types.h>
#include <stdlib.h>
diff --git a/utils/Makefile b/utils/Makefile
index 07896260f..a31172b27 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -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 $< $@
diff --git a/utils/ael_main.c b/utils/ael_main.c
index 6c8f3d390..85a2cc835 100644
--- a/utils/ael_main.c
+++ b/utils/ael_main.c
@@ -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)
{