Parse the list of supported vndk snapshot versions
This allows the target, ld.config.$VER.txt, to be defined for all
$VERs for which a VNDK snapshot exists under /prebuilts/vndk/v$VER.
With this fix,
1) supported_vndk_snaphsot_versions do not need to
be manually updated everytime a new VNDK snapshot is added and,
2) ld.config.$VER.txt will not be ill-defined in a tree that does
not have the required dependency files under /prebuilts/vndk/v$VER.
Test: m -j ld.config.28.txt
Bug: 74658756
Merged-In: Idb056c21412d4cb7c7a7cb3c247b1d82a4a759ff
Change-Id: Idb056c21412d4cb7c7a7cb3c247b1d82a4a759ff
(cherry picked from commit baeaaf94296cf3d6202362eb1ea46c8acdf8955a)
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
index 0312859..2429b49 100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -250,10 +250,16 @@
# For VNDK snapshot versions prior to 28, ld.config.txt is installed from the
# prebuilt under /prebuilts/vndk
-supported_vndk_snapshot_versions := 28
+vndk_snapshots := $(wildcard prebuilts/vndk/*)
+supported_vndk_snapshot_versions := \
+ $(strip $(foreach ver,$(patsubst prebuilts/vndk/v%,%,$(vndk_snapshots)),\
+ $(if $(call math_gt_or_eq,$(ver),28),$(ver),)))
$(eval $(foreach ver,$(supported_vndk_snapshot_versions),\
$(call build_versioned_ld_config,$(ver))))
+vndk_snapshots :=
+supported_vndk_snapshot_versions :=
+
#######################################
# ld.config.vndk_lite.txt
#