Nico Huber (nico.h@gmx.de) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16674
-gerrit
commit 7268bb408460144e1073ac5e5a04fa950cdca035 Author: Nico Huber nico.huber@secunet.com Date: Tue Sep 20 12:55:19 2016 +0200
buildgcc: Add functions to test GCC versions
Just add some helpers that show parts (major, major.minor) of the GCC version to be built (buildcc_*) and of the host compiler (hostcc_*). They will be used in follow-up commits.
Change-Id: I37c12ad1a2d08645f40a9f0f0a479c8d7cc3e127 Signed-off-by: Nico Huber nico.huber@secunet.com --- util/crossgcc/buildgcc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 9eb72f9..e7395d7 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -205,6 +205,26 @@ check_for_library() { rm -rf "${LIBTEST_FILE}.c" "${LIBTEST_FILE}" }
+buildcc_major() { + echo "${GCC_VERSION}" | sed -e 's/..*//' +} + +buildcc_version() { + echo "${GCC_VERSION}" | sed -e 's/.[^.]*$//' +} + +hostcc_major() { + (echo __GNUC__ | ${CC} -E - 2>/dev/null || echo 0) | tail -1 +} + +hostcc_minor() { + (echo __GNUC_MINOR__ | ${CC} -E - 2>/dev/null || echo 0) | tail -1 +} + +hostcc_version() { + printf "%d.%d" "$(hostcc_major)" "$(hostcc_minor)" +} + check_sum() { test -z "$CHECKSUM" || \ test "$(cat sum/$1.cksum 2>/dev/null | sed -e 's@.*([0-9a-f]{40,}).*@\1@')" = \