- AC_MSG_CHECKING([for $1 linkage])
- if test x${glibcxx_cv_func_$1_link+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_link, [
- AC_TRY_LINK([#include <math.h>],
- [ $1(0);],
- [glibcxx_cv_func_$1_link=yes], [glibcxx_cv_func_$1_link=no])
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_link)
- if test x$glibcxx_cv_func_$1_link = x"yes"; then
- ac_tr_func=HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
- AC_DEFINE_UNQUOTED(${ac_tr_func})
- fi
- fi
-])
-
-
-dnl
-dnl Check to see what builtin math functions are supported
-dnl
-dnl check for __builtin_abs
-dnl check for __builtin_fabsf
-dnl check for __builtin_fabs
-dnl check for __builtin_fabl
-dnl check for __builtin_labs
-dnl check for __builtin_sqrtf
-dnl check for __builtin_sqrtl
-dnl check for __builtin_sqrt
-dnl check for __builtin_sinf
-dnl check for __builtin_sin
-dnl check for __builtin_sinl
-dnl check for __builtin_cosf
-dnl check for __builtin_cos
-dnl check for __builtin_cosl
-dnl
-dnl GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
-AC_DEFUN(GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT, [
- dnl Test for builtin math functions.
- dnl These are made in gcc/c-common.c
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
-
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
-
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
-
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
-
- dnl There is, without a doubt, a more elegant way to have these
- dnl names exported so that they won't be stripped out of acconfig.h by
- dnl autoheader. I leave this as an exercise to somebody less frustrated
- dnl than I.... please email the libstdc++ list if you can figure out a
- dnl more elegant approach (see autoconf/acgen.m4 and specifically
- dnl AC_CHECK_FUNC for things to steal.)
- dummyvar=no
- if test x$dummyvar = x"yes"; then
- AC_DEFINE(HAVE___BUILTIN_ABS)
- AC_DEFINE(HAVE___BUILTIN_LABS)
- AC_DEFINE(HAVE___BUILTIN_COS)
- AC_DEFINE(HAVE___BUILTIN_COSF)
- AC_DEFINE(HAVE___BUILTIN_COSL)
- AC_DEFINE(HAVE___BUILTIN_FABS)
- AC_DEFINE(HAVE___BUILTIN_FABSF)
- AC_DEFINE(HAVE___BUILTIN_FABSL)
- AC_DEFINE(HAVE___BUILTIN_SIN)
- AC_DEFINE(HAVE___BUILTIN_SINF)
- AC_DEFINE(HAVE___BUILTIN_SINL)
- AC_DEFINE(HAVE___BUILTIN_SQRT)
- AC_DEFINE(HAVE___BUILTIN_SQRTF)
- AC_DEFINE(HAVE___BUILTIN_SQRTL)