Bug 1266620 - Move MACOSX_DEPLOYMENT_TARGET to moz.configure. r=chmanchester
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 21 Apr 2016 08:11:32 +0900
changeset 318388 fb0d7b82c072b81ec2d2551dd832f48c287527f9
parent 318387 e4926a91834c55723c810e84797cd9a0b75e0c45
child 318389 755257b3f436d949d912aedf305af82634ccfed3
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1266620
milestone48.0a1
Bug 1266620 - Move MACOSX_DEPLOYMENT_TARGET to moz.configure. r=chmanchester
build/moz.configure/old.configure
build/moz.configure/toolchain.configure
js/src/old-configure.in
old-configure.in
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -197,17 +197,16 @@ def old_configure_options(*options):
     '--enable-ion',
     '--enable-ios-target',
     '--enable-ipdl-tests',
     '--enable-jitspew',
     '--enable-libjpeg-turbo',
     '--enable-libproxy',
     '--enable-llvm-hacks',
     '--enable-logrefcnt',
-    '--enable-macos-target',
     '--enable-maintenance-service',
     '--enable-media-navigator',
     '--enable-memory-sanitizer',
     '--enable-mobile-optimize',
     '--enable-more-deterministic',
     '--enable-mozril-geoloc',
     '--enable-necko-protocols',
     '--enable-necko-wifi',
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -65,16 +65,39 @@ add_old_configure_assignment('YASM', hav
 @depends('--disable-compile-environment', build_project, '--help')
 def android_ndk_include(compile_env, build_project, _):
     if compile_env and build_project in ('mobile/android', 'js'):
         return 'android-ndk.configure'
 
 include(android_ndk_include)
 
 
+# MacOS deployment target version
+# ==============================================================
+# This needs to happen before any compilation test is done.
+
+option('--enable-macos-target', env='MACOSX_DEPLOYMENT_TARGET', nargs=1,
+       default='10.6', help='Set the minimum MacOS version needed at runtime')
+
+@depends('--enable-macos-target', target)
+@imports(_from='os', _import='environ')
+def macos_target(value, target):
+    if value and target.os == 'OSX':
+        # Ensure every compiler process we spawn uses this value.
+        environ['MACOSX_DEPLOYMENT_TARGET'] = value[0]
+        return value[0]
+    if value and value.origin != 'default':
+        die('--enable-macos-target cannot be used when targeting %s',
+            target.os)
+
+
+set_config('MACOSX_DEPLOYMENT_TARGET', macos_target)
+add_old_configure_assignment('MACOSX_DEPLOYMENT_TARGET', macos_target)
+
+
 # Compiler wrappers
 # ==============================================================
 # Normally, we'd use js_option and automatically have those variables
 # propagated to js/src, but things are complicated by possible additional
 # wrappers in CC/CXX, and by other subconfigures that do not handle those
 # options and do need CC/CXX altered.
 option('--with-compiler-wrapper', env='COMPILER_WRAPPER', nargs=1,
        help='Enable compiling with wrappers such as distcc and ccache')
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -402,42 +402,16 @@ dnl ====================================
 dnl = Mac OS X toolchain support
 dnl ========================================================
 
 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
 dnl that a universal binary is being produced.
 AC_SUBST(UNIVERSAL_BINARY)
 
 dnl ========================================================
-dnl Check for MacOS deployment target version
-dnl ========================================================
-
-MOZ_ARG_ENABLE_STRING(macos-target,
-                      [  --enable-macos-target=VER (default=10.6)
-                          Set the minimum MacOS version needed at runtime],
-                      [_MACOSX_DEPLOYMENT_TARGET=$enableval])
-
-if test "$target_cpu" != "arm"; then
-case "$target" in
-*-darwin*)
-    if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
-        dnl Use the specified value
-        export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
-    else
-        dnl No value specified on the command line or in the environment,
-        dnl use architecture minimum.
-        export MACOSX_DEPLOYMENT_TARGET=10.6
-    fi
-    ;;
-esac
-fi
-
-AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
-
-dnl ========================================================
 dnl = Mac OS X SDK support
 dnl ========================================================
 MACOS_SDK_DIR=
 MOZ_ARG_WITH_STRING(macos-sdk,
 [  --with-macos-sdk=dir    Location of platform SDK to use (Mac OS X only)],
     MACOS_SDK_DIR=$withval)
 
 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
--- a/old-configure.in
+++ b/old-configure.in
@@ -264,40 +264,16 @@ fi
 if test -n "$MOZ_WINCONSOLE"; then
     AC_DEFINE(MOZ_WINCONSOLE)
 fi
 
 MOZ_TOOL_VARIABLES
 
 MOZ_RUST_SUPPORT
 
-dnl ========================================================
-dnl Check for MacOS deployment target version
-dnl ========================================================
-
-MOZ_ARG_ENABLE_STRING(macos-target,
-                      [  --enable-macos-target=VER (default=10.6)
-                          Set the minimum MacOS version needed at runtime],
-                      [_MACOSX_DEPLOYMENT_TARGET=$enableval])
-
-case "$target" in
-*-darwin*)
-    if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
-        dnl Use the specified value
-        export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
-    else
-        dnl No value specified on the command line or in the environment,
-        dnl use architecture minimum.
-        export MACOSX_DEPLOYMENT_TARGET=10.6
-    fi
-    ;;
-esac
-
-AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
-
 AC_PROG_CPP
 AC_PROG_CXXCPP
 
 dnl ========================================================
 dnl Special win32 checks
 dnl ========================================================
 
 # Target the Windows 8.1 SDK by default