diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-15 08:06:35 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-15 08:06:35 +0000 |
commit | 9b15111cffd15236d70546f296b2e9b0efe4953c (patch) | |
tree | a5b34ca6b5f3cae8764d0aeaf4a20d6f55e91277 /libstdc++-v3/acinclude.m4 | |
parent | e5a82780fe5fdfdaf5bcaaeb86edc0804bd8906a (diff) | |
download | gcc-9b15111cffd15236d70546f296b2e9b0efe4953c.tar.gz |
2002-11-15 Paolo Carlini <pcarlini@unitus.it>
Loren J. Rittle <ljrittle@acm.org>
PR libstdc++/8399
* acinclude.m4
(GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1): New macro to
check for unistd.h functions.
(GLIBCPP_CHECK_UNISTD_SUPPORT): New macro, check for isatty
in unistd.h.
* configure.in: Call here.
* src/ios.cc (ios_base::Init::_S_ios_create(bool)):
Use _GLIBCPP_HAVE_ISATTY: ifdef, in case of interactive
input __in_size = 1 even when sync_with_stdio is false;
otherwise fall back to __in_size = 1.
* aclocal.m4: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59118 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/acinclude.m4')
-rw-r--r-- | libstdc++-v3/acinclude.m4 | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 2bfec92da0f..017731f41cb 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -591,6 +591,33 @@ AC_DEFUN(GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3, [ fi ]) +dnl +dnl Check to see if the (unistd 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 function with ONE parameter +dnl +dnl GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1 +AC_DEFUN(GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1, [ + AC_MSG_CHECKING([for $1 declaration]) + if test x${glibcpp_cv_func_$1_use+set} != xset; then + AC_CACHE_VAL(glibcpp_cv_func_$1_use, [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include <unistd.h>], + [ $1(0);], + [glibcpp_cv_func_$1_use=yes], [glibcpp_cv_func_$1_use=no]) + AC_LANG_RESTORE + ]) + fi + 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, @@ -702,9 +729,8 @@ AC_DEFUN(GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT, [ fi ]) - dnl -dnl Check to see what the underlying c library +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 dnl 2) make sure the name has "C" linkage @@ -727,6 +753,25 @@ AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [ CXXFLAGS="$ac_save_CXXFLAGS" ]) +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 +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_ISATTY if "isatty" is declared and links +dnl +dnl GLIBCPP_CHECK_UNISTD_SUPPORT +AC_DEFUN(GLIBCPP_CHECK_UNISTD_SUPPORT, [ + ac_test_CXXFLAGS="${CXXFLAGS+set}" + ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS='-fno-builtins -D_GNU_SOURCE' + + GLIBCPP_CHECK_UNISTD_DECL_AND_LINKAGE_1(isatty) + + CXXFLAGS="$ac_save_CXXFLAGS" +]) dnl dnl Check to see what the underlying c library or math library is like. |