From 9681cdc1b495eb88ed33cacdcd37e2393df6c1c4 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Fri, 22 Sep 2017 18:57:10 +0200 Subject: util/crossgcc: Add bootstrap-only mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit buildgcc -B (--bootstrap-only) builds only a bootstrap compiler. That useful if you want to package the cross compilers: first build the bootstrap compiler, then all required cross compilers in a separate directory (using the bootstrap compiler through an adjusted PATH). Change-Id: I089b51d1b898d4cf530845ba51283997fd229451 Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/21683 Tested-by: build bot (Jenkins) Reviewed-by: Jonathan Neuschäfer Reviewed-by: Paul Menzel Reviewed-by: Stefan Reinauer --- util/crossgcc/buildgcc | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'util') diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 1db55f63d1..01c73ccfab 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -902,12 +902,12 @@ getopt - > /dev/null 2>/dev/null || gcc -o getopt getopt.c getoptbrand="$(getopt -V | sed -e '1!d' -e 's,^\(......\).*,\1,')" if [ "${getoptbrand}" = "getopt" ]; then # Detected GNU getopt that supports long options. - args=$(getopt -l version,help,clean,directory:,bootstrap,platform:,languages:,package:,jobs:,destdir:,savetemps,scripting,ccache,supported:,urls,nocolor -o Vhcd:bp:l:P:j:D:tSys:un -- "$@") + args=$(getopt -l version,help,clean,directory:,bootstrap,bootstrap-only,platform:,languages:,package:,jobs:,destdir:,savetemps,scripting,ccache,supported:,urls,nocolor -o Vhcd:bBp:l:P:j:D:tSys:un -- "$@") getopt_ret=$? eval set -- "$args" else # Detected non-GNU getopt - args=$(getopt Vhcd:bp:l:P:j:D:tSys:un $*) + args=$(getopt Vhcd:bBp:l:P:j:D:tSys:un $*) getopt_ret=$? set -- $args fi @@ -919,22 +919,23 @@ fi while true ; do case "$1" in - -V|--version) shift; myversion; exit 0;; - -h|--help) shift; myhelp; exit 0;; - -c|--clean) shift; clean=1;; - -t|--savetemps) shift; SAVETEMPS=1;; - -d|--directory) shift; TARGETDIR="$1"; shift;; - -b|--bootstrap) shift; BOOTSTRAP=1;; - -p|--platform) shift; TARGETARCH="$1"; shift;; - -l|--languages) shift; LANGUAGES="$1"; shift;; - -D|--destdir) shift; DESTDIR="$1"; shift;; - -j|--jobs) shift; THREADS="$1"; JOBS="-j $1"; shift;; - -P|--package) shift; PACKAGE="$1"; shift;; - -S|--scripting) shift; SKIPPYTHON=0;; - -y|--ccache) shift; USECCACHE=1;; - -s|--supported) shift; PRINTSUPPORTED="$1"; shift;; - -u|--urls) shift; printf "%s\n" "$ALL_ARCHIVES"; exit 0;; - -n|--nocolor) shift; \ + -V|--version) shift; myversion; exit 0;; + -h|--help) shift; myhelp; exit 0;; + -c|--clean) shift; clean=1;; + -t|--savetemps) shift; SAVETEMPS=1;; + -d|--directory) shift; TARGETDIR="$1"; shift;; + -b|--bootstrap) shift; BOOTSTRAP=1;; + -B|--bootstrap-only) shift; BOOTSTRAPONLY=1; BOOTSTRAP=1;; + -p|--platform) shift; TARGETARCH="$1"; shift;; + -l|--languages) shift; LANGUAGES="$1"; shift;; + -D|--destdir) shift; DESTDIR="$1"; shift;; + -j|--jobs) shift; THREADS="$1"; JOBS="-j $1"; shift;; + -P|--package) shift; PACKAGE="$1"; shift;; + -S|--scripting) shift; SKIPPYTHON=0;; + -y|--ccache) shift; USECCACHE=1;; + -s|--supported) shift; PRINTSUPPORTED="$1"; shift;; + -u|--urls) shift; printf "%s\n" "$ALL_ARCHIVES"; exit 0;; + -n|--nocolor) shift; \ unset red RED green GREEN blue BLUE cyan CYAN NC;; --) shift; break;; *) break;; @@ -1215,6 +1216,14 @@ for P in $PACKAGES; do done printf "Unpacked and patched ... ${green}ok${NC}\n" +if [ -n "$BOOTSTRAPONLY" ]; then + printf "Building bootstrap compiler only ... \n" + for pkg in GMP MPFR MPC LIBELF GCC; do + build_for_host $pkg + done + exit 0 +fi + printf "Building packages ... \n" for package in $PACKAGES; do build $package -- cgit v1.2.3