2010-02-23 21:36:56 +01:00
|
|
|
#
|
|
|
|
# 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 Darwin (Mac OS X) on x86.
|
|
|
|
# Included by combo/select.mk
|
|
|
|
|
2014-04-17 19:03:35 +02:00
|
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -m32
|
|
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -m32
|
2010-05-27 01:13:54 +02:00
|
|
|
|
2012-04-27 18:35:19 +02:00
|
|
|
ifneq ($(strip $(BUILD_HOST_static)),)
|
|
|
|
# Statically-linked binaries are desirable for sandboxed environment
|
2014-04-17 19:03:35 +02:00
|
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -static
|
2012-04-27 18:35:19 +02:00
|
|
|
endif # BUILD_HOST_static
|
|
|
|
|
2014-01-29 22:09:30 +01:00
|
|
|
# Workaround differences in inttypes.h between host and target.
|
|
|
|
# See bug 12708004.
|
2014-04-17 19:03:35 +02:00
|
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
|
2012-07-30 19:09:38 +02:00
|
|
|
|
2014-04-17 19:03:35 +02:00
|
|
|
include $(BUILD_COMBOS)/mac_version.mk
|
2010-02-23 21:36:56 +01:00
|
|
|
|
2014-04-17 19:03:35 +02:00
|
|
|
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_ROOT := prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1
|
|
|
|
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_ROOT)/bin/i686-apple-darwin$(gcc_darwin_version)
|
|
|
|
$(combo_2nd_arch_prefix)HOST_CC := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)-gcc
|
|
|
|
$(combo_2nd_arch_prefix)HOST_CXX := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_PREFIX)-g++
|
2010-02-23 21:36:56 +01:00
|
|
|
|
2014-04-17 19:03:35 +02:00
|
|
|
# gcc location for clang; to be updated when clang is updated
|
|
|
|
# HOST_TOOLCHAIN_ROOT is a Darwin-specific define
|
2014-05-17 01:22:32 +02:00
|
|
|
$(combo_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG := $($(combo_2nd_arch_prefix)HOST_TOOLCHAIN_ROOT)
|
2014-04-17 19:03:35 +02:00
|
|
|
|
|
|
|
$(combo_2nd_arch_prefix)HOST_AR := $(AR)
|
2012-11-10 06:12:02 +01:00
|
|
|
|
2014-04-17 19:03:35 +02:00
|
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -isysroot $(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version) -DMACOSX_DEPLOYMENT_TARGET=$(mac_sdk_version)
|
2014-11-10 15:39:14 +01:00
|
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CPPFLAGS += -isystem $(mac_sdk_path)/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
|
2014-04-17 19:03:35 +02:00
|
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_LDFLAGS += -isysroot $(mac_sdk_root) -Wl,-syslibroot,$(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version)
|
2012-11-10 06:12:02 +01:00
|
|
|
|
2014-04-17 19:03:35 +02:00
|
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += -fPIC -funwind-tables
|
|
|
|
$(combo_2nd_arch_prefix)HOST_NO_UNDEFINED_LDFLAGS := -Wl,-undefined,error
|
2010-02-23 21:36:56 +01:00
|
|
|
|
2014-04-17 19:03:35 +02:00
|
|
|
$(combo_2nd_arch_prefix)HOST_SHLIB_SUFFIX := .dylib
|
|
|
|
$(combo_2nd_arch_prefix)HOST_JNILIB_SUFFIX := .jnilib
|
|
|
|
|
|
|
|
# TODO: add AndroidConfig.h for darwin-x86_64
|
|
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_CFLAGS += \
|
2012-06-06 00:44:21 +02:00
|
|
|
-include $(call select-android-config-h,darwin-x86)
|
2012-09-20 19:06:33 +02:00
|
|
|
|
2012-05-07 10:33:34 +02:00
|
|
|
ifneq ($(filter 10.7 10.7.% 10.8 10.8.%, $(build_mac_version)),)
|
2014-04-17 19:03:35 +02:00
|
|
|
$(combo_2nd_arch_prefix)HOST_RUN_RANLIB_AFTER_COPYING := false
|
2011-12-21 22:12:05 +01:00
|
|
|
else
|
2014-04-17 19:03:35 +02:00
|
|
|
$(combo_2nd_arch_prefix)HOST_RUN_RANLIB_AFTER_COPYING := true
|
2012-01-05 00:16:50 +01:00
|
|
|
PRE_LION_DYNAMIC_LINKER_OPTIONS := -Wl,-dynamic
|
2011-12-21 22:12:05 +01:00
|
|
|
endif
|
2014-04-17 19:03:35 +02:00
|
|
|
$(combo_2nd_arch_prefix)HOST_GLOBAL_ARFLAGS := cqs
|
|
|
|
|
|
|
|
############################################################
|
|
|
|
## Macros after this line are shared by the 64-bit config.
|
2010-02-23 21:36:56 +01:00
|
|
|
|
|
|
|
HOST_CUSTOM_LD_COMMAND := true
|
|
|
|
|
|
|
|
define transform-host-o-to-shared-lib-inner
|
2011-01-28 23:14:47 +01:00
|
|
|
$(hide) $(PRIVATE_CXX) \
|
2010-02-23 21:36:56 +01:00
|
|
|
-dynamiclib -single_module -read_only_relocs suppress \
|
2014-04-17 19:03:35 +02:00
|
|
|
$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_LD_DIRS) \
|
|
|
|
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
|
|
|
|
$(PRIVATE_HOST_GLOBAL_LDFLAGS) \
|
|
|
|
) \
|
2010-02-23 21:36:56 +01:00
|
|
|
$(PRIVATE_ALL_OBJECTS) \
|
2012-05-02 13:41:41 +02:00
|
|
|
$(addprefix -force_load , $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
|
2011-01-25 08:25:36 +01:00
|
|
|
$(call normalize-host-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
|
|
|
|
$(call normalize-host-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
|
2010-02-23 21:36:56 +01:00
|
|
|
$(PRIVATE_LDLIBS) \
|
|
|
|
-o $@ \
|
2012-02-01 22:18:20 +01:00
|
|
|
-install_name @rpath/$(notdir $@) \
|
2014-04-17 19:03:35 +02:00
|
|
|
-Wl,-rpath,@loader_path/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \
|
|
|
|
$(PRIVATE_LDFLAGS)
|
2010-02-23 21:36:56 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
define transform-host-o-to-executable-inner
|
2011-01-28 23:14:47 +01:00
|
|
|
$(hide) $(PRIVATE_CXX) \
|
2014-04-17 19:03:35 +02:00
|
|
|
-Wl,-rpath,@loader_path/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \
|
2010-02-23 21:36:56 +01:00
|
|
|
-o $@ \
|
2014-04-21 23:00:31 +02:00
|
|
|
$(PRE_LION_DYNAMIC_LINKER_OPTIONS) -Wl,-headerpad_max_install_names \
|
2014-04-17 19:03:35 +02:00
|
|
|
$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_LD_DIRS) \
|
|
|
|
$(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
|
|
|
|
$(PRIVATE_HOST_GLOBAL_LDFLAGS) \
|
|
|
|
) \
|
2011-01-25 08:25:36 +01:00
|
|
|
$(call normalize-host-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
|
2010-02-23 21:36:56 +01:00
|
|
|
$(PRIVATE_ALL_OBJECTS) \
|
2011-01-25 08:25:36 +01:00
|
|
|
$(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
|
|
|
|
$(call normalize-host-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
|
2010-02-23 21:36:56 +01:00
|
|
|
$(PRIVATE_LDFLAGS) \
|
2014-04-17 19:03:35 +02:00
|
|
|
$(PRIVATE_LDLIBS)
|
2010-02-23 21:36:56 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
# $(1): The file to check
|
|
|
|
define get-file-size
|
|
|
|
stat -f "%z" $(1)
|
|
|
|
endef
|