Bug 1305145 - Move --enable-tree-freetype to Python configure. r=glandium
☠☠ backed out by acee3d0166dc ☠ ☠
authorChris Manchester <cmanchester@mozilla.com>
Fri, 14 Oct 2016 11:06:31 -0700
changeset 318109 0f39b7305d41a70759f6cae8571fba860a0d3b65
parent 318108 ab38e43fdcb6cb9e0d63fb4f4a7de7f30ab8accc
child 318110 99a36fecb7ab1c6dc56647ec17cd0862ff57fe59
push id20713
push usercbook@mozilla.com
push dateMon, 17 Oct 2016 09:37:24 +0000
treeherderfx-team@94b0fddf96b4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1305145
milestone52.0a1
Bug 1305145 - Move --enable-tree-freetype to Python configure. r=glandium This commit also removes the option, as it's only known to work on Android, where it is the default. MozReview-Commit-ID: JqdC5Q5dwQH
build/moz.configure/old.configure
old-configure.in
toolkit/moz.configure
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -229,17 +229,16 @@ def old_configure_options(*options):
     '--enable-synth-pico',
     '--enable-system-cairo',
     '--enable-system-extension-dirs',
     '--enable-system-pixman',
     '--enable-system-sqlite',
     '--enable-tasktracer',
     '--enable-thread-sanitizer',
     '--enable-trace-logging',
-    '--enable-tree-freetype',
     '--enable-ui-locale',
     '--enable-universalchardet',
     '--enable-updater',
     '--enable-url-classifier',
     '--enable-valgrind',
     '--enable-verify-mar',
     '--enable-webrtc',
     '--enable-xul',
--- a/old-configure.in
+++ b/old-configure.in
@@ -2354,17 +2354,16 @@ case "$target_os" in
         NS_ENABLE_TSF=1
         AC_DEFINE(NS_ENABLE_TSF)
         ;;
 esac
 
 case "${target}" in
     *-android*|*-linuxandroid*)
         MOZ_THEME_FASTSTRIPE=1
-        MOZ_TREE_FREETYPE=1
         MOZ_RAW=1
         ;;
 
 esac
 
 # Optional Firefox for Android partner distribution directory.
 MOZ_ARG_WITH_STRING(android-distribution-directory,
 [  --with-android-distribution-directory=dir
@@ -3849,43 +3848,23 @@ 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
 
-dnl ========================================================
-dnl Build Freetype in the tree
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(tree-freetype,
-[  --enable-tree-freetype  Enable Tree FreeType],
-    MOZ_TREE_FREETYPE=1,
-    MOZ_TREE_FREETYPE= )
 if test -n "$MOZ_TREE_FREETYPE"; then
-   if test -n "$_WIN32_MSVC"; then
-      AC_ERROR("building with in-tree freetype is not supported on MSVC")
-   fi
-   AC_DEFINE(MOZ_TREE_FREETYPE)
-   AC_SUBST(MOZ_TREE_FREETYPE)
    MOZ_ENABLE_CAIRO_FT=1
    FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
-   FT2_CFLAGS="-I$_topsrcdir/modules/freetype2/include"
    CAIRO_FT_CFLAGS="-I$_topsrcdir/modules/freetype2/include"
-   CAIRO_FT_OSLIBS=''
-   AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
-   AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
-   AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
    AC_SUBST_LIST(CAIRO_FT_CFLAGS)
 fi
 
-AC_SUBST_LIST(FT2_CFLAGS)
-AC_SUBST_LIST(FT2_LIBS)
-
 AC_CHECK_PROGS(WGET, wget, "")
 AC_SUBST(WGET)
 
 dnl ========================================================
 dnl Maintenance Service
 dnl ========================================================
 
 MOZ_ARG_ENABLE_BOOL(maintenance-service,
@@ -5131,17 +5110,17 @@ fi
 
 AC_SUBST_LIST(GLIB_GMODULE_LIBS)
 
 if test "$USE_FC_FREETYPE"; then
     if test "$COMPILE_ENVIRONMENT"; then
         dnl ========================================================
         dnl = Check for freetype2 functionality
         dnl ========================================================
-        if test "$_HAVE_FREETYPE2"; then
+        if test "$_HAVE_FREETYPE2" -a -z "$MOZ_TREE_FREETYPE"; then
             _SAVE_LIBS="$LIBS"
             _SAVE_CFLAGS="$CFLAGS"
             LIBS="$LIBS $FT2_LIBS"
             CFLAGS="$CFLAGS $FT2_CFLAGS"
 
             AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
                 ac_cv_member_FT_Bitmap_Size_y_ppem,
                 [AC_TRY_COMPILE([#include <ft2build.h>
@@ -5279,18 +5258,16 @@ if test "$MOZ_TREE_CAIRO"; then
     AC_SUBST(WIN32_FONT_FEATURE)
     AC_SUBST(WIN32_DWRITE_FONT_FEATURE)
     AC_SUBST(WIN32_D2D_SURFACE_FEATURE)
     AC_SUBST(QUARTZ_FONT_FEATURE)
     AC_SUBST(PNG_FUNCTIONS_FEATURE)
     AC_SUBST(QT_SURFACE_FEATURE)
     AC_SUBST(TEE_SURFACE_FEATURE)
 
-    MOZ_CAIRO_OSLIBS='${CAIRO_FT_OSLIBS}'
-
     if test "$MOZ_X11"; then
         MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXrender"
     fi
 
     CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
 else
     PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION)
     MOZ_CAIRO_CFLAGS="$CAIRO_CFLAGS"
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -302,21 +302,45 @@ def freetype2_combined_info(fontconfig_i
         return freetype2_info
     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', delayed_getattr(ft2_info, 'libs'))
 add_old_configure_assignment('FT2_LIBS',
-                             delayed_getattr(freetype2_combined_info, 'libs'))
+                             delayed_getattr(ft2_info, 'libs'))
 add_old_configure_assignment('FT2_CFLAGS',
-                             delayed_getattr(freetype2_combined_info, 'cflags'))
-
+                             delayed_getattr(ft2_info, 'cflags'))
 
 # Apple platform decoder support
 # ==============================================================
 @depends(toolkit)
 def applemedia(toolkit):
     if toolkit in ('cocoa', 'uikit'):
         return True