* AC_C_ATTRIBUTE: check for __attribute__ (required at least by mipspro)
[cacao.git] / m4 / acinclude.m4
1 dnl modified AC_C_INLINE from autoconf/c.m4 by TWISTI
2
3 AN_IDENTIFIER([attribute], [AC_C_ATTRIBUTE])
4 AC_DEFUN([AC_C_ATTRIBUTE],
5 [AC_CACHE_CHECK([for __attribute__], ac_cv_c_attribute,
6 [
7 AC_COMPILE_IFELSE([AC_LANG_SOURCE(
8 [void foo(void) __attribute__ ((__noreturn__));]
9 )],
10 [ac_cv_c_attribute=yes],
11 [ac_cv_c_attribute=no]
12 )
13 ])
14 AH_VERBATIM([attribute],
15 [/* Define to `__attribute__' to nothing if it's not supported.  */
16 #ifndef __cplusplus
17 #undef __attribute__
18 #endif])
19 case $ac_cv_c_attribute in
20   yes) ;;
21   no)
22     cat >>confdefs.h <<_ACEOF
23 #ifndef __cplusplus
24 #define __attribute__(x)    /* nothing */
25 #endif
26 _ACEOF
27     ;;
28 esac
29 ])# AC_C_ATTRIBUTE