[asterisk-commits] trunk r37653 - in /trunk: ./ agi/ channels/ utils/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Jul 15 09:40:05 MST 2006


Author: kpfleming
Date: Sat Jul 15 11:40:05 2006
New Revision: 37653

URL: http://svn.digium.com/view/asterisk?rev=37653&view=rev
Log:
use LDFLAGS and LIBS properly, and allow dependencies to provide LDFLAGS if needed (although none do today)

Modified:
    trunk/Makefile
    trunk/Makefile.moddir_rules
    trunk/Makefile.rules
    trunk/agi/Makefile
    trunk/channels/Makefile
    trunk/utils/Makefile

Modified: trunk/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/Makefile?rev=37653&r1=37652&r2=37653&view=diff
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Sat Jul 15 11:40:05 2006
@@ -496,7 +496,7 @@
 	@$(CC) $(DEBUG) $(ASTOBJ) $(ASTLINK) $(OBJS) buildinfo.o $(LIBEDIT) db1-ast/libdb1.a $(LIBS)
 
 muted: muted.o
-muted: LDFLAGS+=$(AUDIO_LIBS)
+muted: LIBS+=$(AUDIO_LIBS)
 
 $(SUBDIRS_CLEAN_DEPEND):
 	@$(MAKE) -C $(@:-clean-depend=) clean-depend

Modified: trunk/Makefile.moddir_rules
URL: http://svn.digium.com/view/asterisk/trunk/Makefile.moddir_rules?rev=37653&r1=37652&r2=37653&view=diff
==============================================================================
--- trunk/Makefile.moddir_rules (original)
+++ trunk/Makefile.moddir_rules Sat Jul 15 11:40:05 2006
@@ -25,12 +25,14 @@
 
 define module_so_o_template
 $(1).so: $(1).o
-$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
 endef
 
 define module_so_oo_template
 $(1).so: $(1).oo
-$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+$(1).so: LIBS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LIB))
+$(1).so: LDFLAGS+=$(foreach dep,$(MENUSELECT_DEPENDS_$(1)),$$(value $(dep)_LDFLAGS))
 endef
 
 $(foreach mod,$(filter-out $(CC_MODS),$(SELECTED_MODS)),$(eval $(call module_o_c_template,$(mod))))

Modified: trunk/Makefile.rules
URL: http://svn.digium.com/view/asterisk/trunk/Makefile.rules?rev=37653&r1=37652&r2=37653&view=diff
==============================================================================
--- trunk/Makefile.rules (original)
+++ trunk/Makefile.rules Sat Jul 15 11:40:05 2006
@@ -40,13 +40,13 @@
 define ast_make_so_o
 $(1): $(2)
 	@echo "   [LD] $$^ -> $$@"
-	@$$(CC) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+	@$$(CC) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
 endef
 
 define ast_make_so_oo
 $(1): $(2)
 	@echo "   [LDXX] $$^ -> $$@"
-	@$$(CXX) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+	@$$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
 endef
 
 define ast_make_a_o
@@ -59,13 +59,13 @@
 define ast_make_final
 $(1): $(2)
 	@echo "   [LD] $$^ -> $$@"
-	@$$(CC) -o $$@ $$^ $$(LDFLAGS)
+	@$$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
 endef
 
 define ast_make_final_host
 $(1): $(2)
 	@echo "   [LD] $$^ -> $$@"
-	@$$(HOST_CC) -o $$@ $$^ $$(CFLAGS) $$(LDFLAGS)
+	@$$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
 endef
 
 else
@@ -92,12 +92,12 @@
 
 define ast_make_so_o
 $(1): $(2)
-	$$(CC) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+	$$(CC) -o $$@ $$(LDFAGS) $$(SOLINK) $$^ $$(LIBS)
 endef
 
 define ast_make_so_oo
 $(1): $(2)
-	$$(CXX) -o $$@ $$(SOLINK) $$^ $$(LDFLAGS)
+	$$(CXX) -o $$@ $$(LDFLAGS) $$(SOLINK) $$^ $$(LIBS)
 endef
 
 define ast_make_a_o
