[coreboot-gerrit] New patch to review for coreboot: d68feb9 buildgcc: move to a package centric user interface

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Tue Jun 9 22:46:56 CEST 2015


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10492

-gerrit

commit d68feb97ccd300c40a41d52014dd2f1cb8bf6fe4
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date:   Tue Jun 9 13:00:35 2015 -0700

    buildgcc: move to a package centric user interface
    
    Instead of building IASL and GDB implicitly when building
    GCC, this patch changes buildgcc to let you explicitly specify
    what you want to build.
    
    This will prevent IASL from building over and over again, when
    all you need is GDB.
    
    The new command line option is -P | --package <package> where
    package is one of the following: GCC, GDB, CLANG, IASL
    If no package is specified, buildgcc will default to GCC.
    
    Change-Id: I8836bed16fc2bc39e0951199143581cc6d71cb4d
    Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
---
 util/crossgcc/buildgcc | 74 ++++++++++++++++++++++++++------------------------
 1 file changed, 39 insertions(+), 35 deletions(-)

diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 2f6f29c..712b898 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -26,9 +26,12 @@ CROSSGCC_DATE="June 4th, 2015"
 CROSSGCC_VERSION="1.29"
 
 # default settings
+PACKAGE=GCC
 TARGETDIR=$(pwd)/xgcc
 TARGETARCH=i386-elf
 DESTDIR=
+SAVETEMPS=0
+SKIPPYTHON=1
 
 # GCC toolchain version numbers
 GMP_VERSION=6.0.0
@@ -81,11 +84,6 @@ CTE_DIR="clang-tools-extra-${CLANG_VERSION}.src"
 
 unset MAKELEVEL MAKEFLAGS
 
-SAVETEMPS=0
-BUILDCLANG=0
-SKIPGDB=1
-SKIPPYTHON=1
-
 red='\033[0;31m'
 RED='\033[1;31m'
 green='\033[0;32m'
@@ -293,16 +291,19 @@ myhelp()
 	printf "    [-t|--savetemps]              don't remove temporary files after build\n"
 	printf "    [-y|--ccache]                 Use ccache when building cross compiler\n"
 	printf "    [-j|--jobs <num>]             run <num> jobs in parallel in make\n"
-	printf "    [-C|--clang]                  build CLANG toolchain"
-	printf "    [-p|--platform <platform>]    target platform to build cross compiler for\n"
-	printf "                                  (defaults to $TARGETARCH) *)\n"
 	printf "    [-d|--directory <target dir>] target directory to install cross compiler to\n"
 	printf "                                  (defaults to $TARGETDIR)\n\n"
 	printf "    [-D|--destdir <dest dir>]     destination directory to install cross compiler to\n"
 	printf "                                  (for RPM builds, default unset)\n"
-	printf "    [-G|--gdb]                    build GNU debugger *)\n"
-	printf "    [-S|--scripting]              build scripting support for GDB *)\n\n"
-	printf " *) option only available when building GCC toolchain (not with CLANG)\n\n"
+	printf "    [-P|--package <package>]      Build a specific package: GCC, CLANG, IASL, GDB\n"
+	printf "                                  (defaults to $PACKAGE)\n"
+	printf "GCC specific options:\n"
+	printf "    [-p|--platform <platform>]    target platform to build cross compiler for\n"
+	printf "                                  (defaults to $TARGETARCH)\n"
+	printf "GDB specific options:\n"
+	printf "    [-p|--platform <platform>]    target platform to build cross compiler for\n"
+	printf "                                  (defaults to $TARGETARCH)\n"
+	printf "    [-S|--scripting]              build scripting support for GDB\n\n"
 }
 
 myversion()
@@ -507,8 +508,7 @@ while true ; do
 		-p|--platform)	shift; TARGETARCH="$1"; shift;;
 		-D|--destdir)	shift; DESTDIR="$1"; shift;;
 		-j|--jobs)	shift; JOBS="-j $1"; shift;;
-		-C|--clang)	shift; BUILDCLANG=1;;
-		-G|--gdb)	shift; SKIPGDB=0;;
+		-P|--package)   shift; PACKAGE="$1"; shift;;
 		-S|--scripting) shift; SKIPPYTHON=0;;
 		-y|--ccache)	shift; USECCACHE=1;;
 		--)		shift; break;;
@@ -532,28 +532,32 @@ esac
 
 # Figure out which packages to build
 
-if [ "$BUILDCLANG" -eq 0 ]; then
-	echo "Target architecture is now $TARGETARCH"
-	NAME="${TARGETARCH} cross"
-	PACKAGES="GMP MPFR MPC LIBELF BINUTILS GCC IASL"
-else
-	NAME=clang
-	PACKAGES="LLVM CFE CRT CTE"
-fi
-
-if [ $SKIPGDB -eq 1 ]; then
-	printf "Will skip GDB ... ${green}ok${NC}\n"
-	if [ $SKIPPYTHON -eq 0 ]; then
-		printf "Python scripting needs GDB ... disabling ... ${green}ok${NC}\n"
-		SKIPPYTHON=1
-	fi
-else
-	PACKAGES="$PACKAGES GDB"
-fi
-
-if [ $SKIPPYTHON -eq 0 ]; then
-	PACKAGES="$PACKAGES EXPAT PYTHON"
-fi
+case "$PACKAGE" in
+	GCC|gcc)
+		echo "Target architecture is now $TARGETARCH"
+		NAME="${TARGETARCH} cross GCC"
+		PACKAGES="GMP MPFR MPC LIBELF BINUTILS GCC IASL"
+		;;
+	GDB|gdb)
+		NAME="${TARGETARCH} cross GDB"
+		PACKAGES="GDB"
+		if [ $SKIPPYTHON -eq 0 ]; then
+			PACKAGES="EXPAT PYTHON $PACKAGES"
+		fi
+		;;
+	CLANG|clang)
+		NAME=clang
+		PACKAGES="LLVM CFE CRT CTE"
+		;;
+	IASL|iasl)
+		NAME="IASL ACPI compiler"
+		PACKAGES=IASL
+		;;
+	*)
+		printf "${red}ERROR: Unsupported package $PACKAGE. (Supported packages are GCC, GDB, CLANG, IASL)${NC}\n\n";
+		exit 1
+		;;
+esac
 
 # This initial cleanup is useful when updating the toolchain script.
 



More information about the coreboot-gerrit mailing list