[asterisk-commits] kpfleming: branch 1.4 r44008 - in /branches/1.4: ./ channels/ codecs/ codecs/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Sep 29 11:25:50 MST 2006


Author: kpfleming
Date: Fri Sep 29 13:25:49 2006
New Revision: 44008

URL: http://svn.digium.com/view/asterisk?rev=44008&view=rev
Log:
don't abuse CFLAGS and LDFLAGS for build of Asterisk components, because they are also then used for non-Asterisk components (like menuselect); use our own variables instead

Modified:
    branches/1.4/Makefile
    branches/1.4/Makefile.moddir_rules
    branches/1.4/Makefile.rules
    branches/1.4/channels/Makefile
    branches/1.4/codecs/Makefile
    branches/1.4/codecs/gsm/Makefile
    branches/1.4/main/Makefile
    branches/1.4/main/db1-ast/Makefile
    branches/1.4/pbx/Makefile
    branches/1.4/utils/Makefile

Modified: branches/1.4/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.4/Makefile?rev=44008&r1=44007&r2=44008&view=diff
==============================================================================
--- branches/1.4/Makefile (original)
+++ branches/1.4/Makefile Fri Sep 29 13:25:49 2006
@@ -13,14 +13,43 @@
 
 # All Makefiles use the following variables:
 #
-# LDFLAGS - linker flags (not libraries), used for all links
+# ASTCFLAGS - compiler options
+# ASTLDFLAGS - linker flags (not libraries)
 # LIBS - additional libraries, at top-level for all links,
 #      on a single object just for that object
 # SOLINK - linker flags used only for creating shared objects (.so files),
 #      used for all .so links
 #
-
-.EXPORT_ALL_VARIABLES:
+# Default values fo ASTCFLAGS and ASTLDFLAGS can be specified in the
+# environment when running make, as follows:
+#
+# $ ASTCFLAGS="-Werror" make
+
+export ASTTOPDIR
+export ASTERISKVERSION
+export ASTERISKVERSIONNUM
+export INSTALL_PATH
+export ASTETCDIR
+export ASTVARRUNDIR
+export MODULES_DIR
+export ASTSPOOLDIR
+export ASTVARLIBDIR
+export ASTDATADIR
+export ASTLOGDIR
+export AGI_DIR
+export ASTCONFPATH
+export NOISY_BUILD
+export MENUSELECT_CFLAGS
+export CC
+export CXX
+export AR
+export RANLIB
+export HOST_CC
+export STATIC_BUILD
+export INSTALL
+export DESTDIR
+export PROC
+export SOLINK
 
 # even though we could use '-include makeopts' here, use a wildcard
 # lookup anyway, so that make won't try to build makeopts if it doesn't
@@ -92,8 +121,6 @@
 # Determine by a grep 'ScriptAlias' of your Apache httpd.conf file
 HTTP_CGIDIR=/var/www/cgi-bin
 
-ASTCFLAGS=
-
 # Uncomment this to use the older DSP routines
 #ASTCFLAGS+=-DOLD_DSP_ROUTINES
 
@@ -275,10 +302,10 @@
 main: $(filter-out main,$(MOD_SUBDIRS))
 
 $(MOD_SUBDIRS):
-	@CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all
+	@ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all
 
 $(OTHER_SUBDIRS):
-	@CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all
+	@ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(MAKE) --no-print-directory -C $@ SUBDIR=$@ all
 
 defaults.h: makeopts
 	@build_tools/make_defaults_h > $@.tmp
@@ -588,10 +615,10 @@
 	fi
 
 $(MOD_SUBDIRS_DEPEND):
-	@CFLAGS="$(MOD_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend
+	@ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend
 
 $(OTHER_SUBDIRS_DEPEND):
-	@CFLAGS="$(OTHER_SUBDIR_CFLAGS)$(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend
+	@ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" $(MAKE) --no-print-directory -C $(@:-depend=) depend
 
 depend: include/asterisk/version.h include/asterisk/buildopts.h defaults.h $(SUBDIRS_DEPEND)
 
