Bug 1305145 - Move fontconfig detection to Python configure. draft
authorChris Manchester <cmanchester@mozilla.com>
Thu, 06 Oct 2016 11:58:52 -0700
changeset 421742 b68870f0fc1357b8b8f1caf6ee9dbc839a0f0777
parent 421741 ce634b2c583b1e3ad550971e77ce5280b2c580d2
child 421743 da4e907b6e07f1c0a44299c8c89857a627dd5e24
push id31579
push userbmo:cmanchester@mozilla.com
push dateThu, 06 Oct 2016 18:59:13 +0000
bugs1305145
milestone52.0a1
Bug 1305145 - Move fontconfig detection to Python configure. MozReview-Commit-ID: J6XQFA6whCr
old-configure.in
toolkit/moz.configure
--- a/old-configure.in
+++ b/old-configure.in
@@ -64,17 +64,16 @@ GTK3_VERSION=3.4.0
 GDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4
 WINDRES_VERSION=2.14.90
 W32API_VERSION=3.14
 GNOMEUI_VERSION=2.2.0
 GCONF_VERSION=1.2.1
 STARTUP_NOTIFICATION_VERSION=0.8
 DBUS_VERSION=0.60
 SQLITE_VERSION=3.14.1
-FONTCONFIG_VERSION=2.7.0
 
 dnl Set various checks
 dnl ========================================================
 MISSING_X=
 
 dnl Initialize the Pthread test variables early so they can be
 dnl  overridden by each platform.
 dnl ========================================================
@@ -5174,21 +5173,18 @@ if test "$USE_FC_FREETYPE"; then
         CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
         MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], ,
             [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include <fontconfig/fontconfig.h>])
         CPPFLAGS="$_SAVE_CPPFLAGS"
     else
         AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
     fi
 
-    PKG_CHECK_MODULES(_FONTCONFIG, fontconfig >= $FONTCONFIG_VERSION,
-    [
-        FT2_CFLAGS="$FT2_CFLAGS $_FONTCONFIG_CFLAGS"
-        FT2_LIBS="$FT2_LIBS $_FONTCONFIG_LIBS"
-    ])
+    FT2_CFLAGS="$FT2_CFLAGS $_FONTCONFIG_CFLAGS"
+    FT2_LIBS="$FT2_LIBS $_FONTCONFIG_LIBS"
 fi
 
 dnl ========================================================
 dnl Check for pixman and cairo
 dnl ========================================================
 
 MOZ_TREE_CAIRO=1
 MOZ_ARG_ENABLE_BOOL(system-cairo,
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -275,16 +275,27 @@ def fc_freetype(value, toolkit):
 add_old_configure_assignment('USE_FC_FREETYPE', fc_freetype)
 
 # Pango
 # ==============================================================
 pkg_check_modules('MOZ_PANGO',
                   'pango >= 1.22.0 pangoft2 >= 1.22.0 pangocairo >= 1.22.0',
                   when=toolkit_gtk)
 
+# Fontconfig
+# ==============================================================
+fontconfig_info = pkg_check_modules('_FONTCONFIG', 'fontconfig >= 2.7.0',
+                                    when=fc_freetype)
+
+add_old_configure_assignment('_FONTCONFIG_CFLAGS',
+                             delayed_getattr(fontconfig_info, 'cflags'))
+add_old_configure_assignment('_FONTCONFIG_LIBS',
+                             delayed_getattr(fontconfig_info, 'libs'))
+
+
 # Apple platform decoder support
 # ==============================================================
 @depends(toolkit)
 def applemedia(toolkit):
     if toolkit in ('cocoa', 'uikit'):
         return True
 
 set_config('MOZ_APPLEMEDIA', applemedia)