Rename my_ndk_version_root to my_ndk_sysroot; and _include and _lib

prebuilts/ndk/current/platforms/android-19/arch-x86_64/usr/lib
is renamed to usr/lib64 to be more consistent with rest of
lib paths in x86_64 toolchain, which is multilib

See https://android-review.googlesource.com/#/c/92441/

Change-Id: I4e59245505d0fa87ae3608e81e715ccfcecc5ec8
This commit is contained in:
Andrew Hsieh 2014-04-25 23:47:10 -07:00
parent 676e11fed8
commit 140761af09
3 changed files with 19 additions and 11 deletions

View File

@ -9,7 +9,9 @@
include $(BUILD_SYSTEM)/base_rules.mk
#######################################
my_ndk_version_root :=
my_ndk_sysroot :=
my_ndk_sysroot_include :=
my_ndk_sysroot_lib :=
ifdef LOCAL_SDK_VERSION
ifdef LOCAL_NDK_VERSION
$(error $(LOCAL_PATH): LOCAL_NDK_VERSION is now retired.)
@ -18,7 +20,13 @@ ifdef LOCAL_SDK_VERSION
$(error $(LOCAL_PATH): LOCAL_SDK_VERSION cannot be used in host module)
endif
my_ndk_source_root := $(HISTORICAL_NDK_VERSIONS_ROOT)/current/sources
my_ndk_version_root := $(HISTORICAL_NDK_VERSIONS_ROOT)/current/platforms/android-$(LOCAL_SDK_VERSION)/arch-$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)
my_ndk_sysroot := $(HISTORICAL_NDK_VERSIONS_ROOT)/current/platforms/android-$(LOCAL_SDK_VERSION)/arch-$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)
my_ndk_sysroot_include := $(my_ndk_sysroot)/usr/include
ifeq (x86_64,$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))
my_ndk_sysroot_lib := $(my_ndk_sysroot)/usr/lib64
else
my_ndk_sysroot_lib := $(my_ndk_sysroot)/usr/lib
endif
# Set up the NDK stl variant. Starting from NDK-r5 the c++ stl resides in a separate location.
# See ndk/docs/CPLUSPLUS-SUPPORT.html
@ -198,7 +206,7 @@ endif
ifndef LOCAL_IS_HOST_MODULE
ifdef LOCAL_SDK_VERSION
my_target_project_includes :=
my_target_c_includes := $(my_ndk_stl_include_path) $(my_ndk_version_root)/usr/include
my_target_c_includes := $(my_ndk_stl_include_path) $(my_ndk_sysroot_include)
my_target_global_cppflags := $(my_ndk_stl_cppflags)
else
my_target_project_includes := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_PROJECT_INCLUDES)
@ -817,7 +825,7 @@ built_shared_libraries := \
# Add the NDK libraries to the built module dependency
my_system_shared_libraries_fullpath := \
$(my_ndk_stl_shared_lib_fullpath) \
$(addprefix $(my_ndk_version_root)/usr/lib/, \
$(addprefix $(my_ndk_sysroot_lib)/, \
$(addsuffix $(so_suffix), $(my_system_shared_libraries)))
built_shared_libraries += $(my_system_shared_libraries_fullpath)

View File

@ -38,12 +38,12 @@ ifdef LOCAL_SDK_VERSION
# so we don't have race condition when the system libraries (such as libc, libstdc++) are also built in the tree.
my_target_global_ld_dirs := \
$(addprefix -L, $(patsubst %/,%,$(dir $(my_ndk_stl_shared_lib_fullpath))) \
$(my_ndk_version_root)/usr/lib) \
$(my_ndk_sysroot_lib)) \
$(my_target_global_ld_dirs)
my_target_global_ldflags := $(my_ndk_stl_shared_lib) $(my_target_global_ldflags)
my_target_crtbegin_dynamic_o := $(wildcard $(my_ndk_version_root)/usr/lib/crtbegin_dynamic.o)
my_target_crtbegin_static_o := $(wildcard $(my_ndk_version_root)/usr/lib/crtbegin_static.o)
my_target_crtend_o := $(wildcard $(my_ndk_version_root)/usr/lib/crtend_android.o)
my_target_crtbegin_dynamic_o := $(wildcard $(my_ndk_sysroot_lib)/crtbegin_dynamic.o)
my_target_crtbegin_static_o := $(wildcard $(my_ndk_sysroot_lib)/crtbegin_static.o)
my_target_crtend_o := $(wildcard $(my_ndk_sysroot_lib)/crtend_android.o)
endif
$(linked_module): PRIVATE_TARGET_GLOBAL_LD_DIRS := $(my_target_global_ld_dirs)
$(linked_module): PRIVATE_TARGET_GLOBAL_LDFLAGS := $(my_target_global_ldflags)

View File

@ -49,11 +49,11 @@ ifdef LOCAL_SDK_VERSION
# so we don't have race condition when the system libraries (such as libc, libstdc++) are also built in the tree.
my_target_global_ld_dirs := \
$(addprefix -L, $(patsubst %/,%,$(dir $(my_ndk_stl_shared_lib_fullpath))) \
$(my_ndk_version_root)/usr/lib) \
$(my_ndk_sysroot_lib)) \
$(my_target_global_ld_dirs)
my_target_global_ldflags := $(my_ndk_stl_shared_lib) $(my_target_global_ldflags)
my_target_crtbegin_so_o := $(wildcard $(my_ndk_version_root)/usr/lib/crtbegin_so.o)
my_target_crtend_so_o := $(wildcard $(my_ndk_version_root)/usr/lib/crtend_so.o)
my_target_crtbegin_so_o := $(wildcard $(my_ndk_sysroot_lib)/crtbegin_so.o)
my_target_crtend_so_o := $(wildcard $(my_ndk_sysroot_lib)/crtend_so.o)
endif
$(linked_module): PRIVATE_TARGET_GLOBAL_LD_DIRS := $(my_target_global_ld_dirs)
$(linked_module): PRIVATE_TARGET_GLOBAL_LDFLAGS := $(my_target_global_ldflags)