aboutsummaryrefslogtreecommitdiff
path: root/Rules.mak
diff options
context:
space:
mode:
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 d1995de81..4ad4dc451 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -118,13 +118,7 @@ check_gcc=$(shell \
118# A not very robust macro to check for available ld flags 118# A not very robust macro to check for available ld flags
119check_ld=$(shell \ 119check_ld=$(shell \
120 if [ "x$(1)" != "x" ]; then \ 120 if [ "x$(1)" != "x" ]; then \
121 $(LD) --help | grep -q \\$(1) && echo "-Wl,$(1)$(2)" ; \ 121 $(LD) --help | grep -q "\$(1)" && echo "-Wl,$(1)" ; \
122 fi)
123
124# A not very robust macro to check for available as flags
125check_as=$(shell \
126 if [ "x$(1)" != "x" ]; then \
127 $(AS) --help | grep -q "\\$(1)" && echo "-Wa,$(1)$(2)" ; \
128 fi) 122 fi)
129 123
130 124
@@ -213,19 +207,19 @@ else
213endif 207endif
214ifeq ($(strip $(CONFIG_DEBUG)),y) 208ifeq ($(strip $(CONFIG_DEBUG)),y)
215 CFLAGS +=$(WARNINGS) -g -D_GNU_SOURCE 209 CFLAGS +=$(WARNINGS) -g -D_GNU_SOURCE
216 LDFLAGS += $(call check_ld,-warn-common,) 210 LDFLAGS += $(call check_ld,--warn-common,)
217 STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging 211 STRIPCMD:=/bin/true -Not_stripping_since_we_are_debugging
218else 212else
219 CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG 213 CFLAGS+=$(WARNINGS) $(OPTIMIZATIONS) -D_GNU_SOURCE -DNDEBUG
220 LDFLAGS += $(call check_ld,-warn-common,) 214 LDFLAGS += $(call check_ld,--warn-common,)
221 LDFLAGS += $(call check_ld,--sort-common,) 215 LDFLAGS += $(call check_ld,--sort-common,)
222 STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment 216 STRIPCMD:=$(STRIP) -s --remove-section=.note --remove-section=.comment
223endif 217endif
224ifeq ($(strip $(CONFIG_STATIC)),y) 218ifeq ($(strip $(CONFIG_STATIC)),y)
225 LDFLAGS += $(call check_ld,--static,) 219 PROG_CFLAGS += $(call check_gcc,-static,)
226#else
227# LIBRARIES += -ldl
228endif 220endif
221CFLAGS_SHARED += $(call check_gcc,-shared,)
222LIB_CFLAGS+=$(CFLAGS_SHARED)
229 223
230ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) 224ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y)
231 CFLAGS_PIC:= $(call check_gcc,-fPIC,) 225 CFLAGS_PIC:= $(call check_gcc,-fPIC,)