From 6ba1065508dd2d207f09da4c77b5ad87cbc1c9e0 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 21 May 2020 23:51:58 +0000 Subject: [PATCH] Bug 1639815 - Move --enable-strip and --enable-install-strip to python configure. r=nalexander Differential Revision: https://phabricator.services.mozilla.com/D76291 --- build/moz.configure/old.configure | 2 -- js/src/old-configure.in | 19 ------------------- moz.configure | 21 +++++++++++++++++++++ old-configure.in | 20 -------------------- python/mozbuild/mozpack/executables.py | 2 +- 5 files changed, 22 insertions(+), 42 deletions(-) diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure index 2260dcab3150..634cf74130cf 100644 --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -215,7 +215,6 @@ def old_configure_options(*options): '--enable-debug-js-modules', '--enable-dump-painting', '--enable-extensions', - '--enable-install-strip', '--enable-libproxy', '--enable-logrefcnt', '--enable-mobile-optimize', @@ -227,7 +226,6 @@ def old_configure_options(*options): '--enable-pref-extensions', '--enable-sandbox', '--enable-startupcache', - '--enable-strip', '--enable-system-cairo', '--enable-system-extension-dirs', '--enable-system-pixman', diff --git a/js/src/old-configure.in b/js/src/old-configure.in index 9f7190865095..a41e6f153978 100644 --- a/js/src/old-configure.in +++ b/js/src/old-configure.in @@ -530,7 +530,6 @@ case "$target" in TARGET_COMPILER_ABI=msvc RANLIB='echo not_ranlib' STRIP='echo not_strip' - PKG_SKIP_STRIP=1 # aarch64 doesn't support subsystems below 6.02 if test "$CPU_ARCH" = "aarch64"; then WIN32_SUBSYSTEM_VERSION=6.02 @@ -1272,22 +1271,6 @@ if test -n "$COMPILE_ENVIRONMENT"; then MOZ_CONFIG_CLANG_PLUGIN fi # COMPILE_ENVIRONMENT -dnl ======================================================== -dnl = Enable stripping of libs & executables -dnl ======================================================== -MOZ_ARG_ENABLE_BOOL(strip, -[ --enable-strip Enable stripping of libs & executables ], - ENABLE_STRIP=1, - ENABLE_STRIP= ) - -dnl ======================================================== -dnl = Enable stripping of libs & executables when packaging -dnl ======================================================== -MOZ_ARG_ENABLE_BOOL(install-strip, -[ --enable-install-strip Enable stripping of libs & executables when packaging ], - PKG_SKIP_STRIP= , - PKG_SKIP_STRIP=1) - dnl ======================================================== dnl = dnl = Profiling and Instrumenting @@ -1394,8 +1377,6 @@ AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS) AC_SUBST_LIST(WARNINGS_CFLAGS) AC_SUBST(LIBICONV) -AC_SUBST(ENABLE_STRIP) -AC_SUBST(PKG_SKIP_STRIP) AC_SUBST(INCREMENTAL_LINKER) AC_SUBST_LIST(MOZ_FIX_LINK_PATHS) diff --git a/moz.configure b/moz.configure index b8a9a9e5faeb..3877964907d1 100755 --- a/moz.configure +++ b/moz.configure @@ -651,6 +651,27 @@ js_option('--disable-icf', help='Disable Identical Code Folding') add_old_configure_assignment( 'MOZ_DISABLE_ICF', '1', when=depends('--enable-icf')(lambda x: not x)) + +@depends(compile_environment, target) +def may_strip(compile_environment, target): + return compile_environment and target.kernel != 'WINNT' + +js_option('--enable-strip', when=may_strip, help='Enable stripping of libs & executables') + +set_config('ENABLE_STRIP', True, when='--enable-strip') + +js_option('--disable-install-strip', when=may_strip, + help='Enable stripping of libs & executables when packaging') + +# The nested depends is because depending on --enable-install-strip needs the +# `when=may_strip`, but we also need to test when may_strip is False. +@depends(depends('--enable-install-strip', when=may_strip)(lambda x: x), may_strip) +def pkg_skip_strip(install_strip, may_strip): + return not install_strip or not may_strip + +set_config('PKG_SKIP_STRIP', True, when=pkg_skip_strip) + + # Please do not add configure checks from here on. # Fallthrough to autoconf-based configure diff --git a/old-configure.in b/old-configure.in index 9c8adda0f8e5..5b3cd2dbab2a 100644 --- a/old-configure.in +++ b/old-configure.in @@ -635,7 +635,6 @@ case "$target" in TARGET_COMPILER_ABI=msvc RANLIB='echo not_ranlib' STRIP='echo not_strip' - PKG_SKIP_STRIP=1 # aarch64 doesn't support subsystems below 6.02 if test "$CPU_ARCH" = "aarch64"; then WIN32_SUBSYSTEM_VERSION=6.02 @@ -877,7 +876,6 @@ fi if test -z "$COMPILE_ENVIRONMENT"; then SKIP_COMPILER_CHECKS=1 SKIP_LIBRARY_CHECKS=1 - PKG_SKIP_STRIP=1 MOZ_DEBUGGING_OPTS else MOZ_COMPILER_OPTS @@ -2261,22 +2259,6 @@ if test -n "$COMPILE_ENVIRONMENT"; then MOZ_CONFIG_CLANG_PLUGIN fi # COMPILE_ENVIRONMENT -dnl ======================================================== -dnl = Enable stripping of libs & executables -dnl ======================================================== -MOZ_ARG_ENABLE_BOOL(strip, -[ --enable-strip Enable stripping of libs & executables ], - ENABLE_STRIP=1, - ENABLE_STRIP= ) - -dnl ======================================================== -dnl = Enable stripping of libs & executables when packaging -dnl ======================================================== -MOZ_ARG_ENABLE_BOOL(install-strip, -[ --enable-install-strip Enable stripping of libs & executables when packaging ], - PKG_SKIP_STRIP= , - PKG_SKIP_STRIP=1) - dnl ======================================================== dnl = frontend JS debug mode dnl ======================================================== @@ -2688,8 +2670,6 @@ AC_SUBST(MOZ_UPDATER) AC_SUBST(MOZ_ANDROID_APPLICATION_CLASS) AC_SUBST(MOZ_ANDROID_BROWSER_INTENT_CLASS) AC_SUBST(MOZ_EXCLUDE_HYPHENATION_DICTIONARIES) -AC_SUBST(ENABLE_STRIP) -AC_SUBST(PKG_SKIP_STRIP) AC_SUBST(STRIP_FLAGS) AC_SUBST(INCREMENTAL_LINKER) diff --git a/python/mozbuild/mozpack/executables.py b/python/mozbuild/mozpack/executables.py index f35ba3605b17..82f9e1707fc1 100644 --- a/python/mozbuild/mozpack/executables.py +++ b/python/mozbuild/mozpack/executables.py @@ -86,7 +86,7 @@ def may_strip(path): Return whether strip() should be called ''' from buildconfig import substs - return not substs['PKG_SKIP_STRIP'] + return not substs.get('PKG_SKIP_STRIP') def strip(path):