summaryrefslogtreecommitdiff
blob: dc6dd41bccb61050d3d1a67876d029c8eb118669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 3f37592025333532e98bbe96c2b0903bb881b9c0 Mon Sep 17 00:00:00 2001
From: Lars Wendler <polynomial-c@gentoo.org>
Date: Fri, 11 May 2018 23:21:33 +0200
Subject: [PATCH] Use pkg-config to find freetype

As of freetype-2.9.1 the freetype-config file no longer gets installed
by default.
---
 configure.ac | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0c452ad..96a51e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,6 +12,7 @@ AC_LANG_CPLUSPLUS
 AC_PROG_CXX
 AC_PROG_CC
 AC_PROG_INSTALL
+PKG_PROG_PKG_CONFIG
 
 # Checks for mandatory libraries
 AC_CHECK_LIB([X11], [XOpenDisplay], , AC_MSG_ERROR([libX11 not found]))
@@ -47,15 +48,9 @@ AC_ARG_ENABLE(
 
 # Checks for Freetype
 if test "x$XFT" = "xtrue"; then
-	AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
-
-	if test x$FREETYPE_CONFIG = xno; then
-		AC_MSG_ERROR([*** freetype-config not found])
-	fi
-
-	FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags`"
-	FREETYPE_LIBS="`$FREETYPE_CONFIG --libs`"
-	CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS"
+	PKG_CHECK_MODULES(FREETYPE, freetype2, [
+		CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS"
+	], AC_MSG_ERROR([Cannot find freetype]))
 fi
 
 # Checks for Xrender
-- 
2.17.0