Skip to content

Commit

Permalink
Bug 1639815 - Move --enable-strip and --enable-install-strip to pytho…
Browse files Browse the repository at this point in the history
…n configure. r=nalexander

Differential Revision: https://phabricator.services.mozilla.com/D76291
  • Loading branch information
glandium committed May 21, 2020
1 parent 711ffb4 commit 6ba1065
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 42 deletions.
2 changes: 0 additions & 2 deletions build/moz.configure/old.configure
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down
19 changes: 0 additions & 19 deletions js/src/old-configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
21 changes: 21 additions & 0 deletions moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 0 additions & 20 deletions old-configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ========================================================
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion python/mozbuild/mozpack/executables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 6ba1065

Please sign in to comment.