]> gcc.gnu.org Git - gcc.git/blobdiff - libstdc++-v3/crossconfig.m4
libstdc++: Fix up to_chars ppc64le _Float128 overloads [PR107636]
[gcc.git] / libstdc++-v3 / crossconfig.m4
index 3de40dc138b5c0e9d4f36afcab57796c6a0e24d3..b3269cb88e077425be95bfe6c424b08106cab93f 100644 (file)
@@ -54,14 +54,6 @@ case "${host}" in
     AC_DEFINE(HAVE_SQRTF)
     ;;
 
-  spu-*-elf*)
-    GLIBCXX_CHECK_COMPILER_FEATURES
-    GLIBCXX_CHECK_LINKER_FEATURES
-    GLIBCXX_CHECK_MATH_SUPPORT
-    GLIBCXX_CHECK_STDLIB_SUPPORT
-    AM_ICONV
-    ;;
-
   *-aix*)
     GLIBCXX_CHECK_LINKER_FEATURES
     GLIBCXX_CHECK_MATH_SUPPORT
@@ -71,6 +63,8 @@ case "${host}" in
     # We don't yet support AIX's TLS ABI.
     #GCC_CHECK_TLS
     AM_ICONV
+
+    AC_DEFINE(HAVE_USELOCALE)
     ;;
 
   *-darwin*)
@@ -81,6 +75,8 @@ case "${host}" in
     # Don't call GLIBCXX_CHECK_LINKER_FEATURES, Darwin doesn't have a GNU ld
     GLIBCXX_CHECK_MATH_SUPPORT
     GLIBCXX_CHECK_STDLIB_SUPPORT
+
+    AC_CHECK_FUNCS(uselocale)
     ;;
 
   *djgpp)
@@ -135,6 +131,9 @@ case "${host}" in
     fi
     AC_CHECK_FUNCS(__cxa_thread_atexit)
     AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
+    AC_CHECK_FUNCS(timespec_get)
+    AC_CHECK_FUNCS(sockatmark)
+    AC_CHECK_FUNCS(uselocale)
     ;;
 
   *-fuchsia*)
@@ -174,15 +173,6 @@ case "${host}" in
     AC_DEFINE(HAVE_STRTOLD)
 
     GCC_CHECK_TLS
-    case "$target" in
-      *-hpux10*)
-       AC_DEFINE(HAVE_ISINF)
-       AC_DEFINE(HAVE_ISINFF)
-       AC_DEFINE(HAVE_ISNANF)
-       AC_DEFINE(HAVE_FINITE)
-       AC_DEFINE(HAVE_FINITEF)
-       ;;
-    esac
     ;;
   *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-cygwin* | *-solaris*)
     GLIBCXX_CHECK_COMPILER_FEATURES
@@ -194,6 +184,10 @@ case "${host}" in
     GCC_CHECK_TLS
     AC_CHECK_FUNCS(__cxa_thread_atexit_impl)
     AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
+    AC_CHECK_FUNCS(timespec_get)
+    AC_CHECK_FUNCS(sockatmark)
+    AC_CHECK_FUNCS(uselocale)
+    AC_CHECK_FUNCS(secure_getenv)
     AM_ICONV
     ;;
   *-mingw32*)
@@ -202,6 +196,7 @@ case "${host}" in
     GLIBCXX_CHECK_STDLIB_SUPPORT
     AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
     AC_CHECK_FUNCS(_wfopen)
+    GCC_CHECK_TLS
     ;;
   *-netbsd* | *-openbsd*)
     SECTION_FLAGS='-ffunction-sections -fdata-sections'
@@ -221,6 +216,8 @@ case "${host}" in
       AC_DEFINE(HAVE_ISNANL)
     fi
     AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
+    AC_CHECK_FUNCS(timespec_get)
+    AC_CHECK_FUNCS(sockatmark)
     ;;
   *-qnx6.1* | *-qnx6.2*)
     SECTION_FLAGS='-ffunction-sections -fdata-sections'
