Merge from vendor branch NTPD:
[dragonfly.git] / contrib / nvi / build / aclocal.m4
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])
4 AC_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))
11 AC_LANG_RESTORE
12 case "$am_cv_prog_cc_works" in
13   *no) AC_MSG_ERROR([Installation or configuration problem: C compiler cannot create executables.]) ;;
14   *yes) ;;
15 esac
16 AC_MSG_RESULT(yes)
17 ])dnl