Bug 1368948: Build freetype when enabling SkiaPDF on Windows. draft
authorBruce Sun <brsun@mozilla.com>
Wed, 14 Jun 2017 14:13:06 +0800
changeset 593827 6af568518afceeef49637197b688ceaf2fa7e8d2
parent 593826 c5a2101d547c1651e4abb9d5779601d30a1798ae
child 593828 db2ce67df1100675bb903c76f73b820e8efa2a2b
push id63822
push userbmo:brsun@mozilla.com
push dateWed, 14 Jun 2017 06:17:45 +0000
bugs1368948
milestone55.0a1
Bug 1368948: Build freetype when enabling SkiaPDF on Windows. MozReview-Commit-ID: HIs9c2srjcH
old-configure.in
toolkit/moz.configure
--- a/old-configure.in
+++ b/old-configure.in
@@ -3499,17 +3499,17 @@ for extension in $MOZ_EXTENSIONS; do
         AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
     fi
 done
 
 if test -n "$MOZ_USE_NATIVE_POPUP_WINDOWS"; then
   AC_DEFINE(MOZ_USE_NATIVE_POPUP_WINDOWS)
 fi
 
-if test -n "$MOZ_TREE_FREETYPE"; then
+if test -n "$MOZ_TREE_FREETYPE" -a "$OS_TARGET" != WINNT; then
    MOZ_ENABLE_CAIRO_FT=1
    FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
    CAIRO_FT_CFLAGS="-I$_topsrcdir/modules/freetype2/include"
    AC_SUBST_LIST(CAIRO_FT_CFLAGS)
 fi
 
 AC_CHECK_PROGS(WGET, wget, "")
 AC_SUBST(WGET)
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -322,45 +322,16 @@ def freetype2_combined_info(fontconfig_i
     return namespace(
         cflags=freetype2_info.cflags + fontconfig_info.cflags,
         libs=freetype2_info.libs + fontconfig_info.libs,
     )
 
 add_old_configure_assignment('_HAVE_FREETYPE2',
                              depends_if(freetype2_info)(lambda _: True))
 
-# Build Freetype in the tree
-# ==============================================================
-@depends(target)
-def tree_freetype(target):
-    if target.os == 'Android':
-        return True
-
-set_define('MOZ_TREE_FREETYPE', tree_freetype)
-set_config('MOZ_TREE_FREETYPE', tree_freetype)
-add_old_configure_assignment('MOZ_TREE_FREETYPE', tree_freetype)
-
-set_define('HAVE_FT_BITMAP_SIZE_Y_PPEM', tree_freetype)
-set_define('HAVE_FT_GLYPHSLOT_EMBOLDEN', tree_freetype)
-set_define('HAVE_FT_LOAD_SFNT_TABLE', tree_freetype)
-
-@depends(freetype2_combined_info, tree_freetype, check_build_environment)
-def ft2_info(freetype2_combined_info, tree_freetype, build_env):
-    if tree_freetype:
-        return namespace(cflags=('-I%s/modules/freetype2/include' % build_env.topsrcdir,),
-                         libs=())
-    if freetype2_combined_info:
-        return freetype2_combined_info
-
-set_config('FT2_LIBS', ft2_info.libs)
-add_old_configure_assignment('FT2_LIBS',
-                             ft2_info.libs)
-add_old_configure_assignment('FT2_CFLAGS',
-                             ft2_info.cflags)
-
 # Apple platform decoder support
 # ==============================================================
 @depends(toolkit)
 def applemedia(toolkit):
     if toolkit in ('cocoa', 'uikit'):
         return True
 
 set_config('MOZ_APPLEMEDIA', applemedia)
@@ -1047,16 +1018,45 @@ def skia_includes(skia, skia_gpu):
             '/gfx/skia/skia/include/gpu',
             '/gfx/skia/skia/include/utils',
         ]
 
     return includes
 
 set_config('SKIA_INCLUDES', skia_includes)
 
+# Build Freetype in the tree
+# ==============================================================
+@depends(target, skia_pdf)
+def tree_freetype(target, skia_pdf):
+    if target.os == 'Android' or (skia_pdf and target.os == 'WINNT'):
+        return True
+
+set_define('MOZ_TREE_FREETYPE', tree_freetype)
+set_config('MOZ_TREE_FREETYPE', tree_freetype)
+add_old_configure_assignment('MOZ_TREE_FREETYPE', tree_freetype)
+
+set_define('HAVE_FT_BITMAP_SIZE_Y_PPEM', tree_freetype)
+set_define('HAVE_FT_GLYPHSLOT_EMBOLDEN', tree_freetype)
+set_define('HAVE_FT_LOAD_SFNT_TABLE', tree_freetype)
+
+@depends(freetype2_combined_info, tree_freetype, check_build_environment)
+def ft2_info(freetype2_combined_info, tree_freetype, build_env):
+    if tree_freetype:
+        return namespace(cflags=('-I%s/modules/freetype2/include' % build_env.topsrcdir,),
+                         libs=())
+    if freetype2_combined_info:
+        return freetype2_combined_info
+
+set_config('FT2_LIBS', ft2_info.libs)
+add_old_configure_assignment('FT2_LIBS',
+                             ft2_info.libs)
+add_old_configure_assignment('FT2_CFLAGS',
+                             ft2_info.cflags)
+
 # Mortar
 # ==============================================================
 option('--enable-mortar', help='Enable mortar extension')
 
 set_config('MOZ_MORTAR', True, when='--enable-mortar')
 
 # Marionette remote protocol
 # ==============================================================