build-sys: make buildroot compilation work

Fixes the following error in configure stage.

configure: error: cannot run test program while cross compiling

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola
2012-04-17 21:21:20 +02:00
parent be26243f9c
commit bb4ae3d933

View File

@ -14,21 +14,23 @@ AC_CONFIG_HEADERS([config.h])
AC_GNU_SOURCE AC_GNU_SOURCE
AC_PROG_CC AC_PROG_CC
AC_PROG_CC_STDC AC_PROG_CC_STDC
if test "x$ac_cv_prog_cc_c99" = "xno" || test "x$ac_cv_prog_cc_c99" = "x"; then if test "$cross_compiling" = no; then
# We might be on RHEL5 with a git checkout and so broken if test "x$ac_cv_prog_cc_c99" = "xno" || test "x$ac_cv_prog_cc_c99" = "x"; then
# autoconf. Check if CC is gcc and if it bails when given -std=gnu99. # We might be on RHEL5 with a git checkout and so broken
# If not, use that. Yuck. # autoconf. Check if CC is gcc and if it bails when given -std=gnu99.
# If not, use that. Yuck.
if test "x$ac_cv_c_compiler_gnu" = "xyes"; then if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
CC="$CC -std=gnu99" CC="$CC -std=gnu99"
AC_RUN_IFELSE( AC_RUN_IFELSE(
[AC_LANG_PROGRAM([],[[ [AC_LANG_PROGRAM([],[[
return 0; return 0;
]])], ]])],
[], [],
[AC_MSG_ERROR([Could not find a C99 compatible compiler])]) [AC_MSG_ERROR([Could not find a C99 compatible compiler])])
else else
AC_MSG_ERROR([Could not find a C99 compatible compiler]) AC_MSG_ERROR([Could not find a C99 compatible compiler])
fi fi
fi
fi fi
AM_PROG_CC_C_O AM_PROG_CC_C_O
AC_PROG_INSTALL AC_PROG_INSTALL