From 4cfacf5cdeb685f7005cd62b748dfda6b9f7fdb7 Mon Sep 17 00:00:00 2001
From: mazmazz <mar.marcoz@outlook.com>
Date: Sat, 29 Dec 2018 21:14:50 -0500
Subject: [PATCH] Check for NONX86 in addition to X86_64; move MINGW64 subflags
 from win32/Makefile.cfg to Makefile

---
 src/Makefile           | 26 +++++++++++++++-----------
 src/win32/Makefile.cfg |  2 --
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 7ca07862e..bfce9cda2 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -104,8 +104,18 @@ endif
 ifdef LINUX64
 LINUX=1
 NONX86=1
+# LINUX64 does not imply X86_64=1; could mean ARM64 or Itanium
 endif
 
+ifdef MINGW64
+MINGW=1
+NONX86=1
+NOASM=1
+# MINGW64 should not necessarily imply X86_64=1, but we make that assumption elsewhere
+# Once that changes, remove this
+X86_64=1
+endif #ifdef MINGW64
+
 ifdef HAIKU
 SDL=1
 endif
@@ -176,12 +186,6 @@ ifdef MINGW
 include win32/Makefile.cfg
 endif #ifdef MINGW
 
-ifdef MINGW64
-MINGW=1
-X86_64=1
-include win32/Makefile.cfg
-endif #ifdef MINGW64
-
 ifdef UNIX
 UNIXCOMMON=1
 endif
@@ -289,14 +293,14 @@ OPTS += -DCOMPVERSION
 
 ifndef NONX86
 ifndef GCC29
-	M5=-march=pentium
+	M5?=-march=pentium
 else
-	M5=-mpentium
+	M5?=-mpentium
 endif
-endif
-
+else
 ifdef X86_64
-	M5=-march=nocona
+	M5?=-march=nocona
+endif
 endif
 
 ifndef NOASM
diff --git a/src/win32/Makefile.cfg b/src/win32/Makefile.cfg
index a73858bd4..def2fe682 100644
--- a/src/win32/Makefile.cfg
+++ b/src/win32/Makefile.cfg
@@ -7,8 +7,6 @@
 #
 
 ifdef MINGW64
-	NOASM=1
-	NONX86=1
 	HAVE_LIBGME=1
 	LIBGME_CFLAGS=-I../libs/gme/include
 	LIBGME_LDFLAGS=-L../libs/gme/win64 -lgme
-- 
GitLab