Bug 1257104 - Move --disable-ffmpeg to moz.configure draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 17:46:13 +0900
changeset 341068 e83ad42a1d99d5555e57c437cb26e5ffbf70ff08
parent 341067 d75b376a579c832fe564fcf75b373d920fd640f8
child 341069 3278fc47a15f8ac20a83567fb7841d318b2aff23
push id13127
push userbmo:mh+mozilla@glandium.org
push dateWed, 16 Mar 2016 12:32:02 +0000
bugs1257104
milestone48.0a1
Bug 1257104 - Move --disable-ffmpeg 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
@@ -195,17 +195,16 @@ def old_configure_options(*options):
     '--enable-dmd',
     '--enable-dtrace',
     '--enable-dump-painting',
     '--enable-elf-hack',
     '--enable-eme',
     '--enable-extensions',
     '--enable-faststripe',
     '--enable-feeds',
-    '--enable-ffmpeg',
     '--enable-fmp4',
     '--enable-gamepad',
     '--enable-gc-trace',
     '--enable-gconf',
     '--enable-gczeal',
     '--enable-gio',
     '--enable-gnomeui',
     '--enable-gold',
--- a/old-configure.in
+++ b/old-configure.in
@@ -3066,17 +3066,16 @@ MOZ_TREMOR=
 MOZ_SAMPLE_TYPE_FLOAT32=
 MOZ_SAMPLE_TYPE_S16=
 MOZ_DIRECTSHOW=
 if test -n "$MOZ_FMP4"; then
   MOZ_FMP4=1
 else
   MOZ_FMP4=
 fi
-MOZ_FFMPEG=
 MOZ_WEBRTC=1
 MOZ_PEERCONNECTION=
 MOZ_SRTP=
 MOZ_WEBRTC_SIGNALING=
 MOZ_WEBRTC_ASSERT_ALWAYS=1
 MOZ_WEBRTC_HARDWARE_AEC_NS=
 MOZ_SCTP=
 MOZ_ANDROID_OMX=
@@ -4348,37 +4347,16 @@ MOZ_ARG_DISABLE_BOOL(directshow,
     MOZ_DIRECTSHOW=,
     MOZ_DIRECTSHOW=1)
 
 if test -n "$MOZ_DIRECTSHOW"; then
     AC_DEFINE(MOZ_DIRECTSHOW)
 fi;
 
 dnl ========================================================
-dnl FFmpeg H264/AAC Decoding Support
-dnl ========================================================
-case "$OS_TARGET" in
-WINNT|Android)
-    ;;
-*)
-    MOZ_FFMPEG=1
-    ;;
-esac
-
-MOZ_ARG_DISABLE_BOOL(ffmpeg,
-[  --disable-ffmpeg         Disable FFmpeg for fragmented H264/AAC decoding],
-    MOZ_FFMPEG=,
-    MOZ_FFMPEG=1
-)
-
-if test -n "$MOZ_FFMPEG"; then
-    AC_DEFINE(MOZ_FFMPEG)
-fi;
-
-dnl ========================================================
 dnl = Built-in fragmented MP4 support.
 dnl ========================================================
 
 if test "$OS_TARGET" = Android -a -z "$gonkdir"; then
     MOZ_FMP4=1
 fi
 
 if test -n "$MOZ_WMF" -o -n "$MOZ_FFMPEG" -o -n "$MOZ_APPLEMEDIA"; then
@@ -7986,17 +7964,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_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)
 AC_SUBST(MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE)
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -173,8 +173,24 @@ def wmf(value, target):
     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)
+
+
+# FFmpeg H264/AAC Decoding Support
+# ==============================================================
+option('--disable-ffmpeg',
+       help='Disable FFmpeg for fragmented H264/AAC decoding')
+
+@depends('--disable-ffmpeg', target)
+def ffmpeg(value, target):
+    if value.origin == 'default':
+        value = target.os not in ('Android', 'WINNT')
+    if value:
+        set_define('MOZ_FFMPEG', '1')
+        set_config('MOZ_FFMPEG', '1')
+        add_old_configure_assignment('MOZ_FFMPEG', '1')
+    return bool(value)