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_64.
     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 HOST_GLOBAL_ARFLAGS := cqs
     25 
     26 HOST_CUSTOM_LD_COMMAND := true
     27 
     28 define transform-host-o-to-shared-lib-inner
     29 $(hide) $(PRIVATE_CXX) \
     30         -dynamiclib -single_module -read_only_relocs suppress \
     31         $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
     32             $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
     33         ) \
     34         $(PRIVATE_ALL_OBJECTS) \
     35         $(addprefix -force_load , $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \
     36         $(PRIVATE_ALL_SHARED_LIBRARIES) \
     37         $(PRIVATE_ALL_STATIC_LIBRARIES) \
     38         $(PRIVATE_LDLIBS) \
     39         -o $@ \
     40         -install_name @rpath/$(notdir $@) \
     41         -Wl,-rpath,@loader_path/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \
     42         -Wl,-rpath,@loader_path/$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \
     43         $(PRIVATE_LDFLAGS)
     44 endef
     45 
     46 define transform-host-o-to-executable-inner
     47 $(hide) $(PRIVATE_CXX) \
     48         $(foreach path,$(PRIVATE_RPATHS), \
     49           -Wl,-rpath,@loader_path/$(path)) \
     50         -o $@ \
     51         -Wl,-headerpad_max_install_names \
     52         $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \
     53            $(PRIVATE_HOST_GLOBAL_LDFLAGS) \
     54         ) \
     55         $(PRIVATE_ALL_SHARED_LIBRARIES) \
     56         $(PRIVATE_ALL_OBJECTS) \
     57         $(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES) \
     58         $(PRIVATE_ALL_STATIC_LIBRARIES) \
     59         $(PRIVATE_LDFLAGS) \
     60         $(PRIVATE_LDLIBS)
     61 endef
     62 
     63 # $(1): The file to check
     64 define get-file-size
     65 stat -f "%z" $(1)
     66 endef
     67