libreboot

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 04f28ea7280492bb7acfa71f223d76bc37a54902
parent 4996135284edab0dbd54c3c09acc849919c7a74f
Author: Swift Geek <swiftgeek@gmail.com>
Date:   Mon,  2 Oct 2017 11:31:10 +0000

Merge branch 'crossgcc-scripts' of kragle/libreboot into master

Diffstat:
projects/crossgcc/configs/targets | 1+
projects/crossgcc/crossgcc | 16++++++++++++++--
projects/crossgcc/crossgcc-helper | 15+++++++++++++++
3 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/projects/crossgcc/configs/targets b/projects/crossgcc/configs/targets @@ -1 +1,2 @@ arm +i386 diff --git a/projects/crossgcc/crossgcc b/projects/crossgcc/crossgcc @@ -123,7 +123,10 @@ prefix() { case $arch in "arm") - printf '%s\n' "$build_path/bin/arm-eabi-" + printf '\n%s\n' "$build_path/bin/arm-eabi-" + ;; + "i386") + printf '\n%s\n' "$build_path/bin/i386-elf-" ;; esac } @@ -145,7 +148,16 @@ build() { mkdir -p "$build_path" - make -C "$sources_path" CPUS="$TASKS" DEST="$build_path" "crossgcc-$arch" + local bootstrap_flag + + if ! crossgcc_same_major_version_test; then + printf '\n%s' 'GCC major versions differ. Bootstrapping' 1>&2 + printf '%s\n\n' ' to avoid potential build failure' 1>&2 + + bootstrap_flag='-b' + fi + + make -C "$sources_path" "$bootstrap_flag" CPUS="$TASKS" DEST="$build_path" "crossgcc-$arch" } build_check() { diff --git a/projects/crossgcc/crossgcc-helper b/projects/crossgcc/crossgcc-helper @@ -15,6 +15,21 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +crossgcc_same_major_version_test() { + local buildgcc_path="$sources_path/util/crossgcc/buildgcc" + local sources_path="$(project_sources_path "$project" "$repository" "$@")" + + local crossgcc_version="$(sed -rne 's/^GCC_VERSION=(.*)$/\1/p' "$buildgcc_path")" + local host_gcc_version="$(gcc -dumpversion)" + + if [[ "${host_gcc_version%%.*}" -eq "${crossgcc_version%%.*}" ]]; then + + return 0 + else + return 1 + fi +} + crossgcc_tarballs() { local sources_path=$( project_sources_path "$project" "$repository" "$@" ) local install_path="$sources_path/util/crossgcc/tarballs/"