aboutsummaryrefslogtreecommitdiffstats
path: root/community/libwmf/freetype.patch
blob: 44cab47cfa6e3a6bf537192717e7af48d205e878 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From 61655f82224cadb261e81f8bae111eaaa7bdf531 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Wed, 6 Aug 2014 14:53:03 +0200
Subject: [PATCH] configure: use pkg-config for freetype

Upstream-status: Pending
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 configure.ac | 37 ++++++++-----------------------------
 1 file changed, 8 insertions(+), 29 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3cfe974..0055a8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -399,40 +399,19 @@ AC_ARG_WITH(freetype,[  --with-freetype=DIR     use freetype2 in DIR],[
 	fi
 ])
 
-if [ test -n "$FREETYPE_DIR" ]; then
-	AC_PATH_PROG(FREETYPE_CONFIG,freetype-config, ,[$FREETYPE_DIR/bin:$PATH])
-else
-	AC_PATH_PROG(FREETYPE_CONFIG,freetype-config)
-fi
-
-if [ test -n "$FREETYPE_CONFIG" ]; then
-	if [ test -n "$FREETYPE_DIR" ]; then
-		freetype_cflags="`$FREETYPE_CONFIG --cflags` -I$FREETYPE_DIR/include"
-		freetype_libs=`$FREETYPE_CONFIG --libs`
-	else
-		freetype_cflags=`$FREETYPE_CONFIG --cflags`
-		freetype_libs=`$FREETYPE_CONFIG --libs`
-	fi
-else
-	if [ test -n "$FREETYPE_DIR" ]; then
-		freetype_cflags="-I$FREETYPE_DIR/include/freetype2 -I$FREETYPE_DIR/include"
-		freetype_libs="-L$FREETYPE_DIR/lib -lfreetype"
-	else
-		freetype_cflags=""
-		freetype_libs="-lfreetype"
-	fi
-fi
-
-CPPFLAGS="$freetype_cflags $CPPFLAGS"
-LDFLAGS="$LDFLAGS $freetype_libs"
+PKG_CHECK_MODULES(FREETYPE2, freetype2, 
+    CFLAGS="$CFLAGS $FREETYPE2_CFLAGS"
+    LDFLAGS="$LDFLAGS $FREETYPE2_LIBS",
+    AC_MSG_ERROR([*** Unable to find FreeType2 library (http://www.freetype.org/)])
+)
 
 AC_CHECK_LIB(freetype,FT_Init_FreeType,[
-	WMF_FT_LDFLAGS="$freetype_libs"
+	WMF_FT_LDFLAGS="$FREETYPE2_LIBS"
 ],[	AC_MSG_ERROR([* * * freetype(2) is required * * *])
 ])
 AC_CHECK_HEADER(ft2build.h,[
-	WMF_FT_CFLAGS="$freetype_cflags"
-	WMF_FT_CONFIG_CFLAGS="$freetype_cflags"
+	WMF_FT_CFLAGS="$FREETYPE2_CFLAGS"
+	WMF_FT_CONFIG_CFLAGS="$FREETYPE2_CFLAGS"
 ],[	AC_MSG_ERROR([* * * freetype(2) is required * * *])
 ])