Bug 1331090 - Strip the gtest libxul prior to packaging. r=ted

MozReview-Commit-ID: KC3Wgn0OsSM

--HG--
extra : rebase_source : 9d3b928db62757959a094696376c3c10db1dea52
This commit is contained in:
Chris Manchester 2017-01-13 16:37:55 -08:00
parent 30c2539e76
commit 996bc104f2

View File

@ -203,9 +203,26 @@ endif
stage-jstests: make-stage-dir
$(MAKE) -C $(DEPTH)/js/src/tests stage-package
ifdef OBJCOPY
ifneq ($(OBJCOPY), :) # see build/autoconf/toolchain.m4:102 for why this is necessary
ifndef PKG_SKIP_STRIP
STRIP_COMPILED_TESTS := 1
endif
endif
endif
stage-gtest: make-stage-dir
$(NSINSTALL) -D $(PKG_STAGE)/gtest/gtest_bin
$(NSINSTALL) -D $(PKG_STAGE)/gtest/gtest_bin/gtest
ifdef STRIP_COMPILED_TESTS
# The libxul file basename will vary per platform. Fortunately
# dependentlibs.list always lists the library name as its final line, so we
# can get the value from there.
LIBXUL_BASE=`tail -1 $(DIST)/bin/dependentlibs.list` && \
$(OBJCOPY) $(or $(STRIP_FLAGS),--strip-unneeded) \
$(DIST)/bin/gtest/$$LIBXUL_BASE $(PKG_STAGE)/gtest/gtest_bin/gtest/$$LIBXUL_BASE
else
cp -RL $(DIST)/bin/gtest $(PKG_STAGE)/gtest/gtest_bin
endif
cp -RL $(DEPTH)/_tests/gtest $(PKG_STAGE)
cp $(topsrcdir)/testing/gtest/rungtests.py $(PKG_STAGE)/gtest
cp $(DIST)/bin/dependentlibs.list.gtest $(PKG_STAGE)/gtest
@ -220,22 +237,14 @@ stage-jetpack: make-stage-dir
CPP_UNIT_TEST_BINS=$(wildcard $(DIST)/cppunittests/*)
ifdef OBJCOPY
ifneq ($(OBJCOPY), :) # see build/autoconf/toolchain.m4:102 for why this is necessary
ifndef PKG_SKIP_STRIP
STRIP_CPP_TESTS := 1
endif
endif
endif
stage-cppunittests: make-stage-dir
$(NSINSTALL) -D $(PKG_STAGE)/cppunittest
ifdef STRIP_CPP_TESTS
ifdef STRIP_COMPILED_TESTS
$(foreach bin,$(CPP_UNIT_TEST_BINS),$(OBJCOPY) $(or $(STRIP_FLAGS),--strip-unneeded) $(bin) $(bin:$(DIST)/cppunittests/%=$(PKG_STAGE)/cppunittest/%);)
else
cp -RL $(CPP_UNIT_TEST_BINS) $(PKG_STAGE)/cppunittest
endif
ifdef STRIP_CPP_TESTS
ifdef STRIP_COMPILED_TESTS
$(OBJCOPY) $(or $(STRIP_FLAGS),--strip-unneeded) $(DIST)/bin/jsapi-tests$(BIN_SUFFIX) $(PKG_STAGE)/cppunittest/jsapi-tests$(BIN_SUFFIX)
else
cp -RL $(DIST)/bin/jsapi-tests$(BIN_SUFFIX) $(PKG_STAGE)/cppunittest