1 AC_DEFUN(AM_SANITY_CHECK_CC,
2 [dnl Derived from macros from Bruno Haible and from Cygnus.
3 AC_MSG_CHECKING([whether the compiler ($CC $CFLAGS $LDFLAGS) actually works])
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))
12 case "$am_cv_prog_cc_works" in
13 *no) AC_MSG_ERROR([Installation or configuration problem: C compiler cannot create executables.]) ;;