Bug 1257104 - Move --disable-wmf to moz.configure draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 17:42:57 +0900
changeset 341067 d75b376a579c832fe564fcf75b373d920fd640f8
parent 341066 0dfc7675bd65e62af1a48086c7d873c8fb620a9d
child 341068 e83ad42a1d99d5555e57c437cb26e5ffbf70ff08
push id13127
push userbmo:mh+mozilla@glandium.org
push dateWed, 16 Mar 2016 12:32:02 +0000
bugs1257104
milestone48.0a1
Bug 1257104 - Move --disable-wmf to moz.configure
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
@@ -151,8 +151,30 @@ 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):
+    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.
+        value = target.os == 'WINNT'
+    if value and target.os != 'WINNT':
+        error('Cannot enable Windows Media Foundation support on %s'
+              % target.os)
+    if value:
+        set_config('MOZ_WMF', '1')
+        set_define('MOZ_WMF', '1')
+        add_old_configure_assignment('MOZ_WMF', '1')
+    return bool(value)