diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure index 91843486809e..d96085567ea5 100644 --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -202,7 +202,6 @@ def old_configure_options(*options): '--enable-libproxy', '--enable-llvm-hacks', '--enable-logrefcnt', - '--enable-macos-target', '--enable-maintenance-service', '--enable-media-navigator', '--enable-memory-sanitizer', diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure index 4f158e9d6101..a888bc340d87 100644 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -70,6 +70,29 @@ def android_ndk_include(compile_env, build_project, _): 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 diff --git a/js/src/old-configure.in b/js/src/old-configure.in index bb9d23825446..55f1ce3a41ad 100644 --- a/js/src/old-configure.in +++ b/js/src/old-configure.in @@ -406,32 +406,6 @@ 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 ======================================================== diff --git a/old-configure.in b/old-configure.in index 9332e9feb2cf..8111477163e3 100644 --- a/old-configure.in +++ b/old-configure.in @@ -269,30 +269,6 @@ 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