@@ -646,7 +673,7 @@
 	- at menuselect/menuselect $(GLOBAL_MAKEOPTS) $(USER_MAKEOPTS) menuselect.makeopts && (echo "menuselect changes saved!"; rm -f channels/h323/Makefile.ast main/asterisk) || echo "menuselect changes NOT saved!"
 
 menuselect/menuselect: makeopts menuselect/menuselect.c menuselect/menuselect_curses.c menuselect/menuselect_stub.c menuselect/menuselect.h menuselect/linkedlists.h makeopts
-	@unset CC LD AR RANLIB CFLAGS LDFLAGS && $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
+	@unset CC LD AR RANLIB && $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
 
 menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml sounds/sounds.xml build_tools/embed_modules.xml
 	@echo "Generating input for menuselect ..."

Modified: branches/1.4/Makefile.moddir_rules
URL: http://svn.digium.com/view/asterisk/branches/1.4/Makefile.moddir_rules?rev=44008&r1=44007&r2=44008&view=diff
==============================================================================
--- branches/1.4/Makefile.moddir_rules (original)
+++ branches/1.4/Makefile.moddir_rules Fri Sep 29 13:25:49 2006
@@ -12,11 +12,11 @@
 #
 
 ifneq ($(findstring MALLOC_DEBUG,$(MENUSELECT_CFLAGS)),)
-  CFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
+  ASTCFLAGS+=-include $(ASTTOPDIR)/include/asterisk/astmm.h
 endif
 
 ifeq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
-  CFLAGS+=${GC_CFLAGS}
+  ASTCFLAGS+=${GC_CFLAGS}
 endif
 
 ifneq ($(findstring STATIC_BUILD,$(MENUSELECT_CFLAGS)),)
@@ -29,14 +29,14 @@
 
 define module_o_template
 $(2): $(3)
-$(2): CFLAGS+=-DAST_MODULE=\"$(1)\" $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
+$(2): ASTCFLAGS+=-DAST_MODULE=\"$(1)\" $$(MENUSELECT_OPTS_$(1):%=-D%) $(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_INCLUDE))
 endef
 
 define module_so_template
 $(1)=$(1).so
