From: Ronald S. Bultje Date: Mon, 2 May 2011 17:56:41 +0000 (-0400) Subject: build: change LDFLAGS/CFLAGS ordering. X-Git-Tag: 1.0_branch~492 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bbf890fe27c4193752c4f455b01eae62dedab359;p=profile%2Fivi%2Flibvpx.git build: change LDFLAGS/CFLAGS ordering. Always use CFLAGS/LDFLAGS that point to headers and libvpx.a inside our build tree before ones from the environment, which could reference headers or libs outside the build tree. This fixes issue 307. Change-Id: I34d176b8c21098f6da5ea71f0147d3c49283cc45 --- diff --git a/build/make/Makefile b/build/make/Makefile index 64d3c93..a951e99 100755 --- a/build/make/Makefile +++ b/build/make/Makefile @@ -98,11 +98,11 @@ install:: $(BUILD_PFX)%.c.d: %.c $(if $(quiet),@echo " [DEP] $@") $(qexec)mkdir -p $(dir $@) - $(qexec)$(CC) $(CFLAGS) -M $< | $(fmt_deps) > $@ + $(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -M $< | $(fmt_deps) > $@ $(BUILD_PFX)%.c.o: %.c $(if $(quiet),@echo " [CC] $@") - $(qexec)$(CC) $(CFLAGS) -c -o $@ $< + $(qexec)$(CC) $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $< $(BUILD_PFX)%.asm.d: %.asm $(if $(quiet),@echo " [DEP] $@") @@ -188,7 +188,7 @@ define linker_template $(1): $(filter-out -%,$(2)) $(1): $(if $(quiet),@echo " [LD] $$@") - $(qexec)$$(LD) $$(strip $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs)) + $(qexec)$$(LD) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs)) endef # make-3.80 has a bug with expanding large input strings to the eval function, # which was triggered in some cases by the following component of diff --git a/examples.mk b/examples.mk index 89c93db..3e34b56 100644 --- a/examples.mk +++ b/examples.mk @@ -122,8 +122,8 @@ else LIB_PATH := $(call enabled,LIB_PATH) INC_PATH := $(call enabled,INC_PATH) endif -CFLAGS += $(addprefix -I,$(INC_PATH)) -LDFLAGS += $(addprefix -L,$(LIB_PATH)) +INTERNAL_CFLAGS = $(addprefix -I,$(INC_PATH)) +INTERNAL_LDFLAGS += $(addprefix -L,$(LIB_PATH)) # Expand list of selected examples to build (as specified above) @@ -214,7 +214,8 @@ $(1): $($(1:.vcproj=).SRCS) --ver=$$(CONFIG_VS_VERSION)\ --proj-guid=$$($$(@:.vcproj=).GUID)\ $$(if $$(CONFIG_STATIC_MSVCRT),--static-crt) \ - --out=$$@ $$(CFLAGS) $$(LDFLAGS) -l$$(CODEC_LIB) -lwinmm $$^ + --out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \ + $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -l$$(CODEC_LIB) -lwinmm $$^ endef PROJECTS-$(CONFIG_MSVS) += $(ALL_EXAMPLES:.c=.vcproj) INSTALL-BINS-$(CONFIG_MSVS) += $(foreach p,$(VS_PLATFORMS),\