config: compile test rather than run test

When testing compiler flags, we only need to do compile test. Otherwise,
configure will fail with "configure: error: cannot run test program while
cross compiling" when cross compiling.

Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2191
This commit is contained in:
Chunwei Chen 2014-03-15 14:24:40 +08:00 committed by Brian Behlendorf
parent 26b42f3f9d
commit a15dac42df
3 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_NO_AGGRESSIVE_LOOP_OPTIMIZATIONS], [
saved_flags="$CFLAGS"
CFLAGS="$CFLAGS -fno-aggressive-loop-optimizations"
AC_RUN_IFELSE([AC_LANG_PROGRAM([], [])], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
NO_AGGRESSIVE_LOOP_OPTIMIZATIONS=-fno-aggressive-loop-optimizations
AC_MSG_RESULT([yes])
], [

View File

@ -12,7 +12,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_NO_UNUSED_BUT_SET_VARIABLE], [
saved_flags="$CFLAGS"
CFLAGS="$CFLAGS -Wunused-but-set-variable"
AC_RUN_IFELSE([AC_LANG_PROGRAM([], [])],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
[
NO_UNUSED_BUT_SET_VARIABLE=-Wno-unused-but-set-variable
AC_MSG_RESULT([yes])

View File

@ -7,7 +7,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_FRAME_LARGER_THAN], [
saved_flags="$CFLAGS"
CFLAGS="$CFLAGS -Wframe-larger-than=1024"
AC_RUN_IFELSE([AC_LANG_PROGRAM([], [])],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
[
FRAME_LARGER_THAN=-Wframe-larger-than=1024
AC_MSG_RESULT([yes])