From: Anton Blanchard <anton@samba.org>

Be like x86 and enable -funit-at-a-time.
Use the check_gcc hook when enabling -mcpu=power4/-mtune=power4.


---

 arch/ppc64/Makefile |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff -puN arch/ppc64/Makefile~ppc64-funit-at-a-time arch/ppc64/Makefile
--- 25/arch/ppc64/Makefile~ppc64-funit-at-a-time	2004-02-21 20:58:20.000000000 -0800
+++ 25-akpm/arch/ppc64/Makefile	2004-02-21 20:58:20.000000000 -0800
@@ -27,15 +27,16 @@ LDFLAGS_vmlinux	:= -Bstatic -e $(KERNELL
 CFLAGS		+= -msoft-float -pipe -Wno-uninitialized -mminimal-toc \
 		   -mtraceback=none
 
-HAS_POWER4	:= $(shell if $(CC) -mcpu=power4 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi;)
-ifeq ($(HAS_POWER4),y)
 ifeq ($(CONFIG_POWER4_ONLY),y)
-CFLAGS		+= -mcpu=power4
+	CFLAGS += $(call check_gcc,-mcpu=power4,)
 else
-CFLAGS		+= -mtune=power4
-endif
+	CFLAGS += $(call check_gcc,-mtune=power4,)
 endif
 
+# Enable unit-at-a-time mode when possible. It shrinks the
+# kernel considerably.
+CFLAGS += $(call check_gcc,-funit-at-a-time,)
+
 head-y := arch/ppc64/kernel/head.o
 
 libs-y				+= arch/ppc64/lib/

_