summaryrefslogtreecommitdiff
blob: 534a32e9ef7c30059559fc11a7e5ddccd505c07a (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
https://bugs.gentoo.org/788136

--- xplanet-1.3.1/acinclude.m4
+++ xplanet-1.3.1/acinclude.m4
@@ -48,23 +48,22 @@
 
 AC_DEFUN([AC_FIND_FREETYPE],
 [
-
+PKG_PROG_PKG_CONFIG
 AC_ARG_WITH(freetype,AC_HELP_STRING([--with-freetype],[Enable Freetype support for TrueType fonts (YES)]))
 
 have_freetype='no'
-if test "$with_freetype" != 'no'; then
-  AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
-  if test "$FREETYPE_CONFIG" = no; then
-    AC_MSG_WARN(*** Xplanet will be built without freetype support ***)
-  else
-    FREETYPE_CFLAGS="`$FREETYPE_CONFIG --cflags` -I`$FREETYPE_CONFIG --prefix`/include"
-    FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
-    AC_SUBST(FREETYPE_CFLAGS)
-    AC_SUBST(FREETYPE_LIBS)
-    AC_DEFINE(HAVE_LIBFREETYPE,,Define if you have freetype)
+AS_IF([test "$with_freetype" != 'no'], [
+  PKG_CHECK_MODULES([FREETYPE], [freetype2], [
+    AC_DEFINE([HAVE_LIBFREETYPE],,[Define if you have freetype])
     have_freetype='yes'
-  fi
-fi
+  ], [
+    AS_IF([test "$with_freetype" != 'yes'], [
+      AC_MSG_WARN(*** Xplanet will be built without freetype support ***)
+    ], [
+      AC_MSG_ERROR(*** freetype support requested but not found ***)
+    ])
+  ])
+])
 ])
 
 AC_DEFUN([AC_FIND_PANGO],