Bug 1289289 - Move --with-windows-version to python configure. r=chmanchester
Also, don't set the MOZ_WINSDK_TARGETVER define anymore, as it's unused.
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -317,17 +317,16 @@ def old_configure_options(*options):
'--with-system-nspr',
'--with-system-nss',
'--with-system-png',
'--with-system-zlib',
'--with-thumb',
'--with-thumb-interwork',
'--with-unify-dist',
'--with-user-appdir',
- '--with-windows-version',
'--x-includes',
'--x-libraries',
# Below are the configure flags used by comm-central.
'--enable-ldap',
'--enable-mapi',
'--enable-calendar',
'--enable-incomplete-external-linkage',
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -851,9 +851,10 @@ add_old_configure_assignment('MOZ_DEBUG_
@depends(c_compiler, target)
def libcxx_inline_visibility(c_compiler, target):
if c_compiler.type == 'clang' and target.os == 'Android':
return ''
set_define('_LIBCPP_INLINE_VISIBILITY', libcxx_inline_visibility)
set_define('_LIBCPP_INLINE_VISIBILITY_EXCEPT_GCC49', libcxx_inline_visibility)
+include('windows.configure')
include('rust.configure')
new file mode 100644
--- /dev/null
+++ b/build/moz.configure/windows.configure
@@ -0,0 +1,32 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+option('--with-windows-version', nargs=1, default='603',
+ help='Windows SDK version to target. Win 8.1 (603) is currently'
+ 'the minimum supported version.')
+
+@depends(target)
+def is_windows(target):
+ return target.kernel == 'WINNT'
+
+
+@depends_when('--with-windows-version', when=is_windows)
+@imports(_from='__builtin__', _import='ValueError')
+def valid_windows_version(value):
+ if not value:
+ die('Cannot build with --without-windows-version')
+ try:
+ version = int(value[0], 16)
+ if version in (0x603,):
+ return version
+ except ValueError:
+ pass
+
+ die('Invalid value for --with-windows-version (%s)', value[0])
+
+add_old_configure_assignment(
+ 'MOZ_WINSDK_TARGETVER',
+ depends(valid_windows_version)(lambda x: '%04x0000' % x if x else None))
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -144,36 +144,18 @@ MOZ_TOOL_VARIABLES
AC_PROG_CPP
AC_PROG_CXXCPP
dnl Special win32 checks
dnl ========================================================
# Target the Windows 8.1 SDK by default
-WINSDK_TARGETVER=603
WINVER=502
-MOZ_ARG_WITH_STRING(windows-version,
-[ --with-windows-version=WINSDK_TARGETVER
- Windows SDK version to target. Win8.1 (603) is
- currently the minimum supported version.],
- WINSDK_TARGETVER=$withval)
-
-# Currently only version 603 is allowed
-case "$WINSDK_TARGETVER" in
-603)
- MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
- ;;
-
-*)
- AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER)]);
- ;;
-esac
-
case "$target" in
*-mingw*)
if test "$GCC" != "yes"; then
# Check to see if we are really running in a msvc environemnt
_WIN32_MSVC=1
# Make sure compilers are valid
CFLAGS="$CFLAGS -TC -nologo"
@@ -320,17 +302,16 @@ case "$target" in
AC_MSG_CHECKING([for Windows SDK being recent enough])
if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
AC_MSG_RESULT("yes")
else
AC_MSG_RESULT("no")
AC_MSG_ERROR([You are targeting Windows version 0x$MOZ_WINSDK_TARGETVER, but your SDK only supports up to version $MOZ_WINSDK_MAXVER. Install and use an updated SDK, or target a lower version using --with-windows-version. Alternatively, try running the Windows SDK Configuration Tool and selecting a newer SDK. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this.])
fi
- AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
;;
esac
if test -n "$_WIN32_MSVC"; then
SKIP_PATH_CHECKS=1
SKIP_COMPILER_CHECKS=1
SKIP_LIBRARY_CHECKS=1
--- a/old-configure.in
+++ b/old-configure.in
@@ -250,37 +250,18 @@ MOZ_TOOL_VARIABLES
AC_PROG_CPP
AC_PROG_CXXCPP
dnl ========================================================
dnl Special win32 checks
dnl ========================================================
-# Target the Windows 8.1 SDK by default
-WINSDK_TARGETVER=603
WINVER=502
-MOZ_ARG_WITH_STRING(windows-version,
-[ --with-windows-version=WINSDK_TARGETVER
- Windows SDK version to target. Win8.1 (603) is
- currently the minimum supported version.],
- WINSDK_TARGETVER=$withval)
-
-# Currently only version 603 is allowed
-case "$WINSDK_TARGETVER" in
-603)
- MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
- ;;
-
-*)
- AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER)]);
- ;;
-esac
-
case "$target" in
*-mingw*)
if test "$GCC" != "yes"; then
# Check to see if we are really running in a msvc environemnt
_WIN32_MSVC=1
AC_CHECK_PROGS(MIDL, midl)
# Make sure compilers are valid
@@ -502,17 +483,16 @@ case "$target" in
AC_MSG_CHECKING([for Windows SDK being recent enough])
if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
AC_MSG_RESULT("yes")
else
AC_MSG_RESULT("no")
AC_MSG_ERROR([You are targeting Windows version 0x$MOZ_WINSDK_TARGETVER, but your SDK only supports up to version $MOZ_WINSDK_MAXVER. Install and use an updated SDK, or target a lower version using --with-windows-version. Alternatively, try running the Windows SDK Configuration Tool and selecting a newer SDK. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this.])
fi
- AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
;;
esac
if test -n "$_WIN32_MSVC"; then
SKIP_PATH_CHECKS=1
SKIP_COMPILER_CHECKS=1
SKIP_LIBRARY_CHECKS=1