summaryrefslogtreecommitdiff
path: root/Rules.mak
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2006-01-31 11:29:22 +0000
committerBernhard Reutner-Fischer2006-01-31 11:29:22 +0000
commit81b94960a2bc09e18e5c491b1afeca08ef681b0a (patch)
tree9d838ae55fb024aad93c50ea3e6d541cbe993eeb /Rules.mak
parent39e75106640e17d824c6da00b20ad6d76ede91c5 (diff)
downloadbusybox-81b94960a2bc09e18e5c491b1afeca08ef681b0a.zip
busybox-81b94960a2bc09e18e5c491b1afeca08ef681b0a.tar.gz
- pass -static via CC rather than LD
Diffstat (limited to 'Rules.mak')
-rw-r--r--Rules.mak18
1 files changed, 6 insertions, 12 deletions
diff --git a/Rules.mak b/Rules.mak
index d1995de..4ad4dc4 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -118,13 +118,7 @@ check_gcc=$(shell \
# A not very robust macro to check for available ld flags
check_ld=$(shell \
if [ "x$(1)" != "x" ]; then \
- $(LD) --help | grep -q \\$(1) && echo "-Wl,$(1)$(2)" ; \
- fi)
-
-# A not very robust macro to check for available as flags
-check_as=$(shell \
- if [ "x$(1)" != "x" ]; then \
- $(AS) --help | grep -q "\\$(1)" && echo "-Wa,$(1)$(2)" ; \
+ $(LD) --help | grep -q "\$(1)" && echo "-Wl,$(1)" ; \
fi)
@@ -213,19 +207,19 @@ else
endif
ifeq ($(strip $(CONFIG_DEBUG)),y)
CFLAGS +=$(WARNINGS) -g -D_GNU_SOURCE
- LDFLAGS += $(call check_ld,-warn-common,)
+ LDFLAGS += $(call check_ld,--warn-common,)
STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
else
CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
- LDFLAGS += $(call check_ld,-warn-common,)
+ LDFLAGS += $(call check_ld,--warn-common,)
LDFLAGS += $(call check_ld,--sort-common,)
STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment
endif
ifeq ($(strip $(CONFIG_STATIC)),y)
- LDFLAGS += $(call check_ld,--static,)
-#else
-# LIBRARIES += -ldl
+ PROG_CFLAGS += $(call check_gcc,-static,)
endif
+CFLAGS_SHARED += $(call check_gcc,-shared,)
+LIB_CFLAGS+=$(CFLAGS_SHARED)
ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
CFLAGS_PIC:= $(call check_gcc,-fPIC,)