@@ -239,12 +236,6 @@ case "${host}" in
     AC_DEFINE(HAVE_SINHF)
     AC_DEFINE(HAVE_SINHL)
     ;;
-  *-rtems*)
-    GLIBCXX_CHECK_COMPILER_FEATURES
-    GLIBCXX_CHECK_LINKER_FEATURES
-    GLIBCXX_CHECK_MATH_SUPPORT
-    GLIBCXX_CHECK_STDLIB_SUPPORT
-    ;;
   *-tpf)
     SECTION_FLAGS='-ffunction-sections -fdata-sections'
     SECTION_LDFLAGS='-Wl,--gc-sections $SECTION_LDFLAGS'
@@ -272,7 +263,7 @@ case "${host}" in
     GLIBCXX_CHECK_MATH_SUPPORT
     GLIBCXX_CHECK_STDLIB_SUPPORT
     ;;
-  *-vxworks)
+  *-vxworks*)
     AC_DEFINE(HAVE_ACOSF)
     AC_DEFINE(HAVE_ASINF)
     AC_DEFINE(HAVE_ATAN2F)
@@ -293,9 +284,73 @@ case "${host}" in
     AC_DEFINE(HAVE_SQRTF)
     AC_DEFINE(HAVE_TANF)
     AC_DEFINE(HAVE_TANHF)
+
+dnl # Different versions and execution modes implement different
+dnl # subsets of these functions.  Instead of hard-coding, test for C
+dnl # declarations in headers.  The C primitives could be defined as
+dnl # macros, in which case the tests might fail, and we might have to
+dnl # switch to more elaborate tests.
+    GLIBCXX_CHECK_MATH_DECLS([
+      acosl asinl atan2l atanl ceill cosl coshl expl fabsl floorl fmodl
+      frexpl ldexpl log10l logl modfl powl sinl sinhl sqrtl tanl tanhl hypotl
+      ldexpf modff hypotf frexpf])
+dnl # sincosl is the only one missing here, compared with the *l
+dnl # functions in the list guarded by
+dnl # long_double_math_on_this_cpu in configure.ac, right after
+dnl # the expansion of the present macro.
     ;;
   *)
     AC_MSG_ERROR([No support for this host/target combination.])
    ;;
 esac
 ])
+
+
+dnl
+dnl Check to see if the (math function) argument passed is
+dnl declared when using the c compiler
+dnl
+dnl Define HAVE_CARGF etc if "cargf" is declared
+dnl
+dnl argument 1 is name of function to check
+dnl
+dnl ASSUMES argument is a math function
+dnl
+dnl GLIBCXX_CHECK_MATH_DECL
+AC_DEFUN([GLIBCXX_CHECK_MATH_DECL], [
+  AC_CACHE_CHECK([for $1 declaration],
+    [glibcxx_cv_func_$1_use], [
+      AC_LANG_SAVE
+      AC_LANG_C
+      AC_TRY_COMPILE([
+#include <math.h>
+#ifdef HAVE_IEEEFP_H
+# include <ieeefp.h>
+#endif
+#undef $1
+], [
+  void (*f)(void) = (void (*)(void))$1;
+], [glibcxx_cv_func_$1_use=yes
+], [glibcxx_cv_func_$1_use=no])])
+  if test "x$glibcxx_cv_func_$1_use" = xyes; then
+    AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1]))
+  fi
+])
+
+dnl
+dnl Check to see whether multiple math functions are
+dnl declared when using the c compiler
+dnl
+dnl Define HAVE_CARGF HAVE_POWL etc if "cargf" and "powl"
+dnl are declared
+dnl
+dnl argument 1 is a word list naming function to check
+dnl
+dnl ASSUMES arguments are math functions
+dnl
+dnl GLIBCXX_CHECK_MATH_DECLS
+AC_DEFUN([GLIBCXX_CHECK_MATH_DECLS], [
+  m4_foreach_w([glibcxx_func], [$1], [
+    GLIBCXX_CHECK_MATH_DECL(glibcxx_func)
+  ])
+])
This page took 0.031604 seconds and 5 git commands to generate.