From 548cce5af0dd57857bcc80c9c21271ca7742f45f Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 1 Apr 2014 15:47:23 -0600 Subject: [PATCH] use x86_64-w64-mingw32- prefix for tools like dlltool as necessary This fixes architecture mismatches when cross-compiling. --- makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index 6728a8a0ea..d2ab60461a 100755 --- a/makefile +++ b/makefile @@ -726,6 +726,8 @@ endif openjdk-extra-cflags += $(classpath-extra-cflags) +find-tool = $(shell if ( command -v "$(1)$(2)" >/dev/null ); then (echo "$(1)$(2)") else (echo "$(2)"); fi) + ifeq ($(platform),windows) target-format = pe @@ -776,10 +778,10 @@ ifeq ($(platform),windows) endif cxx = x86_64-w64-mingw32-g++ $(mflag) cc = x86_64-w64-mingw32-gcc $(mflag) - dlltool = dlltool - ar = ar - ranlib = ranlib - strip = strip + dlltool = $(call find-tool,x86_64-w64-mingw32-,dlltool) + ar = $(call find-tool,x86_64-w64-mingw32-,ar) + ranlib = $(call find-tool,x86_64-w64-mingw32-,ranlib) + strip = $(call find-tool,x86_64-w64-mingw32-,strip) inc = "$(win64)/include" lib = "$(win64)/lib" else