Skip checking ELF files for uninstallable soong modules

If a module is uninstallable, the shared library dependencies are not
set up and thus the ELF file check may fail incorrectly.  In this case,
there is no need to check ELF files anyway.

Test: Build walleye with no-vendor-variant VNDK enabled and does not
      see erroneous failure anymore.

Change-Id: Icd115fc82daedf11795800de5cbe87c87073586a
diff --git a/core/soong_cc_prebuilt.mk b/core/soong_cc_prebuilt.mk
index 679d5b8..31b0e63 100644
--- a/core/soong_cc_prebuilt.mk
+++ b/core/soong_cc_prebuilt.mk
@@ -96,9 +96,11 @@
 endif
 
 # Check prebuilt ELF binaries.
-ifneq ($(LOCAL_CHECK_ELF_FILES),)
-my_prebuilt_src_file := $(LOCAL_PREBUILT_MODULE_FILE)
-include $(BUILD_SYSTEM)/check_elf_file.mk
+ifdef LOCAL_INSTALLED_MODULE
+  ifneq ($(LOCAL_CHECK_ELF_FILES),)
+    my_prebuilt_src_file := $(LOCAL_PREBUILT_MODULE_FILE)
+    include $(BUILD_SYSTEM)/check_elf_file.mk
+  endif
 endif
 
 # The real dependency will be added after all Android.mks are loaded and the install paths