6feb6d5607
This change basically ported our target multilib to the host side. It supports 2 host build modes: x86 and x86_64 multilib build. For now you need to set "BUILD_HOST_64bit=true" to switch to x86_64 multilib build. Later we'll default to x86_64 build and have a flag to force 32-bit only build, which may be needed by SDK build. In host module definition, like in target ones, you can use the following LOCAL variables to set up multilib configuration: LOCAL_MULTILIB: can be "both", "first", "32" or "64". It also supports the same set of arch or 32-vs-64 specific LOCAL variables. By default, it builds only for the first arch. To keep path compatibility, in x86_64 build files are still output to out/host/linux-x86; Both 32-bit and 64-bit executables are in out/host/linux-86/bin; In x86_64 build 32-bit shared libraries are installed to out/host/linux-x86/lib32 and 64-bit shared libraries are installed to out/host/linux-x86/lib; 32-bit object files are output to out/host/linux-x86/obj32 and 64-bit object files are output to out/host/linux-x86/obj. Bug: 13751317 Change-Id: I6044f83b7db369a33e05209e8c588eb6dc83409f
81 lines
2.9 KiB
Makefile
81 lines
2.9 KiB
Makefile
#
|
|
# Copyright (C) 2006 The Android Open Source Project
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
|
|
# Configuration for Linux on x86.
|
|
# Included by combo/select.make
|
|
|
|
# right now we get these from the environment, but we should
|
|
# pick them from the tree somewhere
|
|
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 :=
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -DUSE_MINGW
|
|
TOOLS_PREFIX := /usr/bin/i586-mingw32msvc-
|
|
$(combo_2nd_arch_prefix)HOST_C_INCLUDES += /usr/lib/gcc/i586-mingw32msvc/3.4.4/include
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LD_DIRS += -L/usr/i586-mingw32msvc/lib
|
|
endif # USE_MINGW
|
|
endif # Linux
|
|
|
|
# Workaround differences in inttypes.h between host and target.
|
|
# See bug 12708004.
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -D__USE_MINGW_ANSI_STDIO
|
|
|
|
$(combo_2nd_arch_prefix)HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX)
|
|
$(combo_2nd_arch_prefix)HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX)
|
|
$(combo_2nd_arch_prefix)HOST_AR := $(TOOLS_PREFIX)ar$(TOOLS_EXE_SUFFIX)
|
|
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += \
|
|
-include $(call select-android-config-h,windows)
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += \
|
|
--enable-stdcall-fixup
|
|
|
|
ifneq ($(strip $(BUILD_HOST_static)),)
|
|
# Statically-linked binaries are desirable for sandboxed environment
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -static
|
|
endif # BUILD_HOST_static
|
|
|
|
# when building under Cygwin, ensure that we use Mingw compilation by default.
|
|
# you can disable this (i.e. to generate Cygwin executables) by defining the
|
|
# USE_CYGWIN variable in your environment, e.g.:
|
|
#
|
|
# export USE_CYGWIN=1
|
|
#
|
|
# note that the -mno-cygwin flags are not needed when cross-compiling the
|
|
# Windows host tools on Linux
|
|
#
|
|
ifneq ($(findstring CYGWIN,$(UNAME)),)
|
|
ifeq ($(strip $(USE_CYGWIN)),)
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -mno-cygwin
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -mno-cygwin -mconsole
|
|
endif
|
|
endif
|
|
|
|
############################################################
|
|
## Macros after this line are shared by the 64-bit config.
|
|
|
|
HOST_SHLIB_SUFFIX := .dll
|
|
HOST_EXECUTABLE_SUFFIX := .exe
|
|
|
|
# $(1): The file to check
|
|
# TODO: find out what format cygwin's stat(1) uses
|
|
define get-file-size
|
|
999999999
|
|
endef
|