diff options
author | vapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-07-28 22:26:25 +0000 |
---|---|---|
committer | vapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2005-07-28 22:26:25 +0000 |
commit | 2f53a4a1755691e475bd0e112fa8665c66133134 (patch) | |
tree | b79b6b221645310c5e3dada621a113ef2598e21f | |
parent | 3f06b5d8a3dbb45cb760dd2beca33291f281cf30 (diff) | |
download | busybox-w32-2f53a4a1755691e475bd0e112fa8665c66133134.tar.gz busybox-w32-2f53a4a1755691e475bd0e112fa8665c66133134.tar.bz2 busybox-w32-2f53a4a1755691e475bd0e112fa8665c66133134.zip |
further refine check_gcc usage so it is only called the bare min number of times
git-svn-id: svn://busybox.net/trunk/busybox@10949 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | Rules.mak | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -106,8 +106,11 @@ ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) | |||
106 | endif | 106 | endif |
107 | 107 | ||
108 | # A nifty macro to make testing gcc features easier | 108 | # A nifty macro to make testing gcc features easier |
109 | check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ | 109 | check_gcc=$(shell \ |
110 | then echo "$(1)"; else echo "$(2)"; fi) | 110 | if [ "$(1)" != "" ]; then \ |
111 | if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ | ||
112 | then echo "$(1)"; else echo "$(2)"; fi \ | ||
113 | fi) | ||
111 | 114 | ||
112 | # Setup some shortcuts so that silent mode is silent like it should be | 115 | # Setup some shortcuts so that silent mode is silent like it should be |
113 | ifeq ($(subst s,,$(MAKEFLAGS)),$(MAKEFLAGS)) | 116 | ifeq ($(subst s,,$(MAKEFLAGS)),$(MAKEFLAGS)) |
@@ -124,7 +127,7 @@ endif | |||
124 | # for OPTIMIZATION... | 127 | # for OPTIMIZATION... |
125 | 128 | ||
126 | # use '-Os' optimization if available, else use -O2 | 129 | # use '-Os' optimization if available, else use -O2 |
127 | OPTIMIZATION:=${call check_gcc,-Os,-O2} | 130 | OPTIMIZATION:=$(call check_gcc,-Os,-O2) |
128 | 131 | ||
129 | # Some nice architecture specific optimizations | 132 | # Some nice architecture specific optimizations |
130 | ifeq ($(strip $(TARGET_ARCH)),arm) | 133 | ifeq ($(strip $(TARGET_ARCH)),arm) |
@@ -136,7 +139,7 @@ ifeq ($(strip $(TARGET_ARCH)),i386) | |||
136 | OPTIMIZATION+=$(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,\ | 139 | OPTIMIZATION+=$(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,\ |
137 | -malign-functions=0 -malign-jumps=0 -malign-loops=0) | 140 | -malign-functions=0 -malign-jumps=0 -malign-loops=0) |
138 | endif | 141 | endif |
139 | OPTIMIZATIONS=$(OPTIMIZATION) -fomit-frame-pointer | 142 | OPTIMIZATIONS:=$(OPTIMIZATION) -fomit-frame-pointer |
140 | 143 | ||
141 | # | 144 | # |
142 | #-------------------------------------------------------- | 145 | #-------------------------------------------------------- |