Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 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. |
| 18 | # Included by combo/select.mk |
| 19 | |
Jeff Hamilton | ebc2869 | 2010-05-26 18:13:54 -0500 | [diff] [blame^] | 20 | # 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. |
| 23 | HOST_GLOBAL_CFLAGS += -m32 |
| 24 | HOST_GLOBAL_LDFLAGS += -m32 |
| 25 | |
| 26 | |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 27 | HOST_GLOBAL_CFLAGS += -fPIC |
| 28 | HOST_NO_UNDEFINED_LDFLAGS := -Wl,-undefined,error |
| 29 | |
| 30 | HOST_CC := $(CC) |
| 31 | HOST_CXX := $(CXX) |
| 32 | HOST_AR := $(AR) |
| 33 | |
| 34 | HOST_SHLIB_SUFFIX := .dylib |
| 35 | HOST_JNILIB_SUFFIX := .jnilib |
| 36 | |
| 37 | HOST_GLOBAL_CFLAGS += \ |
| 38 | -include $(call select-android-config-h,darwin-x86) |
| 39 | HOST_RUN_RANLIB_AFTER_COPYING := true |
| 40 | HOST_GLOBAL_ARFLAGS := cqs |
| 41 | |
| 42 | HOST_CUSTOM_LD_COMMAND := true |
| 43 | |
| 44 | define transform-host-o-to-shared-lib-inner |
| 45 | $(HOST_CXX) \ |
| 46 | -dynamiclib -single_module -read_only_relocs suppress \ |
| 47 | $(HOST_GLOBAL_LD_DIRS) \ |
Jeff Hamilton | ebc2869 | 2010-05-26 18:13:54 -0500 | [diff] [blame^] | 48 | $(HOST_GLOBAL_LDFLAGS) \ |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 49 | $(PRIVATE_ALL_OBJECTS) \ |
| 50 | $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ |
| 51 | $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ |
| 52 | $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ |
| 53 | $(PRIVATE_LDLIBS) \ |
| 54 | -o $@ \ |
| 55 | $(PRIVATE_LDFLAGS) \ |
| 56 | $(HOST_LIBGCC) |
| 57 | endef |
| 58 | |
| 59 | define transform-host-o-to-executable-inner |
| 60 | $(HOST_CXX) \ |
| 61 | -o $@ \ |
| 62 | -Wl,-dynamic -headerpad_max_install_names \ |
| 63 | $(HOST_GLOBAL_LD_DIRS) \ |
Jeff Hamilton | ebc2869 | 2010-05-26 18:13:54 -0500 | [diff] [blame^] | 64 | $(HOST_GLOBAL_LDFLAGS) \ |
Jean-Baptiste Queru | 9b4a812 | 2010-02-23 12:36:56 -0800 | [diff] [blame] | 65 | $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ |
| 66 | $(PRIVATE_ALL_OBJECTS) \ |
| 67 | $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ |
| 68 | $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ |
| 69 | $(PRIVATE_LDFLAGS) \ |
| 70 | $(PRIVATE_LDLIBS) \ |
| 71 | $(HOST_LIBGCC) |
| 72 | endef |
| 73 | |
| 74 | # $(1): The file to check |
| 75 | define get-file-size |
| 76 | stat -f "%z" $(1) |
| 77 | endef |