From b74c52f8ba521ad0e67b28414bf77fa25af08a73 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 9 May 2024 12:48:26 +0100 Subject: [PATCH] Fix detection of Ubuntu/MinGW version For downright incomprehensible reasons the Ubuntu/MinGW folks have decided that MinGW on Ubuntu should no longer report the compiler's version as '.', but instead as '-win32', which of course breaks any script that attempts to read version numbers. This results in MinGW compilation of gnu-efi on Ubuntu producing the error: /bin/sh: 1: [: Illegal number: 10-win32 Fix this by replacing any '-win32' in the -dumpversion report with '.0' so that we get an approximate version number back again. Signed-off-by: Pete Batard --- Make.defaults | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Make.defaults b/Make.defaults index a6be473..b0da3d7 100755 --- a/Make.defaults +++ b/Make.defaults @@ -97,8 +97,8 @@ ifeq ($(ARCH),mips64) override ARCH := mips64el endif -GCCVERSION := $(shell $(CC) -dumpversion | cut -f1 -d.) -GCCMINOR := $(shell $(CC) -dumpversion | cut -f2 -d.) +GCCVERSION := $(shell $(CC) -dumpversion | sed -e 's/-win32/.0/' | cut -f1 -d.) +GCCMINOR := $(shell $(CC) -dumpversion | sed -e 's/-win32/.0/' | cut -f2 -d.) USING_CLANG := $(shell $(CC) -v 2>&1 | grep -q 'clang version' && echo clang) # Rely on GCC MS ABI support?