Bug 1257104 - Move MOZ_APPLEMEDIA to moz.configure draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 16 Mar 2016 17:37:42 +0900
changeset 341066 0dfc7675bd65e62af1a48086c7d873c8fb620a9d
parent 341065 fd8576b731c751f4e74fba03afafef3bb89550c8
child 341067 d75b376a579c832fe564fcf75b373d920fd640f8
push id13127
push userbmo:mh+mozilla@glandium.org
push dateWed, 16 Mar 2016 12:32:02 +0000
bugs1257104
milestone48.0a1
Bug 1257104 - Move MOZ_APPLEMEDIA to moz.configure Note the AC_DEFINE used to be in a COMPILE_ENVIRONMENT block, but the define is actually used in Gecko preferences, so it's actually better that the define is always set when MOZ_APPLEMEDIA is enabled.
old-configure.in
toolkit/moz.configure
--- a/old-configure.in
+++ b/old-configure.in
@@ -4320,23 +4320,18 @@ AC_CACHE_CHECK([__attribute__ ((aligned 
 if test "${ac_cv_c_attribute_aligned}" != "0"; then
   AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
                      [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
 fi
 
 dnl ========================================================
 dnl = Apple platform decoder support
 dnl ========================================================
-if test "$MOZ_WIDGET_TOOLKIT" = "cocoa" || test "$MOZ_WIDGET_TOOLKIT" = "uikit"; then
-  MOZ_APPLEMEDIA=1
-fi
-
 if test "$COMPILE_ENVIRONMENT"; then
 if test -n "$MOZ_APPLEMEDIA"; then
-  AC_DEFINE(MOZ_APPLEMEDIA)
   # hack in frameworks for fmp4 - see bug 1029974
   # We load VideoToolbox and CoreMedia dynamically, so they don't appear here.
   LDFLAGS="$LDFLAGS -framework AudioToolbox"
   dnl Verify CoreMedia is available.
   AC_CHECK_HEADER([CoreMedia/CoreMedia.h], [],
     [AC_MSG_ERROR([MacOS X 10.7 SDK or later is required])])
 fi
 fi # COMPILE_ENVIRONMENT
@@ -8019,17 +8014,16 @@ 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_APPLEMEDIA)
 AC_SUBST(MOZ_OMX_PLUGIN)
 AC_SUBST(MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE)
 AC_SUBST(MOZ_VPX_ERROR_CONCEALMENT)
 AC_SUBST(VPX_USE_YASM)
 AC_SUBST_LIST(VPX_ASFLAGS)
 AC_SUBST(VPX_AS_CONVERSION)
 AC_SUBST(VPX_X86_ASM)
 AC_SUBST(VPX_ARM_ASM)
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -139,8 +139,20 @@ def instrument_event_loop(value, toolkit
 option(env='USE_FC_FREETYPE',
        help='Force-enable the use of fontconfig freetype')
 
 @depends('USE_FC_FREETYPE', toolkit)
 def fc_freetype(value, toolkit):
     if (value or toolkit in ('gtk2', 'gtk3', 'qt') and
             value.origin == 'default'):
         add_old_configure_assignment('USE_FC_FREETYPE', '1')
+
+
+# Apple platform decoder support
+# ==============================================================
+@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