Kevin Kofler 9f8dafb
diff -ur qt-x11-free-3.3.8b/config.tests/x11/xfreetype.test qt-x11-free-3.3.8b-freetype251/config.tests/x11/xfreetype.test
Kevin Kofler 9f8dafb
--- qt-x11-free-3.3.8b/config.tests/x11/xfreetype.test	2008-01-15 20:09:15.000000000 +0100
Kevin Kofler 9f8dafb
+++ qt-x11-free-3.3.8b-freetype251/config.tests/x11/xfreetype.test	2014-02-23 19:22:02.000000000 +0100
Kevin Kofler 9f8dafb
@@ -116,33 +116,14 @@
Kevin Kofler 9f8dafb
 # check for freetype2 headers
Kevin Kofler 9f8dafb
 FREETYPE2_INCDIR=
Kevin Kofler 9f8dafb
 if [ "$XFT" = "yes" ]; then
Kevin Kofler 9f8dafb
-    INC="freetype2/freetype/freetype.h"
Kevin Kofler 9f8dafb
-    XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[	]*=/ { s/[^=]*=[	 ]*//; s/-I/ /g; p; }' $XCONFIG`
Kevin Kofler 9f8dafb
-    LDIRS=`sed -n -e '/^QMAKE_INCDIR[	]*=/ { s/[^=]*=[	 ]*//; s/-I/ /g; p; }' $XCONFIG`
Kevin Kofler 9f8dafb
-    INCDIRS="$IN_INCDIRS $XDIRS $LDIRS /usr/include /include"
Kevin Kofler 9f8dafb
-    F=
Kevin Kofler 9f8dafb
-    for INCDIR in $INCDIRS; do
Kevin Kofler 9f8dafb
-	if [ -f $INCDIR/$INC ]; then
Kevin Kofler 9f8dafb
-	    # detect major version of freetype2
Kevin Kofler 9f8dafb
-	    FREETYPE_MAJOR=`grep "#define FREETYPE_MAJOR" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`
Kevin Kofler 9f8dafb
-	    FREETYPE_MINOR=`grep "#define FREETYPE_MINOR" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`
Kevin Kofler 9f8dafb
-	    FREETYPE_PATCH=`grep "#define FREETYPE_PATCH" $INCDIR/$INC | head -n 1 | awk '{ print \$3 }'`
Kevin Kofler 9f8dafb
-	    test -z "$FREETYPE_PATCH" && FREETYPE_PATCH="0"
Kevin Kofler 9f8dafb
-	    [ "$VERBOSE" = "yes" ] && \
Kevin Kofler 9f8dafb
-		echo "  Found Freetype version $FREETYPE_MAJOR.$FREETYPE_MINOR.$FREETYPE_PATCH"
Kevin Kofler 9f8dafb
-	    if [ "$FREETYPE_MAJOR" -eq "2" ] \
Kevin Kofler 9f8dafb
-               && [ "$FREETYPE_MINOR" -ge "0" -a "$FREETYPE_PATCH" -ge "9" ] \
Kevin Kofler 9f8dafb
-               || [ "$FREETYPE_MINOR" -ge "1" ]; then
Kevin Kofler 9f8dafb
-		F=yes
Kevin Kofler 9f8dafb
-		FREETYPE2_INCDIR=$INCDIR/freetype2
Kevin Kofler 9f8dafb
-		[ "$VERBOSE" = "yes" ] && echo "  Found $INC in $INCDIR"
Kevin Kofler 9f8dafb
-		break
Kevin Kofler 9f8dafb
-	    fi
Kevin Kofler 9f8dafb
-	fi
Kevin Kofler 9f8dafb
-    done
Kevin Kofler 9f8dafb
-    if [ -z "$F" ]; then
Kevin Kofler 9f8dafb
-	XFT=no
Kevin Kofler 9f8dafb
-	[ "$VERBOSE" = "yes" ] && echo "  Could not find $INC anywhere in $INCDIRS"
Kevin Kofler 9f8dafb
+    # minimum is freetype 2.0.9, which had libtool version 6.3.0
Kevin Kofler 9f8dafb
+    if pkg-config --atleast-version=6.3.0 freetype2; then
Kevin Kofler 9f8dafb
+        [ "$VERBOSE" = "yes" ] && echo "  Found Freetype >= 2.0.9 using pkg-config"
Kevin Kofler 9f8dafb
+        FREETYPE2_INCDIR=`pkg-config --cflags-only-I freetype2 | sed -e 's/^-I//g' -e 's/ -I/ /g'`
Kevin Kofler 9f8dafb
+        [ "$VERBOSE" = "yes" ] && echo "  Freetype headers in $FREETYPE2_INCDIR"
Kevin Kofler 9f8dafb
+    else
Kevin Kofler 9f8dafb
+        XFT=no
Kevin Kofler 9f8dafb
+        [ "$VERBOSE" = "yes" ] && echo "  Could not find Freetype >= 2.0.9 using pkg-config"
Kevin Kofler 9f8dafb
     fi
Kevin Kofler 9f8dafb
 fi
Kevin Kofler 9f8dafb