David Hendricks would like Miklós Márton to review this change.

View Change

Fixed mingw detection on Windows 7 (NT-6.1) and hopefully in another non XP Windows build environments too.

Change-Id: I7f856dc4847c4ca9197b1935b7a9b9071b46c70a
Signed-off-by: Miklós Márton <martonmiklosqdev@gmail.com>
---
M Makefile
1 file changed, 5 insertions(+), 1 deletion(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/65/23865/1
diff --git a/Makefile b/Makefile
index 5bd7158..755fe86 100644
--- a/Makefile
+++ b/Makefile
@@ -97,7 +97,11 @@

# HOST_OS is only used to work around local toolchain issues.
HOST_OS ?= $(shell uname)
-ifeq ($(HOST_OS), MINGW32_NT-5.1)
+
+# Use a regexp to check if we are building in a mingw enviroment.
+# uname returns MINGW32_NT-5.1 on XP, MINGW32_NT-6.1 on Windows 7
+# the regexp should support 64 bit variant of mingw if exists
+ifeq ($(shell if [[ $$(uname) =~ ^MINGW[0-9]{0,2}_NT-[0-9]{1,2}.[0-9]{1,2}$$ ]]; then echo yes; else echo no; fi), yes)
# Explicitly set CC = gcc on MinGW, otherwise: "cc: command not found".
CC = gcc
endif

To view, visit change 23865. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f856dc4847c4ca9197b1935b7a9b9071b46c70a
Gerrit-Change-Number: 23865
Gerrit-PatchSet: 1
Gerrit-Owner: David Hendricks <david.hendricks@gmail.com>
Gerrit-Reviewer: Miklós Márton <martonmiklosqdev@gmail.com>