changeset 3252:48b0d729d9f7

Added test for freetype2 to Xft check
author unexist
date Fri, 07 Apr 2017 12:57:56 +0200
parents 9ed18c89b96c
children e93d62840c08
files Rakefile
diffstat 1 files changed, 27 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/Rakefile	Fri Apr 07 12:57:22 2017 +0200
+++ b/Rakefile	Fri Apr 07 12:57:56 2017 +0200
@@ -3,7 +3,7 @@
 # @package subtle
 #
 # @file Rake build file
-# @copyright (c) 2005-2013 Christoph Kappel <unexist@subforge.org>
+# @copyright (c) 2005-2017 Christoph Kappel <unexist@subforge.org>
 # @version $Id$
 #
 # This program can be distributed under the terms of the GNU GPL.
@@ -393,29 +393,35 @@
 
     # Check pkg-config for Xft
     if "yes" == @options["xft"]
-      checking_for("X11/Xft/Xft.h") do
-        ret = false
-
-        cflags, ldflags, libs = pkg_config("xft")
-
-        # Fix a bug in ruby 2.2.0 (https://bugs.ruby-lang.org/issues/10651)
-        if cflags.empty?
-          cflags << `#{$PKGCONFIG} --cflags xft`.chomp
-        end
+      {
+        "freetype": "freetype2/ftbuild.h",
+        "xft":      "X11/Xft/Xft.h"
+      }.each do |pkg, header|
+        checking_for(header) do
+          ret = false
 
-        unless libs.nil?
-          # Update flags
-          @options["cpppath"] << " %s" % [ cflags ]
-          @options["ldflags"] << " %s %s" % [ ldflags, libs ]
-          @options["extflags"] << " %s %s" % [ ldflags, libs ]
+          cflags, ldflags, libs = pkg_config(pkg)
 
-          $defs.push("-DHAVE_X11_XFT_XFT_H")
-          ret = true
-        else
-          @options["xft"] = "no"
+          # Fix a bug in ruby 2.2.0 (https://bugs.ruby-lang.org/issues/10651)
+          if cflags.empty?
+            cflags << `#{$PKGCONFIG} --cflags xft`.chomp
+          end
+
+          unless libs.nil?
+            # Update flags
+            @options["cpppath"] << " %s" % [ cflags ]
+            @options["ldflags"] << " %s %s" % [ ldflags, libs ]
+            @options["extflags"] << " %s %s" % [ ldflags, libs ]
+
+            $defs.push("-DHAVE_X11_XFT_XFT_H")
+            ret = true
+          else
+            @options["xft"] = "no"
+          end
+
+          ret
+
         end
-
-        ret
       end
     end