add feature to strip "# comment" lines from prebuilt files

Change things so that when $(LOCAL_PREBUILT_STRIP_COMMENTS) is
nonempty, we copy the source file using sed to strip out all the "#
line"-style comments and blank lines, saving considerable system image
space in the case of some wifi configurations.

Bug: 2036961
diff --git a/core/definitions.mk b/core/definitions.mk
index c84cbd8..1c2f05b 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1469,6 +1469,13 @@
 $(hide) cp -fp $< $@
 endef
 
+# The same as copy-file-to-target, but strip out "# comment"-style
+# comments (for config files and such).
+define copy-file-to-target-strip-comments
+@mkdir -p $(dir $@)
+$(hide) sed -e 's/#.*$$//' -e 's/[ \t]*$$//' -e '/^$$/d' < $< > $@
+endef
+
 # The same as copy-file-to-target, but don't preserve
 # the old modification time.
 define copy-file-to-new-target
@@ -1489,6 +1496,12 @@
 $(copy-file-to-target)
 endef
 
+# Copy a prebuilt file to a target location, stripping "# comment" comments.
+define transform-prebuilt-to-target-strip-comments
+@echo "$(if $(PRIVATE_IS_HOST_MODULE),host,target) Prebuilt: $(PRIVATE_MODULE) ($@)"
+$(copy-file-to-target-strip-comments)
+endef
+
 
 ###########################################################
 ## On some platforms (MacOS), after copying a static