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
104 lines
3.8 KiB
Makefile
104 lines
3.8 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.
|
|
#
|
|
|
|
# Select a combo based on the compiler being used.
|
|
#
|
|
# Inputs:
|
|
# combo_target -- prefix for final variables (HOST_ or TARGET_)
|
|
# combo_2nd_arch_prefix -- it's defined if this is loaded for the 2nd arch.
|
|
#
|
|
|
|
# Build a target string like "linux-arm" or "darwin-x86".
|
|
combo_os_arch := $($(combo_target)OS)-$($(combo_target)$(combo_2nd_arch_prefix)ARCH)
|
|
|
|
combo_var_prefix := $(combo_2nd_arch_prefix)$(combo_target)
|
|
|
|
# Set reasonable defaults for the various variables
|
|
|
|
$(combo_var_prefix)CC := $(CC)
|
|
$(combo_var_prefix)CXX := $(CXX)
|
|
$(combo_var_prefix)AR := $(AR)
|
|
$(combo_var_prefix)STRIP := $(STRIP)
|
|
|
|
$(combo_var_prefix)BINDER_MINI := 0
|
|
|
|
$(combo_var_prefix)HAVE_EXCEPTIONS := 0
|
|
$(combo_var_prefix)HAVE_UNIX_FILE_PATH := 1
|
|
$(combo_var_prefix)HAVE_WINDOWS_FILE_PATH := 0
|
|
$(combo_var_prefix)HAVE_RTTI := 1
|
|
$(combo_var_prefix)HAVE_CALL_STACKS := 1
|
|
$(combo_var_prefix)HAVE_64BIT_IO := 1
|
|
$(combo_var_prefix)HAVE_CLOCK_TIMERS := 1
|
|
$(combo_var_prefix)HAVE_PTHREAD_RWLOCK := 1
|
|
$(combo_var_prefix)HAVE_STRNLEN := 1
|
|
$(combo_var_prefix)HAVE_STRERROR_R_STRRET := 1
|
|
$(combo_var_prefix)HAVE_STRLCPY := 0
|
|
$(combo_var_prefix)HAVE_STRLCAT := 0
|
|
$(combo_var_prefix)HAVE_KERNEL_MODULES := 0
|
|
|
|
$(combo_var_prefix)GLOBAL_CFLAGS := -fno-exceptions -Wno-multichar
|
|
$(combo_var_prefix)RELEASE_CFLAGS := -O2 -g -fno-strict-aliasing
|
|
$(combo_var_prefix)GLOBAL_CPPFLAGS :=
|
|
$(combo_var_prefix)GLOBAL_LDFLAGS :=
|
|
$(combo_var_prefix)GLOBAL_ARFLAGS := crsPD
|
|
$(combo_var_prefix)GLOBAL_LD_DIRS :=
|
|
|
|
$(combo_var_prefix)EXECUTABLE_SUFFIX :=
|
|
$(combo_var_prefix)SHLIB_SUFFIX := .so
|
|
$(combo_var_prefix)JNILIB_SUFFIX := $($(combo_var_prefix)SHLIB_SUFFIX)
|
|
$(combo_var_prefix)STATIC_LIB_SUFFIX := .a
|
|
|
|
# Now include the combo for this specific target.
|
|
include $(BUILD_COMBOS)/$(combo_target)$(combo_os_arch).mk
|
|
|
|
ifneq ($(USE_CCACHE),)
|
|
# The default check uses size and modification time, causing false misses
|
|
# since the mtime depends when the repo was checked out
|
|
export CCACHE_COMPILERCHECK := content
|
|
|
|
# See man page, optimizations to get more cache hits
|
|
# implies that __DATE__ and __TIME__ are not critical for functionality.
|
|
# Ignore include file modification time since it will depend on when
|
|
# the repo was checked out
|
|
export CCACHE_SLOPPINESS := time_macros,include_file_mtime,file_macro
|
|
|
|
# Turn all preprocessor absolute paths into relative paths.
|
|
# Fixes absolute paths in preprocessed source due to use of -g.
|
|
# We don't really use system headers much so the rootdir is
|
|
# fine; ensures these paths are relative for all Android trees
|
|
# on a workstation.
|
|
export CCACHE_BASEDIR := /
|
|
|
|
CCACHE_HOST_TAG := $(HOST_PREBUILT_TAG)
|
|
# If we are cross-compiling Windows binaries on Linux
|
|
# then use the linux ccache binary instead.
|
|
ifeq ($(HOST_OS)-$(BUILD_OS),windows-linux)
|
|
CCACHE_HOST_TAG := linux-$(HOST_PREBUILT_ARCH)
|
|
endif
|
|
ccache := prebuilts/misc/$(CCACHE_HOST_TAG)/ccache/ccache
|
|
# Check that the executable is here.
|
|
ccache := $(strip $(wildcard $(ccache)))
|
|
ifdef ccache
|
|
# prepend ccache if necessary
|
|
ifneq ($(ccache),$(firstword $($(combo_var_prefix)CC)))
|
|
$(combo_var_prefix)CC := $(ccache) $($(combo_var_prefix)CC)
|
|
endif
|
|
ifneq ($(ccache),$(firstword $($(combo_var_prefix)CXX)))
|
|
$(combo_var_prefix)CXX := $(ccache) $($(combo_var_prefix)CXX)
|
|
endif
|
|
ccache =
|
|
endif
|
|
endif
|