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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
Description: Use pkg-config to find freetype2
Author: Stephen Kitt <skitt@debian.org>
--- a/configure
+++ b/configure
@@ -201,7 +201,6 @@
_sparklepath=
_sdlconfig=sdl2-config
_libcurlconfig=curl-config
-_freetypeconfig=freetype-config
_sdlpath="$PATH"
_freetypepath="$PATH"
_libcurlpath="$PATH"
@@ -417,40 +416,6 @@
}
#
-# Determine freetype-config
-#
-find_freetypeconfig() {
- echo_n "Looking for freetype-config... "
- freetypeconfigs="$_freetypeconfig"
- _freetypeconfig=
-
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$SEPARATOR"
- for path_dir in $_freetypepath; do
- #reset separator to parse freetypeconfigs
- IFS=":"
- for freetypeconfig in $freetypeconfigs; do
- if test -f "$path_dir/$freetypeconfig" ; then
- _freetypeconfig="$path_dir/$freetypeconfig"
- echo $_freetypeconfig
- # Save the prefix
- _freetypepath=$path_dir
- if test `basename $path_dir` = bin ; then
- _freetypepath=`dirname $path_dir`
- fi
- # break at first freetype-config found in path
- break 2
- fi
- done
- done
-
- IFS="$ac_save_ifs"
-
- if test -z "$_freetypeconfig"; then
- echo "none found!"
- fi
-}
-
-#
# Determine curl-config
#
find_libcurlconfig() {
@@ -4602,30 +4567,13 @@
#
if test "$_freetype2" != "no"; then
- # Look for the freetype-config script
- find_freetypeconfig
+ FREETYPE2_LIBS=`pkg-config --libs freetype2`
+ FREETYPE2_CFLAGS=`pkg-config --cflags freetype2`
- if test -z "$_freetypeconfig"; then
+ if test "$_freetype2" = "auto"; then
_freetype2=no
- else
- # Since 2.3.12, freetype-config prepends $SYSROOT to everything.
- # This means we can't pass it a --prefix that includes $SYSROOT.
- freetypeprefix="$_freetypepath"
- if test -n "$SYSROOT" -a "$SYSROOT" != "/"; then
- teststring=VeryImplausibleSysrootX1Y2Z3
- if ( env SYSROOT=/$teststring "$_freetypeconfig" --cflags | grep $teststring 2> /dev/null > /dev/null ); then
- echo "Adapting FreeType prefix to SYSROOT" >> "$TMPLOG"
- freetypeprefix="${freetypeprefix##$SYSROOT}"
- fi
- fi
-
- FREETYPE2_LIBS=`$_freetypeconfig --prefix="$freetypeprefix" --libs`
- FREETYPE2_CFLAGS=`$_freetypeconfig --prefix="$freetypeprefix" --cflags`
-
- if test "$_freetype2" = "auto"; then
- _freetype2=no
- cat > $TMPC << EOF
+ cat > $TMPC << EOF
#include <ft2build.h>
#include FT_FREETYPE_H
@@ -4636,23 +4584,21 @@
}
EOF
+ cc_check_no_clean $FREETYPE2_CFLAGS $FREETYPE2_LIBS && _freetype2=yes
+ # Modern freetype-config scripts accept --static to get all
+ # required flags for static linking. We abuse this to detect
+ # FreeType2 builds which are static themselves.
+ if test "$_freetype2" != "yes"; then
+ FREETYPE2_LIBS=`pkg-config --static --libs freetype2 2>/dev/null`
cc_check_no_clean $FREETYPE2_CFLAGS $FREETYPE2_LIBS && _freetype2=yes
- # Modern freetype-config scripts accept --static to get all
- # required flags for static linking. We abuse this to detect
- # FreeType2 builds which are static themselves.
- if test "$_freetype2" != "yes"; then
- FREETYPE2_LIBS=`$_freetypeconfig --prefix="$_freetypepath" --static --libs 2>/dev/null`
- cc_check_no_clean $FREETYPE2_CFLAGS $FREETYPE2_LIBS && _freetype2=yes
- fi
- cc_check_clean
- fi
-
- if test "$_freetype2" = "yes"; then
- append_var LIBS "$FREETYPE2_LIBS"
- append_var INCLUDES "$FREETYPE2_CFLAGS"
fi
+ cc_check_clean
fi
+ if test "$_freetype2" = "yes"; then
+ append_var LIBS "$FREETYPE2_LIBS"
+ append_var INCLUDES "$FREETYPE2_CFLAGS"
+ fi
fi
echocheck "FreeType2"
|