build/autoconf/winsdk.m4

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build/autoconf/winsdk.m4	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +dnl This Source Code Form is subject to the terms of the Mozilla Public
     1.5 +dnl License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 +dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 +
     1.8 +dnl Identify which version of the SDK we're building with
     1.9 +dnl Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
    1.10 +dnl from there
    1.11 +AC_DEFUN([MOZ_FIND_WINSDK_VERSION], [
    1.12 +  MOZ_CHECK_HEADERS([winsdkver.h])
    1.13 +  if test "$ac_cv_header_winsdkver_h" = "yes"; then
    1.14 +      dnl Get the highest _WIN32_WINNT and NTDDI versions supported
    1.15 +      dnl Take the higher of the two
    1.16 +      dnl This is done because the Windows 7 beta SDK reports its
    1.17 +      dnl NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
    1.18 +      AC_CACHE_CHECK(for highest Windows version supported by this SDK,
    1.19 +                     ac_cv_winsdk_maxver,
    1.20 +                     [cat > conftest.h <<EOF
    1.21 +#include <winsdkver.h>
    1.22 +#include <sdkddkver.h>
    1.23 +
    1.24 +#if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
    1.25 +#define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
    1.26 +#else
    1.27 +#define WINSDK_MAXVER NTDDI_MAXVER
    1.28 +#endif
    1.29 +
    1.30 +WINSDK_MAXVER
    1.31 +EOF
    1.32 +                      ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
    1.33 +                      rm -f conftest.h
    1.34 +                     ])
    1.35 +      MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
    1.36 +  else
    1.37 +      dnl Any SDK which doesn't have WinSDKVer.h is too old.
    1.38 +      AC_MSG_ERROR([Your SDK does not have WinSDKVer.h. It is probably too old. Please upgrade to a newer SDK or 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.])
    1.39 +  fi
    1.40 +])

mercurial