Home | History | Annotate | Download | only in combo
      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 
     20 define $(combo_var_prefix)transform-shared-lib-to-toc
     21 $(call _gen_toc_command_for_macho,$(1),$(2))
     22 endef
     23 
     24 $(combo_2nd_arch_prefix)HOST_GLOBAL_ARFLAGS := cqs
     25 
     26 ############################################################
     27 ## Macros after this line are shared by the 64-bit config.
     28 
     29 HOST_CUSTOM_LD_COMMAND := true
     30 
     31 define transform-host-o-to-shared-lib-inner
     32 $(hide) $(PRIVATE_CXX) \
     33         -dynamiclib -single_module -read_only_relocs suppress \
     34         $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
     35             $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
     36         ) \
     37         $(PRIVATE_ALL_OBJECTS) \
     38         $(addprefix -force_load , $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
     39         $(PRIVATE_ALL_SHARED_LIBRARIES) \
     40         $(PRIVATE_ALL_STATIC_LIBRARIES) \
     41         $(PRIVATE_LDLIBS) \
     42         -o $@ \
     43         -install_name @rpath/$(notdir $@) \
     44         -Wl,-rpath,@loader_path/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \
     45         -Wl,-rpath,@loader_path/$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \
     46         $(PRIVATE_LDFLAGS)
     47 endef
     48 
     49 define transform-host-o-to-executable-inner
     50 $(hide) $(PRIVATE_CXX) \
     51         $(foreach path,$(PRIVATE_RPATHS), \
     52           -Wl,-rpath,@loader_path/$(path)) \
     53         -o $@ \
     54         -Wl,-headerpad_max_install_names \
     55         $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
     56            $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
     57         ) \
     58         $(PRIVATE_ALL_SHARED_LIBRARIES) \
     59         $(PRIVATE_ALL_OBJECTS) \
     60         $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
     61         $(PRIVATE_ALL_STATIC_LIBRARIES) \
     62         $(PRIVATE_LDFLAGS) \
     63         $(PRIVATE_LDLIBS)
     64 endef
     65 
     66 # $(1): The file to check
     67 define get-file-size
     68 stat -f "%z" $(1)
     69 endef
     70