@@ -108,12 +108,12 @@
 
 define ast_make_final
 $(1): $(2)
-	$$(CC) -o $$@ $$^ $$(LDFLAGS)
+	$$(CC) -o $$@ $$(LDFLAGS) $$^ $$(LIBS)
 endef
 
 define ast_make_final_host
 $(1): $(2)
-	$$(HOST_CC) -o $$@ $$^ $$(CFLAGS) $$(LDFLAGS)
+	$$(HOST_CC) -o $$@ $$(CFLAGS) $$(LDFLAGS) $$^ $$(LIBS)
 endef
 
 endif

Modified: trunk/agi/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/agi/Makefile?rev=37653&r1=37652&r2=37653&view=diff
==============================================================================
--- trunk/agi/Makefile (original)
+++ trunk/agi/Makefile Sat Jul 15 11:40:05 2006
@@ -16,7 +16,7 @@
 AGIS=agi-test.agi eagi-test eagi-sphinx-test jukebox.agi
 
 ifeq ($(OSARCH),SunOS)
-  LDFLAGS+=-lsocket -lnsl ../strcompat.o
+  LIBS+=-lsocket -lnsl ../strcompat.o
 endif
 
 include $(ASTTOPDIR)/Makefile.rules

Modified: trunk/channels/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/channels/Makefile?rev=37653&r1=37652&r2=37653&view=diff
==============================================================================
--- trunk/channels/Makefile (original)
+++ trunk/channels/Makefile Sat Jul 15 11:40:05 2006
@@ -68,7 +68,7 @@
 endif
 
 $(eval $(call ast_make_final_host,gentone,gentone.c))
-gentone: LDFLAGS+=-lm
+gentone: LIBS+=-lm
 
 busy.h: gentone
 	./gentone busy 480 620
@@ -98,4 +98,4 @@
 misdn_config.o: CFLAGS+=-Imisdn -DCHAN_MISDN_VERSION=\"0.3.0\"
 
 chan_misdn.so: chan_misdn.o misdn_config.o misdn/chan_misdn_lib.a
-chan_misdn.so: LDFLAGS+=-lisdnnet -lmISDN
+chan_misdn.so: LIBS+=-lisdnnet -lmISDN

Modified: trunk/utils/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/utils/Makefile?rev=37653&r1=37652&r2=37653&view=diff
==============================================================================
--- trunk/utils/Makefile (original)
+++ trunk/utils/Makefile Sat Jul 15 11:40:05 2006
@@ -16,7 +16,7 @@
 UTILS:=astman smsq stereorize streamplayer aelparse
 
 ifeq (${OSARCH},SunOS)
-  LDFLAGS+=../strcompat.o -lsocket -lnsl
+  LIBS+=../strcompat.o -lsocket -lnsl
 endif
 
 ifeq ($(POPT_LIB),)
@@ -51,11 +51,11 @@
 clean: clean-depend
 	rm -f *.o $(UTILS) check_expr
 
-astman: astman.o ../md5.o
-astman: LDFLAGS+=-lnewt
+$(eval $(call ast_make_final,astman,astman.o ../md5.o))
+astman: LIBS+=-lnewt
 
-stereorize: stereorize.o frame.o
-stereorize: LDFLAGS+=-lm
+$(eval $(call ast_make_final,stereorize,stereorize.o frame.o))
+stereorize: LIBS+=-lm
 
 ../ast_expr2.c:
 	@echo "   [BISON] ../ast_expr2.y -> $@"
@@ -92,7 +92,7 @@
 	./testexpr2s expr2.testinput
 
 smsq: smsq.o
-smsq: LDFLAGS+=-lpopt
+smsq: LIBS+=-lpopt
 
 streamplayer: streamplayer.o
 
@@ -104,4 +104,3 @@
 
 .depend:
 	../build_tools/mkdep $(CFLAGS) `ls *.c`
-



More information about the asterisk-commits mailing list