2008-07-17 Pavel Roskin <proski@gnu.org>

* aclocal.m4 (grub_PROG_TARGET_CC): New macro.  Check if the
	target compiler is functional.
	* configure.ac: Call grub_PROG_TARGET_CC once all target flags
	are set up.
This commit is contained in:
proski 2008-07-17 20:19:55 +00:00
parent 58393a2d35
commit f6130a12bd
4 changed files with 82 additions and 0 deletions

60
configure vendored
View file

@ -6766,6 +6766,66 @@ CPPFLAGS="$TARGET_CPPFLAGS"
LDFLAGS="$TARGET_LDFLAGS"
# Defined in aclocal.m4.
{ echo "$as_me:$LINENO: checking whether target compiler is working" >&5
echo $ECHO_N "checking whether target compiler is working... $ECHO_C" >&6; }
if test "${grub_cv_prog_target_cc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
grub_cv_prog_target_cc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
grub_cv_prog_target_cc=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: result: $grub_cv_prog_target_cc" >&5
echo "${ECHO_T}$grub_cv_prog_target_cc" >&6; }
if test "x$grub_cv_prog_target_cc" = xno; then
{ { echo "$as_me:$LINENO: error: cannot compile for the target" >&5
echo "$as_me: error: cannot compile for the target" >&2;}
{ (exit 1); exit 1; }; }
fi
{ echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5
echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6; }
if test "${grub_cv_prog_objcopy_absolute+set}" = set; then