Commit 1894e4c5 by Paolo Carlini Committed by Paolo Carlini

acinclude.m4 ([GLIBCXX_CHECK_GETTIMEOFDAY]): Change to use GCC_TRY_COMPILE_OR_LINK.

2008-08-23  Paolo Carlini  <paolo.carlini@oracle.com>

	* acinclude.m4 ([GLIBCXX_CHECK_GETTIMEOFDAY]): Change to use
	GCC_TRY_COMPILE_OR_LINK.
	([GLIBCXX_CHECK_CLOCK_GETTIME]): Rename to
	[GLIBCXX_ENABLE_CLOCK_GETTIME], a versatile configure-time option,
	[no] by default, since it includes TRY_LINK checks.  librt is also
	searched, if requested.
	* doc/xml/manual/configure.xml: Document the latter.
	* configure.ac: Move the above checks outside native-only.
	* configure: Regenerate.

From-SVN: r139576
parent e57903b8
2008-08-25 Paolo Carlini <paolo.carlini@oracle.com>
* linkage.m4 ([GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1],
[GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT]): Remove
* configure.ac: Do not call the latter.
* crossconfig.m4: Likewise.
* libmath/mathconf.h: Adjust.
* configure: Regenerate.
* config.h.in: Likewise.
2008-08-24 Paolo Carlini <paolo.carlini@oracle.com>
* acinclude.m4 ([GLIBCXX_CHECK_RANDOM_TR1]): Simplify, just use
......
......@@ -631,48 +631,6 @@
/* Define to 1 if you have the `_tanl' function. */
#undef HAVE__TANL
/* Define if the compiler/host combination has __builtin_abs. */
#undef HAVE___BUILTIN_ABS
/* Define if the compiler/host combination has __builtin_cos. */
#undef HAVE___BUILTIN_COS
/* Define if the compiler/host combination has __builtin_cosf. */
#undef HAVE___BUILTIN_COSF
/* Define if the compiler/host combination has __builtin_cosl. */
#undef HAVE___BUILTIN_COSL
/* Define if the compiler/host combination has __builtin_fabs. */
#undef HAVE___BUILTIN_FABS
/* Define if the compiler/host combination has __builtin_fabsf. */
#undef HAVE___BUILTIN_FABSF
/* Define if the compiler/host combination has __builtin_fabsl. */
#undef HAVE___BUILTIN_FABSL
/* Define if the compiler/host combination has __builtin_labs. */
#undef HAVE___BUILTIN_LABS
/* Define if the compiler/host combination has __builtin_sin. */
#undef HAVE___BUILTIN_SIN
/* Define if the compiler/host combination has __builtin_sinf. */
#undef HAVE___BUILTIN_SINF
/* Define if the compiler/host combination has __builtin_sinl. */
#undef HAVE___BUILTIN_SINL
/* Define if the compiler/host combination has __builtin_sqrt. */
#undef HAVE___BUILTIN_SQRT
/* Define if the compiler/host combination has __builtin_sqrtf. */
#undef HAVE___BUILTIN_SQRTF
/* Define if the compiler/host combination has __builtin_sqrtl. */
#undef HAVE___BUILTIN_SQRTL
/* Define to 1 if you have the `__signbit' function. */
#undef HAVE___SIGNBIT
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -104,7 +104,7 @@ GLIBCXX_ENABLE_THREADS
GLIBCXX_CHECK_COMPILER_FEATURES
GLIBCXX_CHECK_STANDARD_LAYOUT
# Enable all the variable C++ runtime options that doesn't require linking.
# Enable all the variable C++ runtime options that don't require linking.
GLIBCXX_ENABLE_CSTDIO
GLIBCXX_ENABLE_CLOCALE
GLIBCXX_ENABLE_ALLOCATOR
......@@ -167,11 +167,10 @@ if $GLIBCXX_IS_NATIVE; then
GLIBCXX_CHECK_LINKER_FEATURES
GLIBCXX_CHECK_MATH_SUPPORT
GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
GLIBCXX_CHECK_STDLIB_SUPPORT
# For dev/random and dev/urandom for TR1.
# For /dev/random and /dev/urandom for TR1.
GLIBCXX_CHECK_RANDOM_TR1
# For TLS support.
......@@ -211,7 +210,6 @@ else
fi
# Construct crosses by hand, eliminating bits that need ld...
# GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
# GLIBCXX_CHECK_MATH_SUPPORT
# First, test for "known" system libraries. We may be using newlib even
......
......@@ -16,7 +16,6 @@ case "${host}" in
GLIBCXX_CHECK_COMPILER_FEATURES
GLIBCXX_CHECK_LINKER_FEATURES
GLIBCXX_CHECK_MATH_SUPPORT
GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
GLIBCXX_CHECK_STDLIB_SUPPORT
......@@ -39,7 +38,6 @@ case "${host}" in
# Don't call GLIBCXX_CHECK_LINKER_FEATURES, Darwin doesn't have a GNU ld
GLIBCXX_CHECK_MATH_SUPPORT
GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
GLIBCXX_CHECK_STDLIB_SUPPORT
;;
......@@ -53,21 +51,6 @@ case "${host}" in
AC_DEFINE(HAVE_COPYSIGN)
AC_DEFINE(HAVE_SINCOS)
AC_DEFINE(HAVE_HYPOT)
# GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
AC_DEFINE(HAVE___BUILTIN_ABS)
AC_DEFINE(HAVE___BUILTIN_FABSF)
AC_DEFINE(HAVE___BUILTIN_FABS)
AC_DEFINE(HAVE___BUILTIN_FABSL)
AC_DEFINE(HAVE___BUILTIN_LABS)
AC_DEFINE(HAVE___BUILTIN_SQRTF)
AC_DEFINE(HAVE___BUILTIN_SQRT)
AC_DEFINE(HAVE___BUILTIN_SQRTL)
AC_DEFINE(HAVE___BUILTIN_SINF)
AC_DEFINE(HAVE___BUILTIN_SIN)
AC_DEFINE(HAVE___BUILTIN_SINL)
AC_DEFINE(HAVE___BUILTIN_COSF)
AC_DEFINE(HAVE___BUILTIN_COS)
AC_DEFINE(HAVE___BUILTIN_COSL)
# GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
# GLIBCXX_CHECK_STDLIB_SUPPORT
AC_DEFINE(HAVE_COPYSIGN)
......@@ -147,7 +130,6 @@ case "${host}" in
GLIBCXX_CHECK_COMPILER_FEATURES
GLIBCXX_CHECK_LINKER_FEATURES
GLIBCXX_CHECK_MATH_SUPPORT
GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
GLIBCXX_CHECK_STDLIB_SUPPORT
......@@ -225,20 +207,6 @@ case "${host}" in
;;
esac
case "$target" in
sparc*-*-solaris2.8 | sparc*-*-solaris2.9 | sparc*-*-solaris2.10)
# I saw these on sparc-sun-solaris2.8, but not 2.6, and not on i386
AC_DEFINE(HAVE___BUILTIN_ABS)
AC_DEFINE(HAVE___BUILTIN_LABS)
AC_DEFINE(HAVE___BUILTIN_FABS)
AC_DEFINE(HAVE___BUILTIN_FABSF)
AC_DEFINE(HAVE___BUILTIN_FABSL)
AC_DEFINE(HAVE___BUILTIN_COS)
AC_DEFINE(HAVE___BUILTIN_COSF)
AC_DEFINE(HAVE___BUILTIN_SIN)
AC_DEFINE(HAVE___BUILTIN_SINF)
;;
esac
case "$target" in
*-*-solaris2.10)
# These two C99 functions are present only in Solaris >= 10
AC_DEFINE(HAVE_STRTOF)
......
/* Configuration data for libmath subpart of libstdc++. */
/* Copyright (C) 1997-1999, 2000, 2001 Free Software Foundation, Inc.
/* Copyright (C) 1997-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU ISO C++ Library. This library is free
software; you can redistribute it and/or modify it under the
......@@ -263,10 +264,10 @@ do { \
/* Replacement for non-existing float functions. */
#if !defined(HAVE_FABSF) && !defined(HAVE___BUILTIN_FABSF)
#ifndef HAVE_FABSF
# define fabsf(x) fabs (x)
#endif
#if !defined(HAVE_COSF) && !defined(HAVE___BUILTIN_COSF)
#ifndef HAVE_COSF
# define cosf(x) cos (x)
#endif
#ifndef HAVE_COSHF
......@@ -284,13 +285,13 @@ do { \
#ifndef HAVE_POWF
# define powf(x, y) pow (x, y)
#endif
#if !defined(HAVE_SINF) && !defined(HAVE___BUILTIN_SINF)
#ifndef HAVE_SINF
# define sinf(x) sin (x)
#endif
#ifndef HAVE_SINHF
# define sinhf(x) sinh (x)
#endif
#if !defined(HAVE_SQRTF) && !defined(HAVE___BUILTIN_SQRTF)
#ifndef HAVE_SQRTF
# define sqrtf(x) sqrt (x)
#endif
#ifndef HAVE_TANF
......@@ -306,4 +307,3 @@ do { \
#ifdef __cplusplus
}
#endif
......@@ -291,94 +291,6 @@ AC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3], [
])
dnl
dnl Because the builtins are picky picky picky about the arguments they take,
dnl do an explict linkage tests here.
dnl Check to see if the (math function) argument passed is
dnl 1) declared when using the c++ compiler
dnl 2) has "C" linkage
dnl
dnl Define HAVE_CARGF etc if "cargf" is declared and links
dnl
dnl argument 1 is name of function to check
dnl
dnl ASSUMES argument is a math function with ONE parameter
dnl
dnl GLIBCXX_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
AC_DEFUN([GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1], [
AC_MSG_CHECKING([for $1 declaration])
if test x${glibcxx_cv_func_$1_use+set} != xset; then
AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <math.h>],
[ $1(0);],
[glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
AC_LANG_RESTORE
])
fi
AC_MSG_RESULT($glibcxx_cv_func_$1_use)
if test x$glibcxx_cv_func_$1_use = x"yes"; then
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)
define([NAME], [translit([$1],[abcdefghijklmnopqrstuvwxyz],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ])])
if test x$glibcxx_cv_func_$1_link = x"yes"; then
AC_DEFINE([HAVE_]NAME, 1, [Define if the compiler/host combination has $1.])
fi
undefine([NAME])
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
dnl Check to see what the underlying c library is like
dnl These checks need to do two things:
dnl 1) make sure the name is declared when using the c++ compiler
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment