diff options
author | Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> | 2003-10-01 20:45:59 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2003-10-01 20:45:59 +0000 |
commit | 222a5b1d6701dd5de06526b4bc4523a807b160c7 (patch) | |
tree | 87d652c1311b337bc04b5fca130c7262b1a2cf59 /libstdc++-v3/linkage.m4 | |
parent | 64177a6d2fa28f4dcb1ade1fcd6164809fcff9ad (diff) | |
download | gcc-222a5b1d6701dd5de06526b4bc4523a807b160c7.tar.gz |
linkage.m4 (GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0): Define.
* linkage.m4 (GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0): Define.
(GLIBCXX_CHECK_STDLIB_SUPPORT): Use it to test for lrand48
instead of drand48.
* acconfig.h (HAVE_DRAND48): Renamed to HAVE_LRAND48.
* crossconfig.m4 (*-freebsd*): Define HAVE_LRAND48 instead of
HAVE_DRAND48.
* config.h.in, configure: Regenerate.
* include/bits/stl_algo.h: Use _GLIBCXX_HAVE_LRAND48 to guard
lrand48 use.
From-SVN: r71990
Diffstat (limited to 'libstdc++-v3/linkage.m4')
-rw-r--r-- | libstdc++-v3/linkage.m4 | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/libstdc++-v3/linkage.m4 b/libstdc++-v3/linkage.m4 index fc4e22924b9..9597635359c 100644 --- a/libstdc++-v3/linkage.m4 +++ b/libstdc++-v3/linkage.m4 @@ -173,6 +173,35 @@ dnl 2) has "C" linkage dnl dnl argument 1 is name of function to check dnl +dnl ASSUMES argument is a stdlib function without parameters +dnl +dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0 +AC_DEFUN(GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0, [ + 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 <stdlib.h>], + [ $1();], + [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_CHECK_FUNCS($1) + fi +]) + + +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 argument 1 is name of function to check +dnl dnl ASSUMES argument is a math function with TWO parameters dnl dnl GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2 @@ -342,7 +371,7 @@ dnl This might seem like overkill but experience has shown that it's not... dnl dnl Define HAVE_STRTOLD if "strtold" is declared and links dnl Define HAVE_STRTOF if "strtof" is declared and links -dnl Define HAVE_DRAND48 if "drand48" is declared and links +dnl Define HAVE_LRAND48 if "lrand48" is declared and links dnl dnl GLIBCXX_CHECK_STDLIB_SUPPORT AC_DEFUN(GLIBCXX_CHECK_STDLIB_SUPPORT, [ @@ -352,7 +381,7 @@ AC_DEFUN(GLIBCXX_CHECK_STDLIB_SUPPORT, [ GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold) GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof) - AC_CHECK_FUNCS(drand48) + GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0(lrand48) CXXFLAGS="$ac_save_CXXFLAGS" ]) |