Support building Windows SDK under Linux.
- envsetup.mk & config.mk: we define a new BUILD_OS and a minimal set
of things like BUILD_OUT to be able to use some local tools when
doing cross-compilation. This allows us to use the Linux version of
ACP when cross-compiling the tools to Windows.
- Makfile: include windows_sdk.mk when needed to build a Windows SDK.
- main.mk: support a win_sdk target (e.g. PRODUCT-sdk-win_sdk)
(Merge master Change I9d08d0df)
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 6d14753..f8a2027 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -68,9 +68,17 @@
ifneq (,$(findstring CYGWIN,$(UNAME)))
HOST_OS := windows
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
+# 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)!)
@@ -86,6 +94,8 @@
HOST_ARCH := ppc
endif
+BUILD_ARCH := $(HOST_ARCH)
+
ifeq ($(HOST_ARCH),)
$(error Unable to determine HOST_ARCH from uname -sm: $(UNAME)!)
endif
@@ -168,6 +178,8 @@
HOST_OUT_debug := $(HOST_OUT_ROOT_debug)/$(HOST_OS)-$(HOST_ARCH)
HOST_OUT := $(HOST_OUT_$(HOST_BUILD_TYPE))
+BUILD_OUT := $(OUT_DIR)/host/$(BUILD_OS)-$(BUILD_ARCH)
+
ifeq ($(TARGET_SIMULATOR),true)
# Any arch- or os-specific parts of the simulator (everything
# under product/) are actually host-dependent.
@@ -185,6 +197,8 @@
OUT_DOCS := $(TARGET_COMMON_OUT_ROOT)/docs
+BUILD_OUT_EXECUTABLES:= $(BUILD_OUT)/bin
+
HOST_OUT_EXECUTABLES:= $(HOST_OUT)/bin
HOST_OUT_SHARED_LIBRARIES:= $(HOST_OUT)/lib
HOST_OUT_JAVA_LIBRARIES:= $(HOST_OUT)/framework