Commit 67bbcbd72d025513091026a07125a82ff59b09d4

Werner Lemberg 2009-02-04T07:59:16

Fix Savannah bug #25480. * builds/unix/freetype-config.in: For --ftversion, don't use $prefix but $includedir.

diff --git a/ChangeLog b/ChangeLog
index 8a9dbb4..dc5e308 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-02-04  Werner Lemberg  <wl@gnu.org>
+
+	Fix Savannah bug #25480.
+
+	* builds/unix/freetype-config.in: For --ftversion, don't use $prefix
+	but $includedir.
+
 2009-01-31  Werner Lemberg  <wl@gnu.org>
 
 	Minor docmaker improvements.
diff --git a/builds/unix/freetype-config.in b/builds/unix/freetype-config.in
index a343522..9606d31 100644
--- a/builds/unix/freetype-config.in
+++ b/builds/unix/freetype-config.in
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2008 by
+# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009 by
 # David Turner, Robert Wilhelm, and Werner Lemberg.
 #
 # This file is part of the FreeType project, and may only be used, modified,
@@ -76,17 +76,7 @@ while test $# -gt 0 ; do
     exit 0
     ;;
   --ftversion)
-    major=`grep define @prefix@/include/freetype2/freetype/freetype.h \
-           | grep FREETYPE_MAJOR \
-           | sed 's/.*[ 	]\([0-9][0-9]*\).*/\1/'`
-    minor=`grep define @prefix@/include/freetype2/freetype/freetype.h \
-           | grep FREETYPE_MINOR \
-           | sed 's/.*[ 	]\([0-9][0-9]*\).*/\1/'`
-    patch=`grep define @prefix@/include/freetype2/freetype/freetype.h \
-           | grep FREETYPE_PATCH \
-           | sed 's/.*[ 	]\([0-9][0-9]*\).*/\1/'`
-    echo $major.$minor.$patch
-    exit 0
+    echo_ft_version=yes
     ;;
   --cflags)
     echo_cflags=yes
@@ -127,6 +117,19 @@ else
   fi
 fi
 
+if test "$echo_ft_version" = "yes" ; then
+  major=`grep define $includedir/freetype2/freetype/freetype.h \
+         | grep FREETYPE_MAJOR \
+         | sed 's/.*[ 	]\([0-9][0-9]*\).*/\1/'`
+  minor=`grep define $includedir/freetype2/freetype/freetype.h \
+         | grep FREETYPE_MINOR \
+         | sed 's/.*[ 	]\([0-9][0-9]*\).*/\1/'`
+  patch=`grep define $includedir/freetype2/freetype/freetype.h \
+         | grep FREETYPE_PATCH \
+         | sed 's/.*[ 	]\([0-9][0-9]*\).*/\1/'`
+  echo $major.$minor.$patch
+fi
+
 if test "$echo_cflags" = "yes" ; then
   cflags="-I$includedir/freetype2"
   if test "$includedir" != "/usr/include" ; then