Daniel Veillard | 5edcc93 | 2000-10-15 21:43:03 +0000 | [diff] [blame] | 1 | dnl Like AC_TRY_EVAL but also errors out if the compiler generates |
| 2 | dnl _any_ output. Some compilers might issue warnings which we want |
| 3 | dnl to catch. |
Daniel Veillard | e1021fa | 2004-01-26 17:03:09 +0000 | [diff] [blame] | 4 | AC_DEFUN([AC_TRY_EVAL2], |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 5 | [{ (eval echo configure:__oline__: \"[$]$1\") 1>&AS_MESSAGE_LOG_FD; dnl |
| 6 | (eval [$]$1) 2>&AS_MESSAGE_LOG_FD; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }]) |
Daniel Veillard | 5edcc93 | 2000-10-15 21:43:03 +0000 | [diff] [blame] | 7 | |
| 8 | dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL |
Daniel Veillard | e1021fa | 2004-01-26 17:03:09 +0000 | [diff] [blame] | 9 | AC_DEFUN([AC_TRY_COMPILE2], |
Daniel Veillard | 5edcc93 | 2000-10-15 21:43:03 +0000 | [diff] [blame] | 10 | [cat > conftest.$ac_ext <<EOF |
| 11 | [#]line __oline__ "configure" |
| 12 | #include "confdefs.h" |
| 13 | [$1] |
William M. Brack | 2e6b143 | 2004-02-09 15:10:28 +0000 | [diff] [blame] | 14 | int main(void) { |
Daniel Veillard | 5edcc93 | 2000-10-15 21:43:03 +0000 | [diff] [blame] | 15 | [$2] |
| 16 | ; return 0; } |
| 17 | EOF |
| 18 | if AC_TRY_EVAL2(ac_compile); then |
| 19 | ifelse([$3], , :, [rm -rf conftest* |
| 20 | $3]) |
| 21 | else |
Daniel Richard G | ec4fc52 | 2012-08-17 10:04:30 +0800 | [diff] [blame] | 22 | echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD |
| 23 | cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD |
Daniel Veillard | 5edcc93 | 2000-10-15 21:43:03 +0000 | [diff] [blame] | 24 | ifelse([$4], , , [ rm -rf conftest* |
| 25 | $4 |
| 26 | ])dnl |
| 27 | fi |
| 28 | rm -f conftest*]) |