blob: f277ea57139f4dff434675bab73005ef86baac03 [file] [log] [blame]
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -08001#
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.
18# Included by combo/select.mk
19
The Android Open Source Project4873d8f2010-06-04 07:56:24 -070020# We build everything in 32-bit, because some host tools are
21# 32-bit-only anyway (emulator, acc), and because it gives us
22# more consistency between the host tools and the target.
23HOST_GLOBAL_CFLAGS += -m32
24HOST_GLOBAL_LDFLAGS += -m32
25
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -080026HOST_GLOBAL_CFLAGS += -fPIC
27HOST_NO_UNDEFINED_LDFLAGS := -Wl,-undefined,error
28
29HOST_CC := $(CC)
30HOST_CXX := $(CXX)
31HOST_AR := $(AR)
32
33HOST_SHLIB_SUFFIX := .dylib
34HOST_JNILIB_SUFFIX := .jnilib
35
36HOST_GLOBAL_CFLAGS += \
37 -include $(call select-android-config-h,darwin-x86)
38HOST_RUN_RANLIB_AFTER_COPYING := true
39HOST_GLOBAL_ARFLAGS := cqs
40
41HOST_CUSTOM_LD_COMMAND := true
42
43define transform-host-o-to-shared-lib-inner
44 $(HOST_CXX) \
45 -dynamiclib -single_module -read_only_relocs suppress \
46 $(HOST_GLOBAL_LD_DIRS) \
The Android Open Source Project4873d8f2010-06-04 07:56:24 -070047 $(HOST_GLOBAL_LDFLAGS) \
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -080048 $(PRIVATE_ALL_OBJECTS) \
49 $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
50 $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
51 $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
52 $(PRIVATE_LDLIBS) \
53 -o $@ \
54 $(PRIVATE_LDFLAGS) \
55 $(HOST_LIBGCC)
56endef
57
58define transform-host-o-to-executable-inner
59$(HOST_CXX) \
60 -o $@ \
61 -Wl,-dynamic -headerpad_max_install_names \
62 $(HOST_GLOBAL_LD_DIRS) \
The Android Open Source Project4873d8f2010-06-04 07:56:24 -070063 $(HOST_GLOBAL_LDFLAGS) \
Jean-Baptiste Queru9b4a8122010-02-23 12:36:56 -080064 $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \
65 $(PRIVATE_ALL_OBJECTS) \
66 $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
67 $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
68 $(PRIVATE_LDFLAGS) \
69 $(PRIVATE_LDLIBS) \
70 $(HOST_LIBGCC)
71endef
72
73# $(1): The file to check
74define get-file-size
75stat -f "%z" $(1)
76endef