Remove $(module)_install_to_out_data flag from test makefile

Use non-empty $(module)_install_to_out_data_dir as indication
of custom target dir for a library.

Bug: http://b/22182538
Test: build and run bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: Ibfc87f45084a6fe2f487ca1b17a7625a8d8ec707
diff --git a/tests/Android.build.mk b/tests/Android.build.mk
index 740c2f4..cce4344 100644
--- a/tests/Android.build.mk
+++ b/tests/Android.build.mk
@@ -28,15 +28,7 @@
     LOCAL_MODULE_STEM_32 := $(module)32
     LOCAL_MODULE_STEM_64 := $(module)64
 else
-
 ifneq ($($(module)_install_to_out_data_dir),)
-  $(module)_install_to_out_data := true
-endif
-
-ifeq ($($(module)_install_to_out_data),true)
-    ifeq ($($(module)_install_to_out_data_dir),)
-      $(module)_install_to_out_data_dir := $(module)
-    endif
     LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/$($(module)_install_to_out_data_dir)
     LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/$($(module)_install_to_out_data_dir)
 endif
diff --git a/tests/libs/Android.build.dt_runpath.mk b/tests/libs/Android.build.dt_runpath.mk
index 4544bb1..2a6d3b3 100644
--- a/tests/libs/Android.build.dt_runpath.mk
+++ b/tests/libs/Android.build.dt_runpath.mk
@@ -71,13 +71,15 @@
 include $(LOCAL_PATH)/Android.build.testlib.mk
 
 # D version for open-from-zip test with runpath
+module := libtest_dt_runpath_d_zip
+
 libtest_dt_runpath_d_zip_src_files := \
     dlopen_b.cpp
 
 libtest_dt_runpath_d_zip_shared_libraries := libtest_dt_runpath_b libtest_dt_runpath_c
 libtest_dt_runpath_d_zip_ldflags := -Wl,--rpath,\$${ORIGIN}/dt_runpath_b_c_x -Wl,--enable-new-dtags
-libtest_dt_runpath_d_zip_install_to_out_data := true
-module := libtest_dt_runpath_d_zip
+libtest_dt_runpath_d_zip_install_to_out_data_dir := $(module)
+
 module_tag := optional
 build_type := target
 build_target := SHARED_LIBRARY
diff --git a/tests/libs/Android.mk b/tests/libs/Android.mk
index aa70b86..3c3d78b 100644
--- a/tests/libs/Android.mk
+++ b/tests/libs/Android.mk
@@ -70,13 +70,14 @@
 # -----------------------------------------------------------------------------
 # Library used by dlext tests - different name non-default location
 # -----------------------------------------------------------------------------
+module := libdlext_test_fd
+
 libdlext_test_fd_src_files := \
     dlext_test_library.cpp \
 
 libdlext_test_fd_shared_libraries := libtest_simple
 
-libdlext_test_fd_install_to_out_data := true
-module := libdlext_test_fd
+libdlext_test_fd_install_to_out_data_dir := $(module)
 module_tag := optional
 build_type := target
 build_target := SHARED_LIBRARY
@@ -86,23 +87,25 @@
 # -----------------------------------------------------------------------------
 # Libraries used by dlext tests for open from a zip-file
 # -----------------------------------------------------------------------------
+module := libdlext_test_zip
+
 libdlext_test_zip_src_files := \
     dlext_test_library.cpp \
 
 libdlext_test_zip_shared_libraries := libatest_simple_zip
 
-libdlext_test_zip_install_to_out_data := true
-module := libdlext_test_zip
+libdlext_test_zip_install_to_out_data_dir := $(module)
 module_tag := optional
 build_type := target
 build_target := SHARED_LIBRARY
 include $(TEST_PATH)/Android.build.mk
 
+module := libatest_simple_zip
+
 libatest_simple_zip_src_files := \
     dlopen_testlib_simple.cpp
 
-libatest_simple_zip_install_to_out_data := true
-module := libatest_simple_zip
+libatest_simple_zip_install_to_out_data_dir := $(module)
 module_tag := optional
 build_type := target
 build_target := SHARED_LIBRARY