diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure index 843de98fd590..aacfa8009c4f 100644 --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -234,7 +234,6 @@ def old_configure_options(*options): '--enable-tasktracer', '--enable-thread-sanitizer', '--enable-trace-logging', - '--enable-tree-freetype', '--enable-ui-locale', '--enable-universalchardet', '--enable-updater', diff --git a/old-configure.in b/old-configure.in index d196a0885088..1347c408e213 100644 --- a/old-configure.in +++ b/old-configure.in @@ -2359,7 +2359,6 @@ esac case "${target}" in *-android*|*-linuxandroid*) MOZ_THEME_FASTSTRIPE=1 - MOZ_TREE_FREETYPE=1 MOZ_RAW=1 ;; @@ -3854,33 +3853,13 @@ 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) @@ -5136,7 +5115,7 @@ if test "$USE_FC_FREETYPE"; 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" @@ -5284,8 +5263,6 @@ if test "$MOZ_TREE_CAIRO"; then 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 diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 80c3a3976b6c..54a7ddbe3b60 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -307,11 +307,35 @@ def freetype2_combined_info(fontconfig_info, freetype2_info): add_old_configure_assignment('_HAVE_FREETYPE2', depends_if(freetype2_info)(lambda _: True)) -add_old_configure_assignment('FT2_LIBS', - delayed_getattr(freetype2_combined_info, 'libs')) -add_old_configure_assignment('FT2_CFLAGS', - delayed_getattr(freetype2_combined_info, 'cflags')) +# 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(ft2_info, 'libs')) +add_old_configure_assignment('FT2_CFLAGS', + delayed_getattr(ft2_info, 'cflags')) # Apple platform decoder support # ==============================================================