blob: 4ff672e154bc518caee68db068f2409847f721f6 [file] [log] [blame]
Daniel Veillard5edcc932000-10-15 21:43:03 +00001dnl Like AC_TRY_EVAL but also errors out if the compiler generates
2dnl _any_ output. Some compilers might issue warnings which we want
3dnl to catch.
Daniel Veillarde1021fa2004-01-26 17:03:09 +00004AC_DEFUN([AC_TRY_EVAL2],
Daniel Veillard5edcc932000-10-15 21:43:03 +00005[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AC_FD_CC; dnl
6(eval [$]$1) 2>&AC_FD_CC; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }])
7
8dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL
Daniel Veillarde1021fa2004-01-26 17:03:09 +00009AC_DEFUN([AC_TRY_COMPILE2],
Daniel Veillard5edcc932000-10-15 21:43:03 +000010[cat > conftest.$ac_ext <<EOF
11[#]line __oline__ "configure"
12#include "confdefs.h"
13[$1]
William M. Brack2e6b1432004-02-09 15:10:28 +000014int main(void) {
Daniel Veillard5edcc932000-10-15 21:43:03 +000015[$2]
16; return 0; }
17EOF
18if AC_TRY_EVAL2(ac_compile); then
19 ifelse([$3], , :, [rm -rf conftest*
20 $3])
21else
22 echo "configure: failed program was:" >&AC_FD_CC
23 cat conftest.$ac_ext >&AC_FD_CC
24ifelse([$4], , , [ rm -rf conftest*
25 $4
26])dnl
27fi
28rm -f conftest*])