From 3f0610384a2a32e77565b22b9e5ad479ccce8856 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Tue, 7 May 2013 14:06:35 -0700 Subject: Add support for cross compiling Windows tools on Darwin. Change-Id: I71372543e8da02e1d2437d6da7eb46b0a72c9870 --- core/Makefile | 2 +- core/combo/HOST_windows-x86.mk | 12 ++++++++++-- core/config.mk | 2 +- core/envsetup.mk | 4 +--- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/core/Makefile b/core/Makefile index 94b5561..cae5d1f 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1660,7 +1660,7 @@ $(INTERNAL_SDK_TARGET): $(deps) MAIN_SDK_NAME := $(sdk_name) MAIN_SDK_DIR := $(sdk_dir) MAIN_SDK_ZIP := $(INTERNAL_SDK_TARGET) -ifneq ($(filter win_sdk,$(MAKECMDGOALS)),) +ifneq ($(filter win_sdk winsdk-coretools,$(MAKECMDGOALS)),) include $(TOPDIR)development/build/tools/windows_sdk.mk endif diff --git a/core/combo/HOST_windows-x86.mk b/core/combo/HOST_windows-x86.mk index 85bc1e0..bca6e31 100644 --- a/core/combo/HOST_windows-x86.mk +++ b/core/combo/HOST_windows-x86.mk @@ -23,22 +23,30 @@ TOOLS_PREFIX := #prebuilt/windows/host/bin/ TOOLS_EXE_SUFFIX := .exe # Settings to use MinGW has a cross-compiler under Linux -ifneq ($(findstring Linux,$(UNAME)),) ifneq ($(strip $(USE_MINGW)),) HOST_ACP_UNAVAILABLE := true TOOLS_EXE_SUFFIX := HOST_GLOBAL_CFLAGS += -DUSE_MINGW ifneq ($(strip $(BUILD_HOST_64bit)),) +ifeq ($(BUILD_OS),darwin) +$(error Windows amd64 cross compile builds not supported from Darwin) +else TOOLS_PREFIX := /usr/bin/amd64-mingw32msvc- HOST_C_INCLUDES += /usr/lib/gcc/amd64-mingw32msvc/4.4.2/include HOST_GLOBAL_LD_DIRS += -L/usr/amd64-mingw32msvc/lib +endif +else +ifeq ($(BUILD_OS),darwin) +TOOLS_PREFIX := /usr/local/gcc-4.8.0-qt-4.8.4-for-mingw32/win32-gcc/bin//i586-mingw32- +HOST_C_INCLUDES += /usr/local/gcc-4.8.0-qt-4.8.4-for-mingw32/win32-gcc/i586-mingw32/include /usr/local/gcc-4.8.0-qt-4.8.4-for-mingw32/win32-gcc/i586-mingw32/include/ddk +HOST_GLOBAL_LD_DIRS += -L/usr/local/gcc-4.8.0-qt-4.8.4-for-mingw32/win32-gcc/i586-mingw32/lib else TOOLS_PREFIX := /usr/bin/i586-mingw32msvc- HOST_C_INCLUDES += /usr/lib/gcc/i586-mingw32msvc/3.4.4/include HOST_GLOBAL_LD_DIRS += -L/usr/i586-mingw32msvc/lib +endif endif # BUILD_HOST_64bit endif # USE_MINGW -endif # Linux HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX) HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX) diff --git a/core/config.mk b/core/config.mk index ab06f6a..90237b7 100644 --- a/core/config.mk +++ b/core/config.mk @@ -336,7 +336,7 @@ endif OLD_FLEX := prebuilts/misc/$(HOST_PREBUILT_TAG)/flex/flex-2.5.4a$(HOST_EXECUTABLE_SUFFIX) -ifeq ($(HOST_OS),darwin) +ifeq ($(BUILD_OS),darwin) # Mac OS' screwy version of java uses a non-standard directory layout # and doesn't even seem to have tools.jar. On the other hand, javac seems # to be able to magically find the classes in there, wherever they are, so diff --git a/core/envsetup.mk b/core/envsetup.mk index 7a3ec92..1211887 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -55,13 +55,11 @@ endif # BUILD_OS is the real host doing the build. BUILD_OS := $(HOST_OS) -# Under Linux, if USE_MINGW is set, we change HOST_OS to Windows to build the +# If USE_MINGW is set, we change HOST_OS to Windows to build the # Windows SDK. Only a subset of tools and SDK will manage to build properly. -ifeq ($(HOST_OS),linux) ifneq ($(USE_MINGW),) HOST_OS := windows endif -endif ifeq ($(HOST_OS),) $(error Unable to determine HOST_OS from uname -sm: $(UNAME)!) -- cgit v1.1