diff options
Diffstat (limited to 'Rules.mak')
-rw-r--r-- | Rules.mak | 18 |
1 files changed, 6 insertions, 12 deletions
@@ -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 |
119 | check_ld=$(shell \ | 119 | check_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 | ||
125 | check_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 | |||
213 | endif | 207 | endif |
214 | ifeq ($(strip $(CONFIG_DEBUG)),y) | 208 | ifeq ($(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 |
218 | else | 212 | else |
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 |
223 | endif | 217 | endif |
224 | ifeq ($(strip $(CONFIG_STATIC)),y) | 218 | ifeq ($(strip $(CONFIG_STATIC)),y) |
225 | LDFLAGS += $(call check_ld,--static,) | 219 | PROG_CFLAGS += $(call check_gcc,-static,) |
226 | #else | ||
227 | # LIBRARIES += -ldl | ||
228 | endif | 220 | endif |
221 | CFLAGS_SHARED += $(call check_gcc,-shared,) | ||
222 | LIB_CFLAGS+=$(CFLAGS_SHARED) | ||
229 | 223 | ||
230 | ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) | 224 | ifeq ($(strip $(CONFIG_BUILD_LIBBUSYBOX)),y) |
231 | CFLAGS_PIC:= $(call check_gcc,-fPIC,) | 225 | CFLAGS_PIC:= $(call check_gcc,-fPIC,) |