Hi there,
Sorry to resurrect an ancient thread, but I ran into a similar problem when
attempting to cross-compile freetype2 v2.4.6 using LTIB.
In the hopes of saving someone else the trouble, I'm including my solution in
the form of the attached patch which explains the problem and shows my hacky
fix to allow it to build under LTIB.
-Aaron
# 2011-Nov-07
# This patch provides a workaround for config problems caused by LTIB's env
setup.
# In a nutshell, two issues were occurring:
# 1) Freetype2's configure script was ignoring --build=XXX options and guessing
the wrong compiler triplet for the build machine when called in LTIB environment
# FIX: remove call to builds/unix/config.guess in favor of '/usr/bin/gcc
-dumpmachine'
# 2) The [triplet]-gcc file was adding some command switchs and somehow using the path to
find "the true gcc" when compiling. Since the LTIB environment places its own
spoof dirs first in the path, [triplet]-gcc wound up calling the cross compiler.
# FIX: modify the variable holding the native compiler call (CC_BUILD) to set
the environment to something resonable when using [triplet]-gcc as determined
by the above fix. (env PATH=/usr/bin XXX)
# Note that the problem is caused by bad env settings -- using the configure to set up a
"proper" no-spoof cross-compile works fine.
diff -uNr freetype-2.4.6/builds/unix/configure
freetype-2.4.6-modified//builds/unix/configure
--- freetype-2.4.6/builds/unix/configure 2011-07-29
00:39:28.000000000 -0400
+++ freetype-2.4.6-modified//builds/unix/configure 2011-11-07
14:49:43.138435856 -0500
@@ -2457,18 +2457,19 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed"
"$LINENO" 5
-
-fi
+#if ${ac_cv_build+:} false; then :
+# $as_echo_n "(cached) " >&6
+#else
+# ac_build_alias=$build_alias
+#test "x$ac_build_alias" = x &&
+# ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+#test "x$ac_build_alias" = x &&
+# as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+#ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+# as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed"
"$LINENO" 5#
+#
+#fi
+ac_cv_build=`/usr/bin/gcc -dumpmachine`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
@@ -3577,7 +3578,7 @@
fi
fi
fi
-CC_BUILD=$ac_cv_prog_CC_BUILD
+CC_BUILD="env PATH=/usr/bin $ac_cv_prog_CC_BUILD"
if test -n "$CC_BUILD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC_BUILD" >&5
$as_echo "$CC_BUILD" >&6; }
@@ -3594,6 +3595,8 @@
rm -f a.* b.* a_out.exe conftest.*
echo > conftest.c "int main() { return 0;}"
${CC_BUILD} conftest.c || as_fn_error $? "native C compiler is not working"
"$LINENO" 5
+ #touch a.out
+ #chmod +x a.out
rm -f conftest.c
if test -x a.out -o -x b.out -o -x conftest; then
EXEEXT_BUILD=""