Subject: Fix the 'fontconfig' package build failure by fixing 'freetype' (it causes the failure)

To use this patch, you will need a clean OSELAS.BSP-Phytec-phyCORE-11 BSP
directory.

To apply this patch change into the OSELAS.BSP-Phytec-phyCORE-11 directory
and enter:
~/OSELAS.BSP-Phytec-phyCORE-11 $ patch -p1 < <this file>

The main purpose of this patch is to make freetype more cross build aware.

Please apply this patch as the first one, if more than one patch for this
BSP release should exist.

Signed-off-by: Luotao Fu <lfu@pengutronix.de>
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>

Added: OSELAS.BSP-Phytec-phyCORE-11/patches/freetype-2.3.9/generic/builds_unix_freetype-config_in_sysroot.diff
===================================================================
--- OSELAS.BSP-Phytec-phyCORE-11/patches/freetype-2.3.9/generic/builds_unix_freetype-config_in_sysroot.diff
+++ OSELAS.BSP-Phytec-phyCORE-11/patches/freetype-2.3.9/generic/builds_unix_freetype-config_in_sysroot.diff
@@ -0,0 +1,87 @@
+#
+# Submitted-By: Marc Kleine-Budde, 2006-02-28
+# Committed-By: Marc Kleine-Budde
+#
+# Error:
+#
+# freetype-config is not $SYSROOT aware
+#
+# Description: 
+#
+# this patch adds $SYSROOT support to freetype-config
+#
+# State:
+# 
+# not commited, but should be :)
+#
+---
+# builds/unix/freetype-config.in |   22 +++++++++++-----------
+# 1 file changed, 11 insertions(+), 11 deletions(-)
+#
+Index: freetype-2.3.9/builds/unix/freetype-config.in
+===================================================================
+--- freetype-2.3.9.orig/builds/unix/freetype-config.in
++++ freetype-2.3.9/builds/unix/freetype-config.in
+@@ -101,11 +101,11 @@ if test "$local_prefix" = "yes" ; then
+ fi
+ 
+ if test "$echo_prefix" = "yes" ; then
+-  echo $prefix
++  echo ${SYSROOT}$prefix
+ fi
+ 
+ if test "$echo_exec_prefix" = "yes" ; then
+-  echo $exec_prefix
++  echo ${SYSROOT}$exec_prefix
+ fi
+ 
+ if test "$exec_prefix_set" = "yes" ; then
+@@ -118,22 +118,22 @@ else
+ fi
+ 
+ if test "$echo_ft_version" = "yes" ; then
+-  major=`grep define $includedir/freetype2/freetype/freetype.h \
++  major=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
+          | grep FREETYPE_MAJOR \
+          | sed 's/.*[ 	]\([0-9][0-9]*\).*/\1/'`
+-  minor=`grep define $includedir/freetype2/freetype/freetype.h \
++  minor=`grep define ${SYSROOT}$includedir/freetype2/freetype/freetype.h \
+          | grep FREETYPE_MINOR \
+          | sed 's/.*[ 	]\([0-9][0-9]*\).*/\1/'`
+-  patch=`grep define $includedir/freetype2/freetype/freetype.h \
++  patch=`grep define ${SYSROOT}$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
+-    echo $cflags -I$includedir
++  cflags="-I${SYSROOT}$includedir/freetype2"
++  if test "${SYSROOT}$includedir" != "/usr/include" ; then
++    echo $cflags -I${SYSROOT}$includedir
+   else
+     echo $cflags
+   fi
+@@ -145,8 +145,8 @@ if test "$echo_libs" = "yes" ; then
+     eval "rpath=\"$hardcode_libdir_flag_spec\""
+   fi
+   libs="-lfreetype @LIBZ@ @FT2_EXTRA_LIBS@"
+-  if test "$libdir" != "/usr/lib" && test "$libdir" != "/usr/lib64"; then
+-    echo -L$libdir $rpath $libs
++  if test "${SYSROOT}$libdir" != "/usr/lib" && test "${SYSROOT}$libdir" != "/usr/lib64"; then
++    echo -L${SYSROOT}$libdir $libs
+   else
+     echo $libs
+   fi
+@@ -154,7 +154,7 @@ fi
+ 
+ if test "$echo_libtool" = "yes" ; then
+   convlib="libfreetype.la"
+-  echo $libdir/$convlib
++  echo ${SYSROOT}$libdir/$convlib
+ fi
+ 
+ # EOF

Added: OSELAS.BSP-Phytec-phyCORE-11/patches/freetype-2.3.9/generic/series
===================================================================
--- OSELAS.BSP-Phytec-phyCORE-11/patches/freetype-2.3.9/generic/series
+++ OSELAS.BSP-Phytec-phyCORE-11/patches/freetype-2.3.9/generic/series
@@ -0,0 +1 @@
+builds_unix_freetype-config_in_sysroot.diff

