1 # 2 # Copyright (C) 2006 The Android Open Source Project 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 # 16 17 # Configuration for Darwin (Mac OS X) on x86_64. 18 # Included by combo/select.mk 19 20 HOST_GLOBAL_CFLAGS += -m64 21 HOST_GLOBAL_LDFLAGS += -m64 22 23 ifneq ($(strip $(BUILD_HOST_static)),) 24 # Statically-linked binaries are desirable for sandboxed environment 25 HOST_GLOBAL_LDFLAGS += -static 26 endif # BUILD_HOST_static 27 28 # Workaround differences in inttypes.h between host and target. 29 # See bug 12708004. 30 HOST_GLOBAL_CFLAGS += -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS 31 32 include $(BUILD_COMBOS)/mac_version.mk 33 34 HOST_TOOLCHAIN_ROOT := prebuilts/gcc/darwin-x86/host/i686-apple-darwin-4.2.1 35 HOST_TOOLCHAIN_PREFIX := $(HOST_TOOLCHAIN_ROOT)/bin/i686-apple-darwin$(gcc_darwin_version) 36 HOST_CC := $(HOST_TOOLCHAIN_PREFIX)-gcc 37 HOST_CXX := $(HOST_TOOLCHAIN_PREFIX)-g++ 38 39 define $(combo_var_prefix)transform-shared-lib-to-toc 40 $(call _gen_toc_command_for_macho,$(1),$(2)) 41 endef 42 43 # gcc location for clang; to be updated when clang is updated 44 # HOST_TOOLCHAIN_ROOT is a Darwin-specific define 45 HOST_TOOLCHAIN_FOR_CLANG := $(HOST_TOOLCHAIN_ROOT) 46 47 HOST_AR := $(AR) 48 49 HOST_GLOBAL_CFLAGS += -isysroot $(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version) -DMACOSX_DEPLOYMENT_TARGET=$(mac_sdk_version) 50 HOST_GLOBAL_CPPFLAGS += -isystem $(mac_sdk_path)/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 51 HOST_GLOBAL_LDFLAGS += -isysroot $(mac_sdk_root) -Wl,-syslibroot,$(mac_sdk_root) -mmacosx-version-min=$(mac_sdk_version) 52 53 HOST_GLOBAL_CFLAGS += -fPIC -funwind-tables 54 HOST_NO_UNDEFINED_LDFLAGS := -Wl,-undefined,error 55 56 HOST_SHLIB_SUFFIX := .dylib 57 HOST_JNILIB_SUFFIX := .jnilib 58 59 HOST_GLOBAL_ARFLAGS := cqs 60 61 # We Reuse the following functions with the same name from HOST_darwin-x86.mk: 62 # transform-host-o-to-shared-lib-inner 63 # transform-host-o-to-executable-inner 64 # get-file-size 65