1 From 61655f82224cadb261e81f8bae111eaaa7bdf531 Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Wed, 6 Aug 2014 14:53:03 +0200
4 Subject: [PATCH] configure: use pkg-config for freetype
6 Upstream-status: Pending
7 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
9 configure.ac | 37 ++++++++-----------------------------
10 1 file changed, 8 insertions(+), 29 deletions(-)
12 diff --git a/configure.ac b/configure.ac
13 index 3cfe974..0055a8c 100644
16 @@ -399,40 +399,19 @@ AC_ARG_WITH(freetype,[ --with-freetype=DIR use freetype2 in DIR],[
20 -if [ test -n "$FREETYPE_DIR" ]; then
21 - AC_PATH_PROG(FREETYPE_CONFIG,freetype-config, ,[$FREETYPE_DIR/bin:$PATH])
23 - AC_PATH_PROG(FREETYPE_CONFIG,freetype-config)
26 -if [ test -n "$FREETYPE_CONFIG" ]; then
27 - if [ test -n "$FREETYPE_DIR" ]; then
28 - freetype_cflags="`$FREETYPE_CONFIG --cflags` -I$FREETYPE_DIR/include"
29 - freetype_libs=`$FREETYPE_CONFIG --libs`
31 - freetype_cflags=`$FREETYPE_CONFIG --cflags`
32 - freetype_libs=`$FREETYPE_CONFIG --libs`
35 - if [ test -n "$FREETYPE_DIR" ]; then
36 - freetype_cflags="-I$FREETYPE_DIR/include/freetype2 -I$FREETYPE_DIR/include"
37 - freetype_libs="-L$FREETYPE_DIR/lib -lfreetype"
40 - freetype_libs="-lfreetype"
44 -CPPFLAGS="$freetype_cflags $CPPFLAGS"
45 -LDFLAGS="$LDFLAGS $freetype_libs"
46 +PKG_CHECK_MODULES(FREETYPE2, freetype2,
47 + CFLAGS="$CFLAGS $FREETYPE2_CFLAGS"
48 + LDFLAGS="$LDFLAGS $FREETYPE2_LIBS",
49 + AC_MSG_ERROR([*** Unable to find FreeType2 library (http://www.freetype.org/)])
52 AC_CHECK_LIB(freetype,FT_Init_FreeType,[
53 - WMF_FT_LDFLAGS="$freetype_libs"
54 + WMF_FT_LDFLAGS="$FREETYPE2_LIBS"
55 ],[ AC_MSG_ERROR([* * * freetype(2) is required * * *])
57 AC_CHECK_HEADER(ft2build.h,[
58 - WMF_FT_CFLAGS="$freetype_cflags"
59 - WMF_FT_CONFIG_CFLAGS="$freetype_cflags"
60 + WMF_FT_CFLAGS="$FREETYPE2_CFLAGS"
61 + WMF_FT_CONFIG_CFLAGS="$FREETYPE2_CFLAGS"
62 ],[ AC_MSG_ERROR([* * * freetype(2) is required * * *])