-$(1).so: CFLAGS+=-fPIC
+$(1).so: ASTCFLAGS+=-fPIC
 $(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
-$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
+$(1).so: ASTLDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
 $(1).so: $(2)
 endef
 
@@ -102,4 +102,4 @@
 depend: .depend
 
 .depend:
-	../build_tools/mkdep $(CFLAGS) `ls *.c *.cc 2> /dev/null`
+	../build_tools/mkdep $(ASTCFLAGS) `ls *.c *.cc 2> /dev/null`

Modified: branches/1.4/Makefile.rules
URL: http://svn.digium.com/view/asterisk/branches/1.4/Makefile.rules?rev=44008&r1=44007&r2=44008&view=diff
==============================================================================
--- branches/1.4/Makefile.rules (original)
+++ branches/1.4/Makefile.rules Fri Sep 29 13:25:49 2006
@@ -33,19 +33,19 @@
 #K6OPT=-DK6OPT
 
 OPTIMIZE?=-O6
-CFLAGS+=$(OPTIMIZE)
+ASTCFLAGS+=$(OPTIMIZE)
 endif
 
 define ast_make_o_c
 $(1): $(2)
 	$(ECHO_PREFIX) echo "   [CC] $$< -> $$@"
-	$(CMD_PREFIX) $$(CC) -o $$@ -c $$< $$(CFLAGS)
+	$(CMD_PREFIX) $$(CC) -o $$@ -c $$< $$(ASTCFLAGS)
 endef
 
 define ast_make_oo_cc
 $(1): $(2)
 	$(ECHO_PREFIX) echo "   [CXX] $$< -> $$@"
-	$(CMD_PREFIX) $$(CXX) -o $$@ -c $$< $$(CFLAGS)
+	$(CMD_PREFIX) $$(CXX) -o $$@ -c $$< $$(ASTCFLAGS)
 endef
 
 define ast_make_c_y
@@ -63,13 +63,13 @@
 define ast_make_so_o
 $(1): $(2)
 	$(ECHO_PREFIX) echo "   [LD] $$^ -> $$@"
-	$(CMD_PREFIX) $$(CC) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
+	$(CMD_PREFIX) $$(CC) $$(STATIC_BUILD) -o $$@ $$(ASTLDFLAGS) $$(SOLINK) $$^ $$(LIBS)
 endef
 
 define ast_make_so_oo
 $(1): $(2)
 	$(ECHO_PREFIX) echo "   [LDXX] $$^ -> $$@"
-	$(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
+	$(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(ASTLDFLAGS) $$(SOLINK) $$^ $$(LIBS)
 endef
 
 define ast_make_a_o
@@ -82,7 +82,7 @@
 define ast_make_final
 $(1): $(2)
 	$(ECHO_PREFIX) echo "   [LD] $$^ -> $$@"
-	$(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
+	$(CMD_PREFIX) $$(CXX) $$(STATIC_BUILD) -o $$@ $$(ASTLDFLAGS) $$^ $$(LIBS)
 endef
 
 define ast_make_final_host

Modified: branches/1.4/channels/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/Makefile?rev=44008&r1=44007&r2=44008&view=diff
==============================================================================
--- branches/1.4/channels/Makefile (original)
+++ branches/1.4/channels/Makefile Fri Sep 29 13:25:49 2006
@@ -65,7 +65,7 @@
 
 ifneq ($(wildcard h323/Makefile.ast),)
   include h323/Makefile.ast
-H323LDFLAGS += -Wl,--version-script=h323/noexport.map
+H323LDFLAGS+=-Wl,--version-script=h323/noexport.map
 clean::
 	$(MAKE) -C h323 clean
 else
@@ -105,8 +105,8 @@
 	$(CMD_PREFIX) $(CXX) $(SOLINK) -o $@ $< h323/libchanh323.a $(CHANH323LIB) -L$(PWLIBDIR)/lib $(PTLIB) -L$(OPENH323DIR)/lib $(H323LIB) -L/usr/lib -lcrypto -lssl -lexpat
 endif
 
-chan_misdn.o: CFLAGS+=-Imisdn 
+chan_misdn.o: ASTCFLAGS+=-Imisdn 
 
-misdn_config.o: CFLAGS+=-Imisdn 
+misdn_config.o: ASTCFLAGS+=-Imisdn 
 
 $(chan_misdn): chan_misdn.o misdn_config.o misdn/isdn_lib.o misdn/isdn_msg_parser.o

Modified: branches/1.4/codecs/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.4/codecs/Makefile?rev=44008&r1=44007&r2=44008&view=diff
==============================================================================
--- branches/1.4/codecs/Makefile (original)
+++ branches/1.4/codecs/Makefile Fri Sep 29 13:25:49 2006
@@ -42,14 +42,14 @@
 
 gsm/lib/libgsm.a:
 	@mkdir -p gsm/lib
-	@CFLAGS="$(OTHER_SUBDIR_CFLAGS) -I." $(MAKE) -C gsm lib/libgsm.a
+	@$(MAKE) -C gsm lib/libgsm.a
 
 $(LIBLPC10):
-	@CFLAGS="$(OTHER_SUBDIR_CFLAGS)" $(MAKE) -C lpc10 all
+	@$(MAKE) -C lpc10 all
 
 $(codec_lpc10): $(LIBLPC10)
 
 $(LIBILBC):
-	@CFLAGS="$(OTHER_SUBDIR_CFLAGS)" $(MAKE) -C ilbc all
+	@$(MAKE) -C ilbc all
 
 $(codec_ilbc): $(LIBILBC)

Modified: branches/1.4/codecs/gsm/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.4/codecs/gsm/Makefile?rev=44008&r1=44007&r2=44008&view=diff
==============================================================================
--- branches/1.4/codecs/gsm/Makefile (original)
+++ branches/1.4/codecs/gsm/Makefile Fri Sep 29 13:25:49 2006
@@ -72,7 +72,6 @@
 # CCFLAGS 	= -c -O
 
 CCFLAGS 	+= -c -DNeedFunctionPrototypes=1 -funroll-loops $(OPTIMIZE)
-CCFLAGS   += -fPIC
 
 # LD		= gcc
 # LDFLAGS 	=
@@ -155,7 +154,7 @@
 DEBUG	= -DNDEBUG
 ######### Remove -DNDEBUG to enable assertions.
 
-CFLAGS += $(PG) $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) \
+ASTCFLAGS += $(PG) $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) \
 	$(LTP_CUT) $(WAV49) $(K6OPT) $(CCINC) -I$(INC)
 ######### It's $(CC) $(CFLAGS)
 
@@ -319,10 +318,6 @@
 
 # Default rules
 
-.c.o:
-		$(CC) $(CFLAGS:-Werror=) $?
-		@-mv `$(BASENAME) $@` $@ > /dev/null 2>&1
-
 include $(ASTTOPDIR)/Makefile.rules
 
 # Target rules

Modified: branches/1.4/main/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/Makefile?rev=44008&r1=44007&r2=44008&view=diff
==============================================================================
--- branches/1.4/main/Makefile (original)
+++ branches/1.4/main/Makefile Fri Sep 29 13:25:49 2006
@@ -90,11 +90,11 @@
 endif
 
 editline/libedit.a:
-	cd editline && unset CFLAGS AST_LIBS && test -f config.h || CFLAGS="$(OPTIMIZE)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)
+	cd editline && test -f config.h || CFLAGS="$(OPTIMIZE)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)
 	$(MAKE) -C editline libedit.a
 
 db1-ast/libdb1.a:
-	CFLAGS="$(ASTCFLAGS)" $(MAKE) -C db1-ast libdb1.a
+	CFLAGS="$(ASTCFLAGS)" LDFLAGS="$(ASTLDFLAGS)" $(MAKE) -C db1-ast libdb1.a
 
 ast_expr2.c ast_expr2.h:
 	bison -o $@ -d --name-prefix=ast_yy ast_expr2.y
@@ -108,7 +108,7 @@
 	$(CC) -g -o testexpr2 ast_expr2f.o ast_expr2.o
 	rm ast_expr2.o ast_expr2f.o 
 
-channel.o: CFLAGS+=$(ZAPTEL_INCLUDE)
+channel.o: ASTCFLAGS+=$(ZAPTEL_INCLUDE)
 
 AST_EMBED_LDSCRIPTS:=$(sort $(EMBED_LDSCRIPTS))
 AST_EMBED_LDFLAGS:=$(foreach dep,$(EMBED_LDFLAGS),$(value $(dep)))
@@ -130,7 +130,7 @@
 	@rm -f $(ASTTOPDIR)/include/asterisk/build.h.tmp
 	@$(CC) -c -o buildinfo.o $(CFLAGS) buildinfo.c
 	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
-	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(LDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS)
+	$(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS)
 	@$(ASTTOPDIR)/build_tools/strip_nonapi $@
 
 clean::

Modified: branches/1.4/main/db1-ast/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/db1-ast/Makefile?rev=44008&r1=44007&r2=44008&view=diff
==============================================================================
--- branches/1.4/main/db1-ast/Makefile (original)
+++ branches/1.4/main/db1-ast/Makefile Fri Sep 29 13:25:49 2006
@@ -10,7 +10,7 @@
 #Added support for UltraSparc - Belgarath
 ifeq ($(ARCH),sparc64)
 PROC=ultrasparc
-CFLAGS += -mtune=$(PROC) -pipe -fomit-frame-pointer -mcpu=v8
+ASTCFLAGS += -mtune=$(PROC) -pipe -fomit-frame-pointer -mcpu=v8
 endif
 
 ifeq ($(OSARCH),Darwin)
@@ -50,11 +50,11 @@
 clean:
 	rm -f $(LIBDB) $(LIBDBSO) $(OBJS) $(SHOBJS)
 
-CFLAGS+=-Wall -D__DBINTERFACE_PRIVATE -I. -I.. -Iinclude -Ihash -Ibtree -Irecno
+ASTCFLAGS+=-Wall -D__DBINTERFACE_PRIVATE -I. -I.. -Iinclude -Ihash -Ibtree -Irecno
 
 OSTYPE=$(shell uname -s)
 ifeq ($(OSTYPE),SunOS)
-CFLAGS+=-I../../include -I../../include/solaris-compat -DSOLARIS
+ASTCFLAGS+=-I../../include -I../../include/solaris-compat -DSOLARIS
 endif
 
 db_dump185.o: db_dump185.c

Modified: branches/1.4/pbx/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/Makefile?rev=44008&r1=44007&r2=44008&view=diff
==============================================================================
--- branches/1.4/pbx/Makefile (original)
+++ branches/1.4/pbx/Makefile Fri Sep 29 13:25:49 2006
@@ -29,10 +29,10 @@
 	rm -f ael/*.o
 
 $(eval $(call ast_make_o_c,ael/aelflex.o,ael/ael_lex.c ../include/asterisk/ael_structs.h ael/ael.tab.h))
-ael/aelflex.o: CFLAGS+=-I.
+ael/aelflex.o: ASTCFLAGS+=-I.
 
 $(eval $(call ast_make_o_c,ael/aelbison.o,ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h))
-ael/aelbison.o: CFLAGS+=-I.
+ael/aelbison.o: ASTCFLAGS+=-I.
 
 $(pbx_ael): ael/aelbison.o ael/aelflex.o
 
@@ -43,6 +43,6 @@
 	(cd ael; bison -v -d ael.y)
 
 dundi-parser.o: dundi-parser.h
-dundi-parser.o: CFLAGS+=-I.
+dundi-parser.o: ASTCFLAGS+=-I.
 
 $(pbx_dundi): dundi-parser.o

Modified: branches/1.4/utils/Makefile
URL: http://svn.digium.com/view/asterisk/branches/1.4/utils/Makefile?rev=44008&r1=44007&r2=44008&view=diff
==============================================================================
--- branches/1.4/utils/Makefile (original)
+++ branches/1.4/utils/Makefile Fri Sep 29 13:25:49 2006
@@ -71,18 +71,18 @@
 $(eval $(call ast_make_o_c,ast_expr2.o,../main/ast_expr2.c))
 
 $(eval $(call ast_make_o_c,ast_expr2f.o,../main/ast_expr2f.c))
-ast_expr2f.o: CFLAGS+=-DSTANDALONE_AEL
+ast_expr2f.o: ASTCFLAGS+=-DSTANDALONE_AEL
 
 $(eval $(call ast_make_final,check_expr,check_expr.c ast_expr2.o ast_expr2f.o))
 
 $(eval $(call ast_make_o_c,aelflex.o,../pbx/ael/ael_lex.c ../include/asterisk/ael_structs.h ../pbx/ael/ael.tab.h))
-aelflex.o: CFLAGS+=-I../pbx -DSTANDALONE_AEL
+aelflex.o: ASTCFLAGS+=-I../pbx -DSTANDALONE_AEL
 
 $(eval $(call ast_make_o_c,aelbison.o,../pbx/ael/ael.tab.c ../pbx/ael/ael.tab.h ../include/asterisk/ael_structs.h))
-aelbison.o: CFLAGS+=-I../pbx
+aelbison.o: ASTCFLAGS+=-I../pbx
 
 $(eval $(call ast_make_o_c,pbx_ael.o,../pbx/pbx_ael.c))
-pbx_ael.o: CFLAGS+=-DSTANDALONE_AEL
+pbx_ael.o: ASTCFLAGS+=-DSTANDALONE_AEL
 
 $(eval $(call ast_make_final,aelparse,aelflex.o aelbison.o pbx_ael.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o))
 
@@ -110,4 +110,4 @@
 depend: .depend
 
 .depend:
-	../build_tools/mkdep $(CFLAGS) `ls *.c`
+	../build_tools/mkdep $(ASTCFLAGS) `ls *.c`



More information about the asterisk-commits mailing list