summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorBiswapriyo Nath <nathbappai@gmail.com>2021-07-21 11:37:01 +0530
committerxenu <me@xenu.pl>2021-07-29 04:09:14 +0200
commit87a09ccde40c9dfb85d2fa70fa830527275f44b1 (patch)
treeb57f07c05a7733e88bc74c6c85a8ae1ccd5f87d0 /win32
parent83dc89ef721a8d574ee5cd83af8059227add862c (diff)
downloadperl-87a09ccde40c9dfb85d2fa70fa830527275f44b1.tar.gz
win32/GNUmakefile: Get CPU arch from target triplet
MinGW-w64 target triplet is different in GCC and Clang/llvm
Diffstat (limited to 'win32')
-rw-r--r--win32/GNUmakefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/win32/GNUmakefile b/win32/GNUmakefile
index f35ec0b97d..79976dc89b 100644
--- a/win32/GNUmakefile
+++ b/win32/GNUmakefile
@@ -408,12 +408,16 @@ CCHOME := $(VCINSTALLDIR)
endif
endif
+# Check processor architecture from target triplet
+# possible values:
+# gcc: i686-w64-mingw32, x86_64-w64-mingw32
+# clang: i686-w64-windows-gnu, x86_64-w64-windows-gnu
ifeq ($(CCTYPE),GCC)
-ifeq ($(GCCTARGET),x86_64-w64-mingw32)
+ifeq (x86_64, $(findstring x86_64, $(GCCTARGET)))
WIN64 := define
PROCESSOR_ARCHITECTURE := x64
endif
-ifeq ($(GCCTARGET),i686-w64-mingw32)
+ifeq (i686, $(findstring i686, $(GCCTARGET)))
WIN64 := undef
PROCESSOR_ARCHITECTURE := x86
endif