diff options
author | Sami Kerola <kerolasa@iki.fi> | 2012-04-17 21:21:20 +0200 |
---|---|---|
committer | Sami Kerola <kerolasa@iki.fi> | 2012-04-17 21:21:20 +0200 |
commit | bb4ae3d93311971562056ba15aff924e04375528 (patch) | |
tree | 9dbb71686c430105ac3cc766b6997e1cdf343c3f /configure.ac | |
parent | be26243f9c92c49f990958bf715c6a122c9a796c (diff) | |
download | procps-ng-bb4ae3d93311971562056ba15aff924e04375528.tar.gz |
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>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac index 4093346..a493fa8 100644 --- a/configure.ac +++ b/configure.ac @@ -14,20 +14,22 @@ AC_CONFIG_HEADERS([config.h]) AC_GNU_SOURCE AC_PROG_CC AC_PROG_CC_STDC -if test "x$ac_cv_prog_cc_c99" = "xno" || test "x$ac_cv_prog_cc_c99" = "x"; then -# We might be on RHEL5 with a git checkout and so broken -# 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 - CC="$CC -std=gnu99" - AC_RUN_IFELSE( - [AC_LANG_PROGRAM([],[[ -return 0; - ]])], - [], - [AC_MSG_ERROR([Could not find a C99 compatible compiler])]) - else - AC_MSG_ERROR([Could not find a C99 compatible compiler]) +if test "$cross_compiling" = no; then + if test "x$ac_cv_prog_cc_c99" = "xno" || test "x$ac_cv_prog_cc_c99" = "x"; then + # We might be on RHEL5 with a git checkout and so broken + # 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 + CC="$CC -std=gnu99" + AC_RUN_IFELSE( + [AC_LANG_PROGRAM([],[[ + return 0; + ]])], + [], + [AC_MSG_ERROR([Could not find a C99 compatible compiler])]) + else + AC_MSG_ERROR([Could not find a C99 compatible compiler]) + fi fi fi AM_PROG_CC_C_O |