crossgcc: Add option to build gcc for specific languages
Add an option `--languages` which takes a list of target languages to buildgcc. That list gets passed through to the configure step for building gcc. Also alter the Makefile to pass $(BUILD_LANGUAGES) to that option, if this variable is set. Change-Id: I6a74ab2c75871ea8d03a499cca33d88938b59c8d Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/11589 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
@@ -19,7 +19,8 @@ build_tools_without_gdb: build_gcc build_iasl
|
|||||||
### targets to do buildgcc builds
|
### targets to do buildgcc builds
|
||||||
|
|
||||||
build_gcc:
|
build_gcc:
|
||||||
bash ./buildgcc -p $(BUILD_PLATFORM) $(if $(BUILDJOBS),-j $(BUILDJOBS)) $(BUILDGCC_OPTIONS)
|
bash ./buildgcc -p $(BUILD_PLATFORM) $(if $(BUILDJOBS),-j $(BUILDJOBS)) $(BUILDGCC_OPTIONS) \
|
||||||
|
$(if $(BUILD_LANGUAGES),-l $(BUILD_LANGUAGES))
|
||||||
|
|
||||||
build_gdb:
|
build_gdb:
|
||||||
bash ./buildgcc -p $(BUILD_PLATFORM) -P gdb $(if $(BUILDJOBS),-j $(BUILDJOBS)) $(BUILDGCC_OPTIONS)
|
bash ./buildgcc -p $(BUILD_PLATFORM) -P gdb $(if $(BUILDJOBS),-j $(BUILDJOBS)) $(BUILDGCC_OPTIONS)
|
||||||
|
@@ -29,6 +29,7 @@ CROSSGCC_VERSION="1.32"
|
|||||||
PACKAGE=GCC
|
PACKAGE=GCC
|
||||||
TARGETDIR=$(pwd)/xgcc
|
TARGETDIR=$(pwd)/xgcc
|
||||||
TARGETARCH=i386-elf
|
TARGETARCH=i386-elf
|
||||||
|
LANGUAGES=c
|
||||||
DESTDIR=
|
DESTDIR=
|
||||||
SAVETEMPS=0
|
SAVETEMPS=0
|
||||||
SKIPPYTHON=1
|
SKIPPYTHON=1
|
||||||
@@ -310,6 +311,8 @@ myhelp()
|
|||||||
printf "GCC specific options:\n"
|
printf "GCC specific options:\n"
|
||||||
printf " [-p|--platform <platform>] target platform to build cross compiler for\n"
|
printf " [-p|--platform <platform>] target platform to build cross compiler for\n"
|
||||||
printf " (defaults to $TARGETARCH)\n"
|
printf " (defaults to $TARGETARCH)\n"
|
||||||
|
printf " [-l|--languages <languages>] comma separated list of target languages\n"
|
||||||
|
printf " (defaults to $LANGUAGES)\n"
|
||||||
printf "GDB specific options:\n"
|
printf "GDB specific options:\n"
|
||||||
printf " [-p|--platform <platform>] target platform to build cross compiler for\n"
|
printf " [-p|--platform <platform>] target platform to build cross compiler for\n"
|
||||||
printf " (defaults to $TARGETARCH)\n"
|
printf " (defaults to $TARGETARCH)\n"
|
||||||
@@ -416,7 +419,7 @@ build_GCC() {
|
|||||||
--enable-lto --enable-plugins --enable-gold --enable-ld=default \
|
--enable-lto --enable-plugins --enable-gold --enable-ld=default \
|
||||||
--disable-libssp --disable-bootstrap --disable-nls \
|
--disable-libssp --disable-bootstrap --disable-nls \
|
||||||
--disable-libquadmath --without-headers \
|
--disable-libquadmath --without-headers \
|
||||||
${GCC_OPTIONS} --enable-languages="c" \
|
${GCC_OPTIONS} --enable-languages="${LANGUAGES}" \
|
||||||
--with-gmp=$DESTDIR$TARGETDIR --with-mpfr=$DESTDIR$TARGETDIR \
|
--with-gmp=$DESTDIR$TARGETDIR --with-mpfr=$DESTDIR$TARGETDIR \
|
||||||
--with-mpc=$DESTDIR$TARGETDIR --with-libelf=$DESTDIR$TARGETDIR \
|
--with-mpc=$DESTDIR$TARGETDIR --with-libelf=$DESTDIR$TARGETDIR \
|
||||||
--with-pkgversion="coreboot toolchain v$CROSSGCC_VERSION $CROSSGCC_DATE" \
|
--with-pkgversion="coreboot toolchain v$CROSSGCC_VERSION $CROSSGCC_DATE" \
|
||||||
@@ -508,11 +511,11 @@ getopt - > /dev/null 2>/dev/null || gcc -o getopt getopt.c
|
|||||||
getoptbrand="$(getopt -V | sed -e '1!d' -e 's,^\(......\).*,\1,')"
|
getoptbrand="$(getopt -V | sed -e '1!d' -e 's,^\(......\).*,\1,')"
|
||||||
if [ "${getoptbrand}" = "getopt" ]; then
|
if [ "${getoptbrand}" = "getopt" ]; then
|
||||||
# Detected GNU getopt that supports long options.
|
# Detected GNU getopt that supports long options.
|
||||||
args=$(getopt -l version,help,clean,directory:,platform:,package:,jobs:,destdir:,savetemps,scripting,ccache Vhcd:p:P:j:D:tSy -- "$@")
|
args=$(getopt -l version,help,clean,directory:,platform:,languages:,package:,jobs:,destdir:,savetemps,scripting,ccache Vhcd:p:l:P:j:D:tSy -- "$@")
|
||||||
eval set "$args"
|
eval set "$args"
|
||||||
else
|
else
|
||||||
# Detected non-GNU getopt
|
# Detected non-GNU getopt
|
||||||
args=$(getopt Vhcd:p:P:j:D:tSy $*)
|
args=$(getopt Vhcd:p:l:P:j:D:tSy $*)
|
||||||
set -- $args
|
set -- $args
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -529,6 +532,7 @@ while true ; do
|
|||||||
-t|--savetemps) shift; SAVETEMPS=1;;
|
-t|--savetemps) shift; SAVETEMPS=1;;
|
||||||
-d|--directory) shift; TARGETDIR="$1"; shift;;
|
-d|--directory) shift; TARGETDIR="$1"; shift;;
|
||||||
-p|--platform) shift; TARGETARCH="$1"; shift;;
|
-p|--platform) shift; TARGETARCH="$1"; shift;;
|
||||||
|
-l|--languages) shift; LANGUAGES="$1"; shift;;
|
||||||
-D|--destdir) shift; DESTDIR="$1"; shift;;
|
-D|--destdir) shift; DESTDIR="$1"; shift;;
|
||||||
-j|--jobs) shift; JOBS="-j $1"; shift;;
|
-j|--jobs) shift; JOBS="-j $1"; shift;;
|
||||||
-P|--package) shift; PACKAGE="$1"; shift;;
|
-P|--package) shift; PACKAGE="$1"; shift;;
|
||||||
|
Reference in New Issue
Block a user