[gtk/backport-font-feature-pango-hb: 7/10] configure.ac: Check for Pango 1.44.0 or later




commit 720e335246531bf1a9e59745d9721638ac92ba64
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Nov 25 18:30:02 2021 +0800

    configure.ac: Check for Pango 1.44.0 or later
    
    ...and HarfBuzz 2.2.0 or later so that we can enable the font feature
    demo even if we do not have PangoFT2.

 configure.ac | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5830d962fd..412ddbf6d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1395,17 +1395,35 @@ fi
 ##################################################
 # Check for harfbuzz and pangoft2
 ##################################################
-
 PKG_CHECK_MODULES(GTK_FONT_CHOOSER_WIDGET,
-                  harfbuzz >= 0.9 pangoft2,
+                  harfbuzz >= 2.2.0 pango >= 1.44.0,
                   build_font_demo=yes,
                   build_font_demo=no)
+
+PKG_CHECK_MODULES(GTK_FONT_CHOOSER_WIDGET_FT,
+                  harfbuzz >= 0.9 pangoft2,
+                  build_font_demo_ft=yes,
+                  build_font_demo_ft=no)
+
+if test "x$build_font_demo" = xno; then
+  if test "x$build_font_demo_ft" = xyes; then
+    build_font_demo=yes
+  else
+    build_font_demo=no
+  fi
+fi
+
 AM_CONDITIONAL(BUILD_FONT_DEMO, [ test "x$build_font_demo" = xyes ])
 if test "x$build_font_demo" = xyes; then
   AC_DEFINE([HAVE_HARFBUZZ], 1, [defines whether we have HarfBuzz])
-  AC_DEFINE([HAVE_PANGOFT], 1, [defines whether we have pangoft2])
-  GTK_DEP_CFLAGS="$GTK_DEP_CFLAGS $GTK_FONT_CHOOSER_WIDGET_CFLAGS"
-  GTK_DEP_LIBS="$GTK_DEP_LIBS $GTK_FONT_CHOOSER_WIDGET_LIBS"
+  if test "x$build_font_demo_ft" = xyes; then
+    AC_DEFINE([HAVE_PANGOFT], 1, [defines whether we have pangoft2])
+    GTK_DEP_CFLAGS="$GTK_DEP_CFLAGS $GTK_FONT_CHOOSER_WIDGET_FT_CFLAGS"
+    GTK_DEP_LIBS="$GTK_DEP_LIBS $GTK_FONT_CHOOSER_WIDGET_FT_LIBS"
+  else
+    GTK_DEP_CFLAGS="$GTK_DEP_CFLAGS $GTK_FONT_CHOOSER_WIDGET_CFLAGS"
+    GTK_DEP_LIBS="$GTK_DEP_LIBS $GTK_FONT_CHOOSER_WIDGET_LIBS"
+  fi
 fi
 
 if $PKG_CONFIG --exists x11; then


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]