From 587b0afbebca5096506c7fc6798b771ace956ad1 Mon Sep 17 00:00:00 2001 From: Marc Fiuczynski Date: Tue, 11 Apr 2006 14:28:15 +0000 Subject: [PATCH] switch to gcc 3.x based compiler on systems using gcc 4.x by default --- scripts/kernel-2.6-planetlab.spec | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/kernel-2.6-planetlab.spec b/scripts/kernel-2.6-planetlab.spec index 8970050ba..8e0f9af37 100644 --- a/scripts/kernel-2.6-planetlab.spec +++ b/scripts/kernel-2.6-planetlab.spec @@ -326,6 +326,25 @@ BuildKernel() { # and now to start the build process + gccversion=$(gcc -v 2>&1 | grep "gcc version" | awk '{print $3'} | awk -F . '{print $1}') + if [ "$gccversion" == "4" ] ; then + echo "Currently not compiling kernel with gcc 4.x" + echo "Trying to find a recent gcc 3.x based compiler" + CC= + gcc3=$(gcc32 -v 2>&1) + [ $? -eq 0 ] && CC=gcc32 + gcc3=$(gcc33 -v 2>&1) + [ $? -eq 0 ] && CC=gcc33 + gcc3=$(gcc34 -v 2>&1) + [ $? -eq 0 ] && CC=gcc34 + if [ -z "$CC" ]; then + echo "Could not find a gcc 3.x based compiler!" + echo "Aborting kernel compilation!" + exit -1 + fi + HOSTCC=${CC} + fi + make -s ARCH=$Arch mrproper cp configs/$Config .config -- 2.43.0