From d80e851dc05f978dded84b7ac9fcae7066e3ffe0 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 16 Nov 1999 00:46:00 +0000 Subject: Stuf --- Makefile | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ec02957ac..29a6cb0df 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 -- cgit v1.2.3