summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEric Andersen1999-11-16 00:46:00 +0000
committerEric Andersen1999-11-16 00:46:00 +0000
commitd80e851dc05f978dded84b7ac9fcae7066e3ffe0 (patch)
tree9f32d236ce80a7a692f74fe1012df3bed6b19418 /Makefile
parenta9c95ea6551eb3d894fcc56822c8aa394972b699 (diff)
downloadbusybox-d80e851dc05f978dded84b7ac9fcae7066e3ffe0.zip
busybox-d80e851dc05f978dded84b7ac9fcae7066e3ffe0.tar.gz
Stuf
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 25 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index ec02957..29a6cb0 100644
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,30 @@ DOSTATIC=false
#This will choke on a non-debian system
ARCH=`uname -m | sed -e 's/i.86/i386/' | sed -e 's/sparc.*/sparc/'`
+GCCMAJVERSION=`$(CC) --version | sed -n "s/^\([0-9]\)\.\([0-9].*\)[\.].*/\1/p"`
+GCCMINVERSION=`$(CC) --version | sed -n "s/^\([0-9]\)\.\([0-9].*\)[\.].*/\2/p"`
+
+GCCSUPPORTSOPTSIZE=$(shell \
+if ( test $(GCCMAJVERSION) -eq 2 ) ; then \
+ if ( test $(GCCMINVERSION) -ge 95 ) ; then \
+ echo "true"; \
+ else \
+ echo "false"; \
+ fi; \
+else \
+ if ( test $(GCCMAJVERSION) -gt 2 ) ; then \
+ echo "true"; \
+ else \
+ echo "false"; \
+ fi; \
+fi; )
+
+
+ifeq ($(GCCSUPPORTSOPTSIZE), true)
+ OPTIMIZATION=-Os
+else
+ OPTIMIZATION=-O2
+endif
# -D_GNU_SOURCE is needed because environ is used in init.c
ifeq ($(DODEBUG),true)
@@ -38,7 +62,7 @@ ifeq ($(DODEBUG),true)
STRIP=
LDFLAGS=
else
- CFLAGS+=-Wall -Os -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
+ CFLAGS+=-Wall $(OPTIMIZATION) -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
LDFLAGS= -s
STRIP= strip --remove-section=.note --remove-section=.comment $(PROG)
#Only staticly link when _not_ debugging