diff --git a/common.crosstool b/common.crosstool index 8f399dc..3749166 100644 --- a/common.crosstool +++ b/common.crosstool @@ -42,6 +42,7 @@ RUN mkdir /dockcross/crosstool \ && /dockcross/install-crosstool-ng-toolchain.sh \ -p "${XCC_PREFIX}" \ -c /dockcross/crosstool-ng.config \ + -v "${CT_VERSION}" \ && rm -rf /dockcross/crosstool /dockcross/install-crosstool-ng-toolchain.sh # Restore our default workdir (from "dockcross/base"). diff --git a/imagefiles/install-crosstool-ng-toolchain.sh b/imagefiles/install-crosstool-ng-toolchain.sh index 3c5034d..8c0fb7a 100755 --- a/imagefiles/install-crosstool-ng-toolchain.sh +++ b/imagefiles/install-crosstool-ng-toolchain.sh @@ -16,7 +16,7 @@ set -o pipefail # be generated underneath of here. ROOT=${PWD} -usage() { echo "Usage: $0 -p -c " 1>&2; exit 1; } +usage() { echo "Usage: $0 -p -c -v " 1>&2; exit 1; } # Resolve our input parameters. # @@ -24,7 +24,8 @@ usage() { echo "Usage: $0 -p -c " 1>&2; exit 1; } # change directories during installation. CT_PREFIX= CONFIG_PATH= -while getopts "p:c:" o; do +REV= +while getopts "p:c:v:" o; do case "${o}" in p) CT_PREFIX=$(readlink -f ${OPTARG}) @@ -32,6 +33,9 @@ while getopts "p:c:" o; do c) CONFIG_PATH=$(readlink -f ${OPTARG}) ;; + v) + REV=${OPTARG} + ;; *) usage ;; @@ -48,6 +52,12 @@ if [ -z ${CONFIG_PATH} ] || [ ! -f ${CONFIG_PATH} ]; then usage fi +if [ -z ${REV} ]; then + echo "WARNING: No version selected, use default version: crosstool-ng-1.23.0 (-v)." + REV=crosstool-ng-1.23.0 +fi + + ## # Build "crosstool-ng". ## @@ -57,12 +67,17 @@ mkdir -p "${CTNG}" cd "${CTNG}" # Download and install the "crosstool-ng" source. -REV=1.23.0 -curl -# -LO \ - "https://github.com/crosstool-ng/crosstool-ng/archive/crosstool-ng-${REV}.tar.gz" -tar -xf "crosstool-ng-${REV}.tar.gz" -patch crosstool-ng-crosstool-ng-1.23.0/scripts/build/companion_libs/210-expat.sh -i /dockcross/crosstool-ng-expat.patch -cd "crosstool-ng-crosstool-ng-${REV}" + +git clone https://github.com/crosstool-ng/crosstool-ng.git +cd crosstool-ng +git fetch --tags + +# checkout +git checkout ${REV} + +if [ ${REV} = "crosstool-ng-1.23.0" ]; then + patch scripts/build/companion_libs/210-expat.sh -i /dockcross/crosstool-ng-expat.patch +fi # Bootstrap and install the tool. BOOTSTRAP_PREFIX="${CTNG}/prefix" @@ -96,5 +111,6 @@ cp "${CONFIG_PATH}" "${BUILD}/.config" unset LD_LIBRARY_PATH # Build and install the toolchain! -"${BOOTSTRAP_PREFIX}/bin/ct-ng" build +# Print last 250 lines if build fail +"${BOOTSTRAP_PREFIX}/bin/ct-ng" build || tail -250 build.log diff --git a/linux-arm64/Dockerfile.in b/linux-arm64/Dockerfile.in index bce7b35..c81fb5a 100644 --- a/linux-arm64/Dockerfile.in +++ b/linux-arm64/Dockerfile.in @@ -2,6 +2,9 @@ FROM dockcross/base:latest # This is for 64-bit ARM Linux machine +# Crosstool-ng version +ENV CT_VERSION crosstool-ng-1.23.0 + #include "common.crosstool" # The cross-compiling emulator diff --git a/linux-armv5/Dockerfile.in b/linux-armv5/Dockerfile.in index e146905..29192b5 100644 --- a/linux-armv5/Dockerfile.in +++ b/linux-armv5/Dockerfile.in @@ -4,6 +4,9 @@ MAINTAINER Matt McCormick "matt.mccormick@kitware.com" # This is for ARMv5 "legacy" (armel) devices which do NOT support hard float # VFP instructions (armhf). +# Crosstool-ng version +ENV CT_VERSION crosstool-ng-1.23.0 + #include "common.crosstool" # The cross-compiling emulator diff --git a/linux-armv7/Dockerfile.in b/linux-armv7/Dockerfile.in index 466ba2b..124e7e2 100644 --- a/linux-armv7/Dockerfile.in +++ b/linux-armv7/Dockerfile.in @@ -1,6 +1,9 @@ FROM dockcross/base:latest MAINTAINER Matt McCormick "matt.mccormick@kitware.com" +# Crosstool-ng version +ENV CT_VERSION crosstool-ng-1.23.0 + # This is for 32-bit ARMv7 Linux #include "common.crosstool" diff --git a/linux-armv7a/Dockerfile.in b/linux-armv7a/Dockerfile.in index afa6f83..1b2f343 100644 --- a/linux-armv7a/Dockerfile.in +++ b/linux-armv7a/Dockerfile.in @@ -2,6 +2,10 @@ FROM dockcross/base:latest MAINTAINER Matt McCormick "matt.mccormick@kitware.com" # This is for 32-bit ARMv7 Linux + +# Crosstool-ng version +ENV CT_VERSION crosstool-ng-1.23.0 + #include "common.crosstool" # The cross-compiling emulator diff --git a/linux-mips/Dockerfile.in b/linux-mips/Dockerfile.in index df06190..80a56b7 100644 --- a/linux-mips/Dockerfile.in +++ b/linux-mips/Dockerfile.in @@ -2,6 +2,9 @@ FROM dockcross/base:latest # This is for 32-bit Big-Endian MIPS devices with hard floating point enabled +# Crosstool-ng version +ENV CT_VERSION crosstool-ng-1.23.0 + #include "common.crosstool" # The cross-compiling emulator diff --git a/linux-ppc64le/Dockerfile.in b/linux-ppc64le/Dockerfile.in index 983bbc6..50d231d 100644 --- a/linux-ppc64le/Dockerfile.in +++ b/linux-ppc64le/Dockerfile.in @@ -1,6 +1,9 @@ FROM dockcross/base:latest MAINTAINER Matt McCormick "matt.mccormick@kitware.com" +# Crosstool-ng version +ENV CT_VERSION crosstool-ng-1.23.0 + #include "common.crosstool" ENV CROSS_TRIPLE powerpc64le-linux-gnu diff --git a/linux-s390x/Dockerfile.in b/linux-s390x/Dockerfile.in index b925174..05527cd 100644 --- a/linux-s390x/Dockerfile.in +++ b/linux-s390x/Dockerfile.in @@ -2,6 +2,9 @@ FROM dockcross/base:latest # This is for 64-bit S390X Linux machine +# Crosstool-ng version +ENV CT_VERSION crosstool-ng-1.23.0 + #include "common.crosstool" # The cross-compiling emulator