1AC_DEFUN(AM_SANITY_CHECK_CC, 2[dnl Derived from macros from Bruno Haible and from Cygnus. 3AC_MSG_CHECKING([whether the compiler ($CC $CFLAGS $LDFLAGS) actually works]) 4AC_LANG_SAVE 5 AC_LANG_C 6 AC_TRY_RUN([main() { exit(0); }], 7 am_cv_prog_cc_works=yes, am_cv_prog_cc_works=no, 8 dnl When crosscompiling, just try linking. 9 AC_TRY_LINK([], [], am_cv_prog_cc_works=yes, 10 am_cv_prog_cc_works=no)) 11AC_LANG_RESTORE 12case "$am_cv_prog_cc_works" in 13 *no) AC_MSG_ERROR([Installation or configuration problem: C compiler cannot create executables.]) ;; 14 *yes) ;; 15esac 16AC_MSG_RESULT(yes) 17])dnl 18