Commit e7140677 by Benjamin Kosnik

[multiple changes]


2000-10-26  Benjamin Kosnik  <bkoz@redhat.com>

	* include/c/bits/std_cmath.h: Fix double declarations in namespace std.

	Clean up naming, consistency in "C" library autoconf testing.
	* acinclude.m4 (GLIBCPP_CHECK_CTYPE): For consistency, change to
	GLIBCPP_CHECK_CTYPE_SUPPORT.
	(GLIBCPP_CHECK_STDLIB_SUPPORT): Add.
	* aclocal.m4: Regenerate.
	* configure.in: And here.
	Add call to GLIBCPP_CHECK_STDLIB_SUPPORT.
	* configure: Regenerate.

2000-10-26  David Edelsohn  <edelsohn@gnu.org>

	* acinclude.m4 (GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2): New macro.
	(GLIBCPP_CHECK_MATH_SUPPORT): Use it to test for strtold.

From-SVN: r37083
parent 5bd17d39
2000-10-26 Benjamin Kosnik <bkoz@redhat.com>
* include/c/bits/std_cmath.h: Fix double declarations in namespace std.
Clean up naming, consistency in "C" library autoconf testing.
* acinclude.m4 (GLIBCPP_CHECK_CTYPE): For consistency, change to
GLIBCPP_CHECK_CTYPE_SUPPORT.
(GLIBCPP_CHECK_STDLIB_SUPPORT): Add.
* aclocal.m4: Regenerate.
* configure.in: And here.
Add call to GLIBCPP_CHECK_STDLIB_SUPPORT.
* configure: Regenerate.
2000-10-26 David Edelsohn <edelsohn@gnu.org>
* acinclude.m4 (GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2): New macro.
(GLIBCPP_CHECK_MATH_SUPPORT): Use it to test for strtold.
2000-10-26 Phil Edwards <pme@sources.redhat.com>
David Edelsohn <dje@watson.ibm.com>
* acinclude.m4 (GLIBCPP_CHECK_LINKER_FEATURES): Comment out
--gc-sections stuff entirely to avoid misleading people.
(GLIBCPP_ENABLE_CSTDIO): Merge need_libio and need_xtra_libio.
* libio/Makefile.am (LIBIO_SRCS,LIBIO_WSRCS,LIBIO_XTRA_SRCS):
Rearrange and merge.
* libio/libio.h: Simplify, make fewer assumptions. Define those
macros which must be defined.
* config/os/solaris/solaris2.7/bits/os_defines.h: Simplify as a
result.
2000-10-26 Mark Mitchell <mark@codesourcery.com>
* include/backward/streambuf.h: New file.
......
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2000 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......@@ -407,9 +407,11 @@ mostlyclean distclean maintainer-clean
# because then the paths will be full pathnames, not relative
# pathnames. (-Wl,--rpath seems to like this better.)
check: $(top_builddir)/mkcheck
chmod +x $(top_builddir)/mkcheck
$(top_builddir)/mkcheck 0 `pwd` $(top_srcdir)
check-install: $(top_builddir)/mkcheck
chmod +x $(top_builddir)/mkcheck
$(top_builddir)/mkcheck 1 `pwd` $(top_srcdir) $(prefix)
# Multilib Makefile bits.
......
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995-8, 1999, 2000 Free Software Foundation, Inc.
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
......@@ -270,16 +270,16 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
SECTION_LDFLAGS=''
OPT_LDFLAGS=''
AC_REQUIRE([AC_PROG_LD])
if test "$ac_cv_prog_gnu_ld" = "yes"; then
# Set --gc-sections.
if test "$ac_cv_prog_gnu_ld" = "broken"; then
# GNU ld it is! Joy and bunny rabbits!
# All these tests are for C++; save the language and the compiler flags.
# Need to do this so that g++ won't try to link in libstdc++
ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
# CFLAGS='-x c++ -Wl,--gc-sections'
#XXX
CFLAGS=''
CFLAGS='-x c++ -Wl,--gc-sections'
# Check for -Wl,--gc-sections
# XXX This test is broken at the moment, as symbols required for
......@@ -304,15 +304,16 @@ AC_DEFUN(GLIBCPP_CHECK_LINKER_FEATURES, [
CFLAGS=''
fi
if test "$ac_sectionLDflags" = "yes"; then
# SECTION_LDFLAGS='-Wl,--gc-sections'
#XXX
SECTION_LDFLAGS=''
SECTION_LDFLAGS='-Wl,--gc-sections'
fi
AC_MSG_RESULT($ac_sectionLDflags)
fi
# Set linker optimization flags.
if test "$ac_cv_prog_gnu_ld" = "yes"; then
OPT_LDFLAGS='-Wl,-O1'
fi
AC_SUBST(SECTION_LDFLAGS)
AC_SUBST(OPT_LDFLAGS)
])
......@@ -406,6 +407,36 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_3, [
dnl
dnl Check to see if the (stdlib function) argument passed is
dnl 1) declared when using the c++ compiler
dnl 2) has "C" linkage
dnl
dnl Define HAVE_STRTOLD if "strtold" is declared and links
dnl Define HAVE_STRTOF if "strtof" is declared and links
dnl
dnl argument 1 is name of function to check
dnl
dnl ASSUMES argument is a math function with TWO parameters
dnl
dnl GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2
AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2, [
AC_MSG_CHECKING([for $1 declaration])
AC_CACHE_VAL(glibcpp_cv_func_$1_use, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <stdlib.h>],
[ $1(0, 0);],
[glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no])
AC_LANG_RESTORE
])
AC_MSG_RESULT($glibcpp_cv_func_$1_use)
if test x$glibcpp_cv_func_$1_use = x"yes"; then
AC_CHECK_FUNCS($1)
fi
])
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
......@@ -513,6 +544,29 @@ AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [
dnl
dnl Check to see what the underlying c library
dnl These checks need to do two things:
dnl 1) make sure the name is declared when using the c++ compiler
dnl 2) make sure the name has "C" linkage
dnl This might seem like overkill but experience has shown that it's not...
dnl
dnl Define HAVE_STRTOF etc if "strtof" is found.
dnl Define HAVE_STRTOLD etc if "strtold" is found.
dnl
dnl GLIBCPP_CHECK_STDLIB_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-fno-builtins -D_GNU_SOURCE'
AC_CHECK_FUNCS(strtof)
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
CXXFLAGS="$ac_save_CXXFLAGS"
])
dnl
dnl Check to see what the underlying c library or math library is like.
dnl These checks need to do two things:
dnl 1) make sure the name is declared when using the c++ compiler
......@@ -532,9 +586,6 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
ac_save_LIBS="$LIBS"
LIBS="$LIBS $libm"
dnl Although not math functions, needed and for some reason checked here.
AC_CHECK_FUNCS(strtof strtold)
dnl Check to see if certain C math functions exist.
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isinf)
GLIBCPP_CHECK_MATH_DECL_AND_LINKAGE_1(isnan)
......@@ -794,8 +845,8 @@ dnl
dnl Depending on what is found, select various configure/*/bits/ctype_base.h
dnl Depending on what is found, select various configure/*/ctype.cc
dnl
dnl GLIBCPP_CHECK_CTYPE
AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
dnl GLIBCPP_CHECK_CTYPE_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_CTYPE_SUPPORT, [
AC_CHECK_HEADER(ctype.h, [
dnl If doesn't match any specified, go with defaults.
......@@ -1259,11 +1310,9 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
if test x$glibc_satisfactory = x"yes"; then
need_libio=no
need_xtra_libio=no
need_wlibio=no
else
need_libio=yes
need_xtra_libio=yes
# bkoz XXX need to add checks to enable this
# pme XXX here's a first pass at such a check
if test x$enable_c_mbchar != xno; then
......@@ -1273,10 +1322,9 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
fi
fi
# Using libio, but <libio.h> doesn't exist on the target system. . .
else
# Using libio, but <libio.h> doesn't exist on the target system. . .
need_libio=yes
need_xtra_libio=no
# bkoz XXX need to add checks to enable this
# pme XXX here's a first pass at such a check
if test x$enable_c_mbchar != xno; then
......@@ -1308,7 +1356,6 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
# 2000-08-04 bkoz hack
AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
AM_CONDITIONAL(GLIBCPP_NEED_XTRA_LIBIO, test "$need_xtra_libio" = yes)
AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
])
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -131,7 +131,8 @@ else
GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
AC_CACHE_SAVE
GLIBCPP_CHECK_WCHAR_T_SUPPORT
GLIBCPP_CHECK_CTYPE
GLIBCPP_CHECK_CTYPE_SUPPORT
GLIBCPP_CHECK_STDLIB_SUPPORT
AC_FUNC_MMAP
AC_CHECK_HEADERS(gconv.h)
......
......@@ -265,98 +265,77 @@ namespace std {
inline double
abs(double __x) { return __builtin_fabs(__x); }
#else
inline double
abs(double __x) { return ::fabs(__x); }
extern "C" double abs(double __x);
#endif
inline double
acos(double __x) { return ::acos(__x); }
extern "C" double acos(double __x);
inline double
asin(double __x) { return ::asin(__x); }
extern "C" double asin(double __x);
inline double
atan(double __x) { return ::atan(__x); }
extern "C" double atan(double __x);
inline double
atan2(double __y, double __x) { return ::atan2(__y, __x); }
extern "C" double atan2(double __y, double __x);
inline double
ceil(double __x) { return ::ceil(__x); }
extern "C" double ceil(double __x);
#if _GLIBCPP_HAVE___BUILTIN_COS
inline double
cos(double __x) { return __builtin_cos(__x); }
#else
inline double
cos(double __x) { return ::cos(__x); }
extern "C" double cos(double __x);
#endif
inline double cosh(double __x)
{ return ::cosh(__x); }
inline double
exp(double __x) { return ::exp(__x); }
extern "C" double cosh(double __x);
extern "C" double exp(double __x);
#if _GLIBCPP_HAVE___BUILTIN_FABS
inline double
fabs(double __x) { return __builtin_fabs(__x); }
#else
inline double
fabs(double __x) { return ::fabs(__x); }
extern "C" double fabs(double __x);
#endif
inline double
floor(double __x) { return ::floor(__x); }
extern "C" double floor(double __x);
inline double
fmod(double __x, double __y) { return ::fmod(__x, __y); }
extern "C" double fmod(double __x, double __y);
inline double
frexp(double __x, int* __exp) { return ::frexp(__x, __exp); }
extern "C" double frexp(double __x, int* __exp);
inline double
ldexp(double __x, int __exp) { return ::ldexp(__x, __exp); }
extern "C" double ldexp(double __x, int __exp);
inline double
log(double __x) { return ::log(__x); }
extern "C" double log(double __x);
inline double
log10(double __x) { return ::log10(__x); }
extern "C" double log10(double __x);
inline double
modf(double __x, double* __iptr) { return ::modf(__x, __iptr); }
extern "C" double modf(double __x, double* __iptr);
inline double
pow(double __x, double __y) { return ::pow(__x, __y); }
#if 0
extern "C" double pow(double __x, double __y);
double pow (double, int);
extern "C" double pow(double, int);
#endif
using ::pow;
#if _GLIBCPP_HAVE___BUILTIN_SIN
inline double
sin(double __x) { return __builtin_sin(__x); }
#else
inline double
sin(double __x) { return ::sin(__x); }
extern "C" double sin(double __x);
#endif
inline double
sinh(double __x) { return ::sinh(__x); }
extern "C" double sinh(double __x);
#if _GLIBCPP_HAVE___BUILTIN_SQRT
inline double
sqrt(double __x) { return __builtin_fsqrt(__x); }
#else
inline double
sqrt(double __x) { return ::sqrt(__x); }
extern "C" double sqrt(double __x);
#endif
inline double
tan(double __x) { return ::tan(__x); }
extern "C" double tan(double __x);
inline double
tanh(double __x) { return ::tanh(__x); }
extern "C" double tanh(double __x);
#if _GLIBCPP_HAVE___BUILTIN_FABSL
......
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