From a08decdfed2e83001c47b1eb771b79756d2bab4c Mon Sep 17 00:00:00 2001
From: Guenter Knauf <lists@gknw.net>
Date: Wed, 19 Nov 2014 11:38:37 +0100
Subject: [PATCH] build: in Makefile.m32 try to detect 64bit target.

---
 lib/Makefile.m32 | 9 +++++++--
 src/Makefile.m32 | 9 +++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/lib/Makefile.m32 b/lib/Makefile.m32
index d0ac77b105..2b23a40eee 100644
--- a/lib/Makefile.m32
+++ b/lib/Makefile.m32
@@ -54,9 +54,14 @@ ifndef LIBCARES_PATH
 LIBCARES_PATH = $(PROOT)/ares
 endif
 
-# Edit the var below to set to your architecture or set environment var.
+# Set environment var ARCH to your architecture to override autodetection.
 ifndef ARCH
-ARCH = w32
+TARGET	:= $(shell $(CC) -dumpmachine)
+ifeq ($(findstring x86_64,$(TARGET)),x86_64)
+ARCH	= w64
+else
+ARCH	= w32
+endif
 endif
 
 CC	= $(CROSSPREFIX)gcc
diff --git a/src/Makefile.m32 b/src/Makefile.m32
index ac1c0b8353..5cacade571 100644
--- a/src/Makefile.m32
+++ b/src/Makefile.m32
@@ -66,9 +66,14 @@ ifndef LIBCARES_PATH
 LIBCARES_PATH = $(PROOT)/ares
 endif
 
-# Edit the var below to set to your architecture or set environment var.
+# Set environment var ARCH to your architecture to override autodetection.
 ifndef ARCH
-ARCH = w32
+TARGET  := $(shell $(CC) -dumpmachine)
+ifeq ($(findstring x86_64,$(TARGET)),x86_64)
+ARCH    = w64
+else
+ARCH    = w32
+endif
 endif
 
 CC	= $(CROSSPREFIX)gcc
-- 
GitLab