make/StripBinaries.gmk
changeset 31499 fae46850f641
parent 31312 74e504d86cc9
child 32811 df82db312e58
--- a/make/StripBinaries.gmk	Thu Jul 02 16:07:57 2015 -0700
+++ b/make/StripBinaries.gmk	Wed Jul 05 20:40:41 2017 +0200
@@ -28,6 +28,9 @@
 include $(SPEC)
 include MakeBase.gmk
 
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, , StripBinaries.gmk))
+
 ################################################################################
 # Copy native libraries and executables to a secondary location to strip them
 # and filter out files that shouldn't go into the image.
@@ -51,22 +54,24 @@
   endef
 endif
 
+NO_STRIP_CMDS_FILTER += %.cgi
+
 # Don't include debug info for executables.
 ALL_CMDS_SRC := $(filter-out %.bc %.debuginfo %.diz %.map %.pdb, \
     $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_cmds -type f -o -type l))
-COPY_CMDS_SRC := $(filter %.cgi, $(ALL_CMDS_SRC))
-STRIP_CMDS_SRC := $(filter-out $(COPY_CMDS_SRC), $(ALL_CMDS_SRC))
+COPY_CMDS_SRC := $(filter $(NO_STRIP_CMDS_FILTER), $(ALL_CMDS_SRC))
+STRIP_CMDS_SRC := $(filter-out $(NO_STRIP_CMDS_FILTER), $(ALL_CMDS_SRC))
 
-# Make sure symbolic links are copied and not stripped
-COPY_LIBS_SRC := \
-    $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs \
-        \( ! -name '*$(SHARED_LIBRARY_SUFFIX)' -type f \) -o -type l)
 # OS X stores symbol information in a .dylib file inside a .dSYM directory -
 # that file should not be stripped, so we prune the tree at the .dSYM directory.
 # Example: support/modules_libs/java.base/libjsig.dylib.dSYM/Contents/Resources/DWARF/libjsig.dylib
 STRIP_LIBS_SRC := \
     $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs \
         -name '*$(SHARED_LIBRARY_SUFFIX)' -type f -print -o -name "*.dSYM" -prune)
+# Make sure symbolic links are copied and not stripped.
+COPY_LIBS_SRC := \
+    $(filter-out $(STRIP_LIBS_SRC), \
+    $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs -type f -o -type l))
 
 $(eval $(call SetupCopyFiles,STRIP_MODULES_CMDS, \
     SRC := $(SUPPORT_OUTPUTDIR)/modules_cmds, \