Compilation: add `make strip-debug` 68/18268/3
Clément DAVID [Mon, 20 Jun 2016 12:41:11 +0000 (14:41 +0200)]
This will store debuginfo out of xxx.so.6.0.0 and thus it reduce startup time
and (may be used to) binary size.

Change-Id: I8d4dcf254ad1e66b613f16b07bce759240259797

scilab/Makefile.am
scilab/Makefile.in

index 2b79f83..ee3a8d9 100644 (file)
@@ -197,6 +197,15 @@ macros: $(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli check-jvm-
        echo "$(top_builddir)/bin/scilab-cli -ns -noatomsautoload -quit -f modules/functions/scripts/buildmacros/buildmacros.sce" ; \
        $(top_builddir)/bin/scilab-cli -ns -noatomsautoload -quit -f modules/functions/scripts/buildmacros/buildmacros.sce) || exit 1
 
+strip-debug:
+       find $(top_builddir) -name '*.so.?.?.?' | while read file ; \
+       do \
+           if [ ! -f $$file.debug ]; then \
+               objcopy --only-keep-debug $$file $$file.debug; \
+               objcopy --strip-debug $$file; \
+               objcopy --add-gnu-debuglink=$$file.debug $$file; \
+           fi \
+       done;
 
 check-jvm-dep:
 # Check that scilab-cli does not have a dependency on libjvm
@@ -540,7 +549,7 @@ pkgconfigdir = $(libdir)/pkgconfig
 # Files to install in Pkgconfig directory
 pkgconfig_DATA = scilab.pc
 
-.PHONY: macros localization doc
+.PHONY: macros localization doc strip-debug
 
 .NOTPARALLEL: macros doc
 
index bd86289..fa3fcf5 100644 (file)
@@ -2136,6 +2136,16 @@ macros: $(top_builddir)/scilab-cli-bin $(top_builddir)/bin/scilab-cli check-jvm-
        echo "$(top_builddir)/bin/scilab-cli -ns -noatomsautoload -quit -f modules/functions/scripts/buildmacros/buildmacros.sce" ; \
        $(top_builddir)/bin/scilab-cli -ns -noatomsautoload -quit -f modules/functions/scripts/buildmacros/buildmacros.sce) || exit 1
 
+strip-debug:
+       find $(top_builddir) -name '*.so.?.?.?' | while read file ; \
+       do \
+           if [ ! -f $$file.debug ]; then \
+               objcopy --only-keep-debug $$file $$file.debug; \
+               objcopy --strip-debug $$file; \
+               objcopy --add-gnu-debuglink=$$file.debug $$file; \
+           fi \
+       done;
+
 check-jvm-dep:
 # Check that scilab-cli does not have a dependency on libjvm
 @IS_MACOSX_FALSE@      @ldd .libs/scilab-cli-bin|grep libjvm > /dev/null; \
@@ -2416,7 +2426,7 @@ install-data-local:
 @EXTERNAL_SCIRENDERER_FALSE@@GUI_TRUE@ $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/$(PATHTOSCIRENDERER)
 @EXTERNAL_SCIRENDERER_FALSE@@GUI_TRUE@ $(INSTALL_DATA) $(top_builddir)/$(PATHTOSCIRENDERER)/$(SCIRENDERERJAR) $(DESTDIR)$(pkgdatadir)/$(PATHTOSCIRENDERER)/
 
-.PHONY: macros localization doc
+.PHONY: macros localization doc strip-debug
 
 .NOTPARALLEL: macros doc