Bug 1417689 - Move elfhack related things to python configure. r?build
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -177,17 +177,16 @@ def old_configure_options(*options):
'--enable-cookies',
'--enable-cpp-rtti',
'--enable-crashreporter',
'--enable-dbus',
'--enable-debug-js-modules',
'--enable-directshow',
'--enable-dtrace',
'--enable-dump-painting',
- '--enable-elf-hack',
'--enable-extensions',
'--enable-faststripe',
'--enable-feeds',
'--enable-gamepad',
'--enable-gconf',
'--enable-gczeal',
'--enable-hardware-aec-ns',
'--enable-icf',
--- a/old-configure.in
+++ b/old-configure.in
@@ -3885,47 +3885,16 @@ 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 = --disable-elf-hack
-dnl ========================================================
-
-if test -n "$MOZ_WIDGET_TOOLKIT"; then
- USE_ELF_HACK=1
-fi
-MOZ_ARG_DISABLE_BOOL(elf-hack,
-[ --disable-elf-hack Disable elf hacks],
- [USE_ELF_HACK=],
- [USE_ELF_HACK=1])
-
-# Only enable elfhack where supported
-if test "$USE_ELF_HACK" = 1; then
- case "${HOST_OS_ARCH},${OS_ARCH}" in
- Linux,Linux)
- case "${CPU_ARCH}" in
- arm | x86 | x86_64)
- USE_ELF_HACK=1
- ;;
- *)
- USE_ELF_HACK=
- ;;
- esac
- ;;
- *)
- USE_ELF_HACK=
- ;;
- esac
-fi
-
-dnl ========================================================
dnl = libstdc++ compatibility hacks
dnl ========================================================
STDCXX_COMPAT=
MOZ_ARG_ENABLE_BOOL(stdcxx-compat,
[ --enable-stdcxx-compat Enable compatibility with older libstdc++],
STDCXX_COMPAT=1)
@@ -4531,17 +4500,16 @@ AC_SUBST(MOZ_D3DCOMPILER_VISTA_DLL)
AC_SUBST(MOZ_D3DCOMPILER_VISTA_DLL_PATH)
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(USE_ELF_HACK)
AC_SUBST(INCREMENTAL_LINKER)
AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
AC_SUBST(MOZ_LINKER_EXTRACT)
if test -n "$MOZ_BINARY_EXTENSIONS"; then
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -1189,8 +1189,21 @@ option('--enable-address-sanitizer-repor
@depends('--enable-address-sanitizer-reporter')
def enable_asan_reporter(value):
if value:
return True
set_config('MOZ_ASAN_REPORTER', enable_asan_reporter)
set_define('MOZ_ASAN_REPORTER', enable_asan_reporter)
+
+# Elfhack
+# ==============================================================
+@depends(host, target)
+def has_elfhack(host, target):
+ return target.kernel == 'Linux' and host.kernel == 'Linux' and \
+ target.cpu in ('arm', 'x86', 'x86_64')
+
+with only_when(has_elfhack):
+ option('--disable-elf-hack', help='Disable elf hacks')
+
+ set_config('USE_ELF_HACK',
+ depends_if('--enable-elf-hack')(lambda _: True))