diff options
Diffstat (limited to 'lib/make/aclocal.m4')
-rw-r--r-- | lib/make/aclocal.m4 | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/lib/make/aclocal.m4 b/lib/make/aclocal.m4 index e8a88bc5..d6e07503 100644 --- a/lib/make/aclocal.m4 +++ b/lib/make/aclocal.m4 @@ -1011,6 +1011,56 @@ fi +AC_DEFUN(CCTK_C_ATTRIBUTE_FORMAT, +[AC_CACHE_CHECK([for C __attribute__((__format__(printf(1, 2))))], cctk_cv_have_c_attribute_format, +[cctk_cv_have_c_attribute_format=no +AC_TRY_COMPILE(void xyzzy(const char*, ...) __attribute__((__format__(printf(1, 2))));, xyzzy("%d",42);, cctk_cv_have_c_attribute_format=yes, cctk_cv_have_c_attribute_format=no) +]) +if test "$cctk_cv_have_c_attribute_format" = "yes" ; then + AC_DEFINE(HAVE_CCTK_C_ATTRIBUTE_FORMAT) +fi +]) + +AC_DEFUN(CCTK_CXX_ATTRIBUTE_FORMAT, +[AC_CACHE_CHECK([for CXX __attribute__((__format__))], cctk_cv_have_cxx_attribute_format, +[cctk_cv_have_cxx_attribute_format=no +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE(void xyzzy(const char*, ...) __attribute__((__format__(printf(1, 2))));, xyzzy("%d",42);, cctk_cv_have_cxx_attribute_format=yes, cctk_cv_have_cxx_attribute_format=no) +AC_LANG_RESTORE +]) +if test "$cctk_cv_have_cxx_attribute_format" = "yes" ; then + AC_DEFINE(HAVE_CCTK_CXX_ATTRIBUTE_FORMAT) +fi +]) + + + +AC_DEFUN(CCTK_C_ATTRIBUTE_NORETURN, +[AC_CACHE_CHECK([for C __attribute__((__noreturn__))], cctk_cv_have_c_attribute_noreturn, +[cctk_cv_have_c_attribute_noreturn=no +AC_TRY_COMPILE(void xyzzy(void) __attribute__((__noreturn__));, xyzzy(), cctk_cv_have_c_attribute_noreturn=yes, cctk_cv_have_c_attribute_noreturn=no) +]) +if test "$cctk_cv_have_c_attribute_noreturn" = "yes" ; then + AC_DEFINE(HAVE_CCTK_C_ATTRIBUTE_NORETURN) +fi +]) + +AC_DEFUN(CCTK_CXX_ATTRIBUTE_NORETURN, +[AC_CACHE_CHECK([for CXX __attribute__((__noreturn__))], cctk_cv_have_cxx_attribute_noreturn, +[cctk_cv_have_cxx_attribute_noreturn=no +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_COMPILE(void xyzzy(void) __attribute__((__noreturn__));, xyzzy(), cctk_cv_have_cxx_attribute_noreturn=yes, cctk_cv_have_cxx_attribute_noreturn=no) +AC_LANG_RESTORE +]) +if test "$cctk_cv_have_cxx_attribute_noreturn" = "yes" ; then + AC_DEFINE(HAVE_CCTK_CXX_ATTRIBUTE_NORETURN) +fi +]) + + + AC_DEFUN(CCTK_C_BUILTIN_EXPECT, [AC_CACHE_CHECK([for C __builtin_expect], cctk_cv_have_c_builtin_expect, [cctk_cv_have_c_builtin_expect=no @@ -1036,6 +1086,31 @@ fi +AC_DEFUN(CCTK_C_BUILTIN_UNREACHABLE, +[AC_CACHE_CHECK([for C __builtin_unreachable], cctk_cv_have_c_builtin_unreachable, +[cctk_cv_have_c_builtin_unreachable=no +AC_TRY_COMPILE(, __builtin_unreachable();, cctk_cv_have_c_builtin_unreachable=yes, cctk_cv_have_c_builtin_unreachable=no) +]) +if test "$cctk_cv_have_c_builtin_unreachable" = "yes" ; then + AC_DEFINE(HAVE_CCTK_C_BUILTIN_UNREACHABLE) +fi +]) + +AC_DEFUN(CCTK_CXX_BUILTIN_UNREACHABLE, +[AC_CACHE_CHECK([for CXX __builtin_unreachable], cctk_cv_have_cxx_builtin_unreachable, +[cctk_cv_have_cxx_builtin_unreachable=no +AC_LANG_SAVE +AC_LANG_CPLUSPLUS +AC_TRY_LINK(, __builtin_unreachable();, cctk_cv_have_cxx_builtin_unreachable=yes, cctk_cv_have_cxx_builtin_unreachable=no) +AC_LANG_RESTORE +]) +if test "$cctk_cv_have_cxx_builtin_unreachable" = "yes" ; then + AC_DEFINE(HAVE_CCTK_CXX_BUILTIN_UNREACHABLE) +fi +]) + + + dnl Check for a function that may be provided by cmath or math.h AC_DEFUN(CCTK_CHECK_CXX_STDMATHFUNC, [cctk_func=`echo $1 | sed 'y%./+-%__p_%'` |