aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-01-15 03:02:06 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2010-01-15 18:54:55 +0100
commit3ef12b9df72efd53156ba362e4ccafc2e9fbb6d6 (patch)
tree2f3b743839b6189863ea492b495a44afa64a7adf
parent1391c319354b09cb2979cccb447355f61bf2e62c (diff)
downloadcpufrequtils-3ef12b9df72efd53156ba362e4ccafc2e9fbb6d6.tar.gz
use existing cc-supports func to detect -Os
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r--Makefile7
1 files changed, 3 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index ed7a9df..69ce0ef 100644
--- a/Makefile
+++ b/Makefile
@@ -102,13 +102,12 @@ PWD = $(shell pwd)
export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS
-# use '-Os' optimization if available, else use -O2
-OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
- then echo "-Os"; else echo "-O2" ; fi}
-
# check if compiler option is supported
cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;}
+# use '-Os' optimization if available, else use -O2
+OPTIMIZATION := $(call cc-supports,-Os,-O2)
+
WARNINGS := -Wall -Wchar-subscripts -Wpointer-arith -Wsign-compare
WARNINGS += $(call cc-supports,-Wno-pointer-sign)
WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)