acinclude.m4 776 B

12345678910111213141516171819202122232425262728
  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.
  4. AC_DEFUN([AC_TRY_EVAL2],
  5. [{ (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. dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL
  8. AC_DEFUN([AC_TRY_COMPILE2],
  9. [cat > conftest.$ac_ext <<EOF
  10. [#]line __oline__ "configure"
  11. #include "confdefs.h"
  12. [$1]
  13. int main(void) {
  14. [$2]
  15. ; return 0; }
  16. EOF
  17. if AC_TRY_EVAL2(ac_compile); then
  18. ifelse([$3], , :, [rm -rf conftest*
  19. $3])
  20. else
  21. echo "configure: failed program was:" >&AC_FD_CC
  22. cat conftest.$ac_ext >&AC_FD_CC
  23. ifelse([$4], , , [ rm -rf conftest*
  24. $4
  25. ])dnl
  26. fi
  27. rm -f conftest*])