Bug 1305145 - Move --enable-tree-freetype to Python configure. r=glandium
authorChris Manchester <cmanchester@mozilla.com>
Fri, 14 Oct 2016 11:06:31 -0700
changeset 319469 074a25a74513493b327b8c7323246eb583b8935d
parent 319468 794ce41590cdaaa6489c72380db04935131dc590
child 319470 9476f6056e4b121aa969dc3b4e72a336e4ac1188
push id30871
push usercbook@mozilla.com
push dateWed, 26 Oct 2016 14:54:32 +0000
treeherdermozilla-central@d26ac63f1b81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1305145
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
@@ -225,17 +225,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
@@ -2336,17 +2336,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
@@ -3812,43 +3811,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,
@@ -5062,17 +5041,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>
@@ -5210,18 +5189,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