Bug 1257104 - Move --disable-wmf to moz.configure. r=ted
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 17:42:57 +0900
changeset 289059 05815430d44b54133bbf74e8c4c37d48c5d34445
parent 289058 732831f18167727c126dcc0be83f69093dc57141
child 289060 a49ead1a3eeed910ca8094553c864558d5a8a2db
push id73687
push usermh@glandium.org
push dateWed, 16 Mar 2016 22:22:08 +0000
treeherdermozilla-inbound@744e0f1f8d9b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1257104
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1257104 - Move --disable-wmf to moz.configure. r=ted
build/moz.configure/old.configure
old-configure.in
toolkit/moz.configure
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -293,17 +293,16 @@ def old_configure_options(*options):
     '--enable-verify-mar',
     '--enable-vtune',
     '--enable-warnings-as-errors',
     '--enable-webapp-runtime',
     '--enable-webrtc',
     '--enable-websms-backend',
     '--enable-webspeech',
     '--enable-webspeechtestbackend',
-    '--enable-wmf',
     '--enable-xul',
     '--enable-zipwriter',
     '--no-create',
     '--prefix',
     '--with-adjust-sdk-keyfile',
     '--with-android-cxx-stl',
     '--with-android-distribution-directory',
     '--with-android-gnu-compiler-version',
--- a/old-configure.in
+++ b/old-configure.in
@@ -3061,17 +3061,16 @@ if test "$MOZ_IOS"; then
    MOZ_AUTH_EXTENSION=
 fi
 MOZ_RAW=
 MOZ_VORBIS=
 MOZ_TREMOR=
 MOZ_SAMPLE_TYPE_FLOAT32=
 MOZ_SAMPLE_TYPE_S16=
 MOZ_DIRECTSHOW=
-MOZ_WMF=
 if test -n "$MOZ_FMP4"; then
   MOZ_FMP4=1
 else
   MOZ_FMP4=
 fi
 MOZ_FFMPEG=
 MOZ_WEBRTC=1
 MOZ_PEERCONNECTION=
@@ -4349,35 +4348,16 @@ MOZ_ARG_DISABLE_BOOL(directshow,
     MOZ_DIRECTSHOW=,
     MOZ_DIRECTSHOW=1)
 
 if test -n "$MOZ_DIRECTSHOW"; then
     AC_DEFINE(MOZ_DIRECTSHOW)
 fi;
 
 dnl ========================================================
-dnl = Windows Media Foundation support
-dnl ========================================================
-if test "$OS_ARCH" = "WINNT"; then
-    dnl Enable Windows Media Foundation support by default.
-    dnl Note our minimum SDK version is Windows 7 SDK, so we are (currently)
-    dnl guaranteed to have a recent-enough SDK to build WMF.
-    MOZ_WMF=1
-fi
-
-MOZ_ARG_DISABLE_BOOL(wmf,
-[  --disable-wmf  Disable support for Windows Media Foundation],
-    MOZ_WMF=,
-    MOZ_WMF=1)
-
-if test -n "$MOZ_WMF"; then
-    AC_DEFINE(MOZ_WMF)
-fi;
-
-dnl ========================================================
 dnl FFmpeg H264/AAC Decoding Support
 dnl ========================================================
 case "$OS_TARGET" in
 WINNT|Android)
     ;;
 *)
     MOZ_FFMPEG=1
     ;;
@@ -8006,17 +7986,16 @@ AC_SUBST(CC_VERSION)
 AC_SUBST(CXX_VERSION)
 AC_SUBST(MSMANIFEST_TOOL)
 AC_SUBST(NS_ENABLE_TSF)
 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
 
 AC_SUBST(MOZ_VORBIS)
 AC_SUBST(MOZ_TREMOR)
-AC_SUBST(MOZ_WMF)
 AC_SUBST(MOZ_FFMPEG)
 AC_SUBST(MOZ_FFVPX)
 AC_SUBST_LIST(FFVPX_ASFLAGS)
 AC_SUBST(MOZ_FMP4)
 AC_SUBST(MOZ_EME)
 AC_SUBST(MOZ_DIRECTSHOW)
 AC_SUBST(MOZ_ANDROID_OMX)
 AC_SUBST(MOZ_OMX_PLUGIN)
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -152,8 +152,31 @@ def fc_freetype(value, toolkit):
 @depends(toolkit)
 def applemedia(toolkit):
     if toolkit in ('cocoa', 'uikit'):
         set_config('MOZ_APPLEMEDIA', '1')
         set_define('MOZ_APPLEMEDIA', '1')
         add_old_configure_assignment('MOZ_APPLEMEDIA', '1')
         return True
     return False
+
+
+# Windows Media Foundation support
+# ==============================================================
+option('--disable-wmf',
+       help='Disable support for Windows Media Foundation')
+
+@depends('--disable-wmf', target)
+def wmf(value, target):
+    enabled = bool(value)
+    if value.origin == 'default':
+        # Enable Windows Media Foundation support by default.
+        # Note our minimum SDK version is Windows 7 SDK, so we are (currently)
+        # guaranteed to have a recent-enough SDK to build WMF.
+        enabled = target.os == 'WINNT'
+    if enabled and target.os != 'WINNT':
+        error('Cannot enable Windows Media Foundation support on %s'
+              % target.os)
+    if enabled:
+        set_config('MOZ_WMF', '1')
+        set_define('MOZ_WMF', '1')
+        add_old_configure_assignment('MOZ_WMF', '1')
+    return enabled