Commit 8b8ab21c by Benjamin Kosnik

acconfig.h: List _GLIBCPP_USE_THREADS.


2000-10-24  Phil Edwards  <pme@sources.redhat.com>

        * acconfig.h:  List _GLIBCPP_USE_THREADS.
        * acinclude.m4:  General formatting cleanup (tabs/spaces), typo
          correction, etc.  Add comments about following *real* changes
          where they are used.
          (GLIBCPP_ENABLE_C_MBCHAR):  New test...
          (GLIBCPP_CHECK_WCHAR_T_SUPPORT):  ...results used here.
          (GLIBCPP_ENABLE_CSTDIO):  Define need_wlibio iff wide characters
          are requested.
          (GLIBCPP_ENABLE_THREADS):  If threads are used, define new
          macro _GLIBCPP_USE_THREADS in c++config.h.
          (GLIBCPP_ENABLE_SHADOW):  For C_INCLUDE_DIR, change () to {} as
          this is used in both makefiles and shell scripts (mkcheck).
        * configure.in:  Call GLIBCPP_ENABLE_C_MBCHAR.

        * libio/_G_config.h:  Wrap _IO_MTSAFE_IO in _GLIBCPP_USE_THREADS.
        * config/c_io_libio.h:  In nonthreaded case, typedef __c_lock to
          something harmless, like int.

        * config/os/aix/bits/os_defines.h:  Guard with _GLIBCPP_OS_DEFINES,
          add comment/instructions.
        * config/os/bsd/bits/os_defines.h:  Ditto.
        * config/os/generic/bits/os_defines.h:  Ditto.
        * config/os/gnu-linux/bits/os_defines.h:  Ditto.
        * config/os/irix/bits/os_defines.h:  Ditto.
        * config/os/newlib/bits/os_defines.h:  Ditto.
        * config/os/solaris/solaris2.5/bits/os_defines.h:  Ditto.
        * config/os/solaris/solaris2.6/bits/os_defines.h:  Ditto.

        * mkcheck.in:  Limit the available heap size for testsuite
          binaries, initially at 2MB.

From-SVN: r37050
parent 9aa1d5ac
2000-10-24 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/stl_pair.h (make_pair): Add LWG solution.
* testsuite/21_strings/compare.cc (test01): Inject namespace std
into the mix.
* mkcheck.in (MAX_MEM_USAGE): Bump up to 3072. Strangely enough,
this works.
2000-10-24 Levente Farkas <lfarkas@mindmaker.hu>
* include/bits/std_bitset.h (_M_do_find_next): Fix typo.
2000-10-24 Phil Edwards <pme@sources.redhat.com>
* acconfig.h: List _GLIBCPP_USE_THREADS.
* acinclude.m4: General formatting cleanup (tabs/spaces), typo
correction, etc. Add comments about following *real* changes
where they are used.
(GLIBCPP_ENABLE_C_MBCHAR): New test...
(GLIBCPP_CHECK_WCHAR_T_SUPPORT): ...results used here.
(GLIBCPP_ENABLE_CSTDIO): Define need_wlibio iff wide characters
are requested.
(GLIBCPP_ENABLE_THREADS): If threads are used, define new
macro _GLIBCPP_USE_THREADS in c++config.h.
(GLIBCPP_ENABLE_SHADOW): For C_INCLUDE_DIR, change () to {} as
this is used in both makefiles and shell scripts (mkcheck).
* configure.in: Call GLIBCPP_ENABLE_C_MBCHAR.
* libio/_G_config.h: Wrap _IO_MTSAFE_IO in _GLIBCPP_USE_THREADS.
* config/c_io_libio.h: In nonthreaded case, typedef __c_lock to
something harmless, like int.
* config/os/aix/bits/os_defines.h: Guard with _GLIBCPP_OS_DEFINES,
add comment/instructions.
* config/os/bsd/bits/os_defines.h: Ditto.
* config/os/generic/bits/os_defines.h: Ditto.
* config/os/gnu-linux/bits/os_defines.h: Ditto.
* config/os/irix/bits/os_defines.h: Ditto.
* config/os/newlib/bits/os_defines.h: Ditto.
* config/os/solaris/solaris2.5/bits/os_defines.h: Ditto.
* config/os/solaris/solaris2.6/bits/os_defines.h: Ditto.
* mkcheck.in: Limit the available heap size for testsuite
binaries, initially at 2MB.
2000-10-23 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/21_strings/compare.cc (test01): Add using declarations.
* include/c_std/bits/std_cerrno.h: And here.
* include/c_std/bits/std_cassert.h: Tweaks.
* mkcheck.in: Simplify.
* acinclude.m4 (GLIBCPP_ENABLE_LONG_DOUBLE): Simplify.
(GLIBCPP_ENABLE_LONG_LONG): Same.
* aclocal.m4: Regenerate.
* src/Makefile.am (c_shadow_headers): Add features.h,
bits/wrap_features.h.
* src/Makefile.in: Regenerate.
* include/c_std/features.h: New file.
* include/c_std/bits/wrap_features.h (_CPP_WRAP_FEATURES_H): New
file. Need to have c++config.h included before this file so
_ISOC99_SOURCE around.
* include/c_std/sys/cdefs.h: Hack.
* include/c_std/stdlib.h: Same, use c++config.h.
* include/c_std/bits/std_cstdlib.h: Use _GLIBCPP_HAVE_STRTOLD.
* include/c_std/bits/std_cassert.h: Fix.
* include/c_std/bits/std_cerrno.h: Make consistent.
* include/c_std/bits/std_csetjmp.h (setjmp): Unscope global
declaration from ::_C_legacy to _C_legacy.
* include/c_std/bits/std_cstdio.h: same with printf.
* include/c_std/stdio.h: And here.
* include/c_std/bits/std_cstdlib.h: abort, exit comment.
* include/c_std/stdlib.h: Same here.
2000-10-23 Benjamin Kosnik <bkoz@redhat.com> 2000-10-23 Benjamin Kosnik <bkoz@redhat.com>
* testsuite/21_strings/compare.cc (test01): Add using declarations. * testsuite/21_strings/compare.cc (test01): Add using declarations.
......
// acconfig.h symbols and macros for libstdc++ v3 -*- C++ -*- // acconfig.h symbols and macros for libstdc++ v3 -*- C++ -*-
// Include support for multiple threads, e.g., in the I/O package.
#undef _GLIBCPP_USE_THREADS
// Include support for 'long long' and 'unsigned long long'. // Include support for 'long long' and 'unsigned long long'.
#undef _GLIBCPP_USE_LONG_LONG #undef _GLIBCPP_USE_LONG_LONG
......
...@@ -137,8 +137,8 @@ LIB_AC_PROG_CXX ...@@ -137,8 +137,8 @@ LIB_AC_PROG_CXX
fi fi
# configure.host sets the following important variables # configure.host sets the following important variables
# glibcpp_cflags - host specific C compiler flags # glibcpp_cflags - host specific C compiler flags
# glibcpp_cxxflags - host specific C++ compiler flags # glibcpp_cxxflags - host specific C++ compiler flags
glibcpp_cflags= glibcpp_cflags=
glibcpp_cxxflags= glibcpp_cxxflags=
...@@ -168,7 +168,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [ ...@@ -168,7 +168,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
ok ok
#endif #endif
], gpp_satisfactory=yes, AC_MSG_ERROR("please upgrade to gcc-2.95 or above")) ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to gcc-2.95 or above]))
AC_MSG_RESULT($gpp_satisfactory) AC_MSG_RESULT($gpp_satisfactory)
]) ])
...@@ -668,7 +668,7 @@ dnl Check to see if there is native support for complex ...@@ -668,7 +668,7 @@ dnl Check to see if there is native support for complex
dnl dnl
dnl Don't compile bits in math/* if native support exits. dnl Don't compile bits in math/* if native support exits.
dnl dnl
dnl Define USE_COMPLEX_LONG_DOUBLE etc if "cargf" is found. dnl Define USE_COMPLEX_LONG_DOUBLE etc if "atan2l/copysignl" is found.
dnl dnl
dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
...@@ -701,34 +701,34 @@ dnl GLIBCPP_CHECK_CPU ...@@ -701,34 +701,34 @@ dnl GLIBCPP_CHECK_CPU
AC_DEFUN(GLIBCPP_CHECK_CPU, [ AC_DEFUN(GLIBCPP_CHECK_CPU, [
AC_MSG_CHECKING([for cpu config directory]) AC_MSG_CHECKING([for cpu config directory])
# Currently unused, but could be useful. # Currently unused, but could be useful.
# CPU_FLAGS= # CPU_FLAGS=
case "${target_cpu}" in case "${target_cpu}" in
alpha*) alpha*)
cpu_include_dir="config/cpu/alpha" cpu_include_dir="config/cpu/alpha"
;; ;;
arm*) arm*)
cpu_include_dir="config/cpu/arm" cpu_include_dir="config/cpu/arm"
;; ;;
ia64) ia64)
cpu_include_dir="config/cpu/ia64" cpu_include_dir="config/cpu/ia64"
;; ;;
i386) i386)
cpu_include_dir="config/cpu/i386" cpu_include_dir="config/cpu/i386"
;; ;;
i486 | i586 | i686 | i786) i486 | i586 | i686 | i786)
cpu_include_dir="config/cpu/i486" cpu_include_dir="config/cpu/i486"
;; ;;
powerpc | rs6000) powerpc | rs6000)
cpu_include_dir="config/cpu/powerpc" cpu_include_dir="config/cpu/powerpc"
;; ;;
sparc64 | ultrasparc) sparc64 | ultrasparc)
cpu_include_dir="config/cpu/sparc/sparc64" cpu_include_dir="config/cpu/sparc/sparc64"
;; ;;
sparc*) sparc*)
cpu_include_dir="config/cpu/sparc/sparc32" cpu_include_dir="config/cpu/sparc/sparc32"
;; ;;
*) *)
cpu_include_dir="config/cpu/generic" cpu_include_dir="config/cpu/generic"
;; ;;
esac esac
AC_MSG_RESULT($cpu_include_dir) AC_MSG_RESULT($cpu_include_dir)
...@@ -745,28 +745,28 @@ AC_DEFUN(GLIBCPP_CHECK_OS, [ ...@@ -745,28 +745,28 @@ AC_DEFUN(GLIBCPP_CHECK_OS, [
# OS_FLAGS= # OS_FLAGS=
case "${target_os}" in case "${target_os}" in
aix*) aix*)
os_include_dir="config/os/aix" os_include_dir="config/os/aix"
;; ;;
bsd* | freebsd*) bsd* | freebsd*)
os_include_dir="config/os/bsd" os_include_dir="config/os/bsd"
;; ;;
linux*) linux*)
os_include_dir="config/os/gnu-linux" os_include_dir="config/os/gnu-linux"
;; ;;
irix*) irix*)
os_include_dir="config/os/irix" os_include_dir="config/os/irix"
;; ;;
solaris2.5*) solaris2.5*)
os_include_dir="config/os/solaris/solaris2.5" os_include_dir="config/os/solaris/solaris2.5"
;; ;;
solaris2.6*) solaris2.6*)
os_include_dir="config/os/solaris/solaris2.6" os_include_dir="config/os/solaris/solaris2.6"
;; ;;
solaris2.7* | solaris2.8*) solaris2.7* | solaris2.8*)
os_include_dir="config/os/solaris/solaris2.7" os_include_dir="config/os/solaris/solaris2.7"
;; ;;
*) *)
os_include_dir="config/os/generic" os_include_dir="config/os/generic"
;; ;;
esac esac
AC_MSG_RESULT($os_include_dir) AC_MSG_RESULT($os_include_dir)
...@@ -795,8 +795,8 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -795,8 +795,8 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
[int [int
foo (int a) foo (int a)
{ return _ISspace + _ISprint + _IScntrl + _ISupper + _ISlower + _ISalpha \ { return _ISspace + _ISprint + _IScntrl + _ISupper + _ISlower + _ISalpha \
+ _ISdigit + _ISpunct + _ISxdigit + _ISalnum + _ISgraph \ + _ISdigit + _ISpunct + _ISxdigit + _ISalnum + _ISgraph \
+ __ctype_tolower[a] + __ctype_toupper[a] + __ctype_b[a];}], \ + __ctype_tolower[a] + __ctype_toupper[a] + __ctype_b[a];}], \
ctype_linux=yes, ctype_linux=no) ctype_linux=yes, ctype_linux=no)
AC_MSG_RESULT($ctype_linux) AC_MSG_RESULT($ctype_linux)
if test $ctype_linux = "yes"; then if test $ctype_linux = "yes"; then
...@@ -811,7 +811,7 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -811,7 +811,7 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
[int [int
foo (int a) foo (int a)
{ return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \ { return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \
+ _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}], \ + _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}], \
ctype_bsd=yes, ctype_bsd=no) ctype_bsd=yes, ctype_bsd=no)
AC_MSG_RESULT($ctype_bsd) AC_MSG_RESULT($ctype_bsd)
if test $ctype_bsd = "yes"; then if test $ctype_bsd = "yes"; then
...@@ -843,8 +843,8 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -843,8 +843,8 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
[int [int
foo (int a) foo (int a)
{ return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \ { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
+ _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \ + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
+ __trans_lower[a] + __trans_upper[a] + __ctype_mask[a];}], \ + __trans_lower[a] + __trans_upper[a] + __ctype_mask[a];}], \
ctype_solaris=yes, ctype_solaris=no) ctype_solaris=yes, ctype_solaris=no)
AC_MSG_RESULT($ctype_solaris) AC_MSG_RESULT($ctype_solaris)
...@@ -874,7 +874,7 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -874,7 +874,7 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
[int [int
foo (int a) foo (int a)
{ return _U + _L + _N + _S + _P + _C + _X + _B \ { return _U + _L + _N + _S + _P + _C + _X + _B \
+ __ctype[a];}], \ + __ctype[a];}], \
ctype_solaris25=yes, ctype_solaris25=no) ctype_solaris25=yes, ctype_solaris25=no)
AC_MSG_RESULT($ctype_solaris25) AC_MSG_RESULT($ctype_solaris25)
if test $ctype_solaris25 = "yes"; then if test $ctype_solaris25 = "yes"; then
...@@ -890,8 +890,8 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -890,8 +890,8 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
[int [int
foo (int a) foo (int a)
{ return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \ { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
+ _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \ + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
+ _VALC('a') + _IS('c', 0);}], \ + _VALC('a') + _IS('c', 0);}], \
ctype_aix=yes, ctype_aix=no) ctype_aix=yes, ctype_aix=no)
AC_MSG_RESULT($ctype_aix) AC_MSG_RESULT($ctype_aix)
if test $ctype_aix = "yes"; then if test $ctype_aix = "yes"; then
...@@ -907,7 +907,7 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -907,7 +907,7 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
[int [int
foo (int a) foo (int a)
{ return _U + _L + _N + _S + _P + _C + _X + _B \ { return _U + _L + _N + _S + _P + _C + _X + _B \
+ _ctype_[a];}], \ + _ctype_[a];}], \
ctype_newlib=yes, ctype_newlib=no) ctype_newlib=yes, ctype_newlib=no)
AC_MSG_RESULT($ctype_newlib) AC_MSG_RESULT($ctype_newlib)
if test $ctype_newlib = "yes"; then if test $ctype_newlib = "yes"; then
...@@ -931,94 +931,103 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -931,94 +931,103 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
dnl dnl
dnl Check to see if this target can enable the wchar_t parts of libstdc++. dnl Check to see if this target can enable the wchar_t parts of libstdc++.
dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
dnl must have been previously checked.)
dnl dnl
dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
dnl Define _GLIBCPP_NEED_MBSTATE_T if mbstate_t is not in wchar.h dnl Define _GLIBCPP_NEED_MBSTATE_T if mbstate_t is not in wchar.h
dnl dnl
dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
if test x$enable_c_mbchar != xno; then
dnl Sanity check for existence of ISO C9X headers for extended encoding.
AC_CHECK_HEADER(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no) dnl Sanity check for existence of ISO C9X headers for extended encoding.
AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no) AC_CHECK_HEADER(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
dnl Only continue checking if the ISO C9X headers exist.
if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes; then dnl Only continue checking if the ISO C9X headers exist.
if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes; then
dnl Test wchar.h for mbstate_t, which is needed for char_traits and others.
AC_MSG_CHECKING([for mbstate_t])
AC_TRY_COMPILE([#include <wchar.h>],
[mbstate_t teststate;],
use_native_mbstatet=yes, use_native_mbstatet=no)
AC_MSG_RESULT($use_native_mbstatet)
if test x"$use_native_mbstatet" = xno; then
AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
fi
dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before dnl Test wchar.h for mbstate_t, which is needed for char_traits
dnl numeric_limits can instantiate type_traits<wchar_t> dnl and others.
AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX]) AC_MSG_CHECKING([for mbstate_t])
AC_TRY_COMPILE([#include <wchar.h>], AC_TRY_COMPILE([#include <wchar.h>],
[int i = WCHAR_MIN; int j = WCHAR_MAX;], [mbstate_t teststate;],
has_wchar_minmax=yes, has_wchar_minmax=no) use_native_mbstatet=yes, use_native_mbstatet=no)
AC_MSG_RESULT($has_wchar_minmax) AC_MSG_RESULT($use_native_mbstatet)
if test x"$use_native_mbstatet" = xno; then
AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
fi
dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
dnl numeric_limits can instantiate type_traits<wchar_t>
AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
AC_TRY_COMPILE([#include <wchar.h>],
[int i = WCHAR_MIN; int j = WCHAR_MAX;],
has_wchar_minmax=yes, has_wchar_minmax=no)
AC_MSG_RESULT($has_wchar_minmax)
dnl Test wchar.h for WEOF, which is what we use to determine whether
dnl to specialize for char_traits<wchar_t> or not.
AC_MSG_CHECKING([for WEOF])
AC_TRY_COMPILE([
#include <wchar.h>
#include <stddef.h>],
[wint_t i = WEOF;],
has_weof=yes, has_weof=no)
AC_MSG_RESULT($has_weof)
dnl Tests for wide character functions used in char_traits<wchar_t>.
AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
wcsrtombs mbsrtowcs, ac_wfuncs=yes, ac_wfuncs=no)
AC_MSG_CHECKING([for ISO C9X wchar_t support])
if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
&& test x"$ac_wfuncs" = xyes; then
ac_isoC9X_wchar_t=yes
else
ac_isoC9X_wchar_t=no
fi
AC_MSG_RESULT($ac_isoC9X_wchar_t)
dnl Use iconv for wchar_t to char conversions. As such, check for
dnl X/Open Portability Guide, version 2 features (XPG2).
AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
ac_XPG2funcs=yes, ac_XPG2funcs=no)
AC_MSG_CHECKING([for XPG2 wchar_t support])
if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes \
&& test x"$ac_XPG2funcs" = xyes; then
ac_XPG2_wchar_t=yes
else
ac_XPG2_wchar_t=no
fi
AC_MSG_RESULT($ac_XPG2_wchar_t)
dnl At the moment, only enable wchar_t specializations if all the
dnl above support is present.
AC_MSG_CHECKING([for enabled wchar_t specializations])
if test x"$ac_isoC9X_wchar_t" = xyes \
&& test x"$ac_XPG2_wchar_t" = xyes; then
libinst_wstring_la="libinst-wstring.la"
AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
AC_MSG_RESULT("yes")
else
libinst_wstring_la=""
AC_MSG_RESULT("no")
fi
AC_SUBST(libinst_wstring_la)
dnl Test wchar.h for WEOF, which is what we use to determine whether
dnl to specialize for char_traits<wchar_t> or not.
AC_MSG_CHECKING([for WEOF])
AC_TRY_COMPILE([
#include <wchar.h>
#include <stddef.h>],
[wint_t i = WEOF;],
has_weof=yes, has_weof=no)
AC_MSG_RESULT($has_weof)
dnl Tests for wide character functions used in char_traits<wchar_t>.
AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
wcsrtombs mbsrtowcs, ac_wfuncs=yes, ac_wfuncs=no)
AC_MSG_CHECKING([for ISO C9X wchar_t support])
if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
&& test x"$ac_wfuncs" = xyes; then
ac_isoC9X_wchar_t=yes
else
ac_isoC9X_wchar_t=no
fi
AC_MSG_RESULT($ac_isoC9X_wchar_t)
dnl Use iconv for wchar_t to char conversions. As such, check for
dnl X/Open Portability Guide, version 2 features (XPG2).
AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
ac_XPG2funcs=yes, ac_XPG2funcs=no)
AC_MSG_CHECKING([for XPG2 wchar_t support])
if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes \
&& test x"$ac_XPG2funcs" = xyes; then
ac_XPG2_wchar_t=yes
else
ac_XPG2_wchar_t=no
fi
AC_MSG_RESULT($ac_XPG2_wchar_t)
dnl At the moment, only enable wchar_t specializations if all the
dnl above support is present.
AC_MSG_CHECKING([for enabled wchar_t specializations])
if test x"$ac_isoC9X_wchar_t" = xyes \
&& test x"$ac_XPG2_wchar_t" = xyes; then
libinst_wstring_la="libinst-wstring.la"
AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
AC_MSG_RESULT("yes")
else else
libinst_wstring_la="" AC_MSG_WARN([<wchar.h> not found])
AC_MSG_RESULT("no") AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
fi fi
AC_SUBST(libinst_wstring_la)
else else
AC_MSG_WARN([<wchar.h> not found]) dnl Wide characters disabled by the user. Maybe print a warning?
AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T) :
fi fi
]) ])
...@@ -1044,8 +1053,8 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [ ...@@ -1044,8 +1053,8 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \ AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
dcomplex f(const dcomplex& x) { return dcomplex(x); }], \ dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
[ dcomplex x; f(x); ], [ dcomplex x; f(x); ],
glibcpp_cv_complex=ok, glibcpp_cv_complex=ok,
glibcpp_cv_complex=buggy glibcpp_cv_complex=buggy
) )
...@@ -1120,10 +1129,10 @@ enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl ...@@ -1120,10 +1129,10 @@ enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
dnl Option parsed, now set things appropriately dnl Option parsed, now set things appropriately
case "${enable_debug}" in case "${enable_debug}" in
yes) yes)
DEBUG_FLAGS='-O0 -ggdb' DEBUG_FLAGS='-O0 -ggdb'
;; ;;
no) no)
DEBUG_FLAGS='-g' DEBUG_FLAGS='-g'
;; ;;
esac esac
AC_SUBST(DEBUG_FLAGS) AC_SUBST(DEBUG_FLAGS)
...@@ -1154,11 +1163,11 @@ changequote(<<, >>)dnl ...@@ -1154,11 +1163,11 @@ changequote(<<, >>)dnl
changequote([, ])dnl changequote([, ])dnl
[case "x$enableval" in [case "x$enableval" in
xyes) xyes)
AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;; AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
xno|x) xno|x)
enable_cxx_flags='' ;; enable_cxx_flags='' ;;
*) *)
enable_cxx_flags="$enableval" ;; enable_cxx_flags="$enableval" ;;
esac], esac],
enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT') enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
...@@ -1198,13 +1207,13 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [ ...@@ -1198,13 +1207,13 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
[ --enable-cstdio enable GNU libio for target io package. (default) [ --enable-cstdio enable GNU libio for target io package. (default)
--enable-cstdio=LIB use LIB target-speific io package.], --enable-cstdio=LIB use LIB target-speific io package.],
if test x$enable_cstdio = xno; then if test x$enable_cstdio = xno; then
enable_cstdio=libio enable_cstdio=libio
fi, fi,
enable_cstdio=libio) enable_cstdio=libio)
enable_cstdio_flag=$enable_cstdio enable_cstdio_flag=$enable_cstdio
dnl Check if a valid thread package dnl Check if a valid I/O package
case x${enable_cstdio_flag} in case x${enable_cstdio_flag} in
xlibio | x | xno | xnone | xyes) xlibio | x | xno | xnone | xyes)
# default # default
...@@ -1221,38 +1230,48 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [ ...@@ -1221,38 +1230,48 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
if test x$has_libio = x"yes"; then if test x$has_libio = x"yes"; then
case "$target" in case "$target" in
*-*-linux*) *-*-linux*)
AC_MSG_CHECKING([for glibc version >= 2.2]) AC_MSG_CHECKING([for glibc version >= 2.2])
AC_EGREP_CPP([ok], [ AC_EGREP_CPP([ok], [
#include <features.h> #include <features.h>
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
ok ok
#endif #endif
], glibc_satisfactory=yes, glibc_satisfactory=no) ], glibc_satisfactory=yes, glibc_satisfactory=no)
AC_MSG_RESULT($glibc_satisfactory) AC_MSG_RESULT($glibc_satisfactory)
;; ;;
esac esac
# XXX at the moment, admit defeat and force the recompilation # XXX at the moment, admit defeat and force the recompilation
# XXX of glibc even on glibc-2.2 systems, because libio is not synched. # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
glibc_satisfactory=no glibc_satisfactory=no
if test x$glibc_satisfactory = x"yes"; then if test x$glibc_satisfactory = x"yes"; then
need_libio=no need_libio=no
need_xtra_libio=no need_xtra_libio=no
need_wlibio=no need_wlibio=no
else else
need_libio=yes need_libio=yes
need_xtra_libio=yes need_xtra_libio=yes
# bkoz XXX need to add checks to enable this # bkoz XXX need to add checks to enable this
need_wlibio=yes # pme XXX here's a first pass at such a check
fi if test x$enable_c_mbchar != xno; then
need_wlibio=yes
else
need_wlibio=no
fi
fi
# Using libio, but <libio.h> doesn't exist on the target system. . . # Using libio, but <libio.h> doesn't exist on the target system. . .
else else
need_libio=yes need_libio=yes
need_xtra_libio=no need_xtra_libio=no
# bkoz XXX need to add checks to enable this # bkoz XXX need to add checks to enable this
need_wlibio=no # pme XXX here's a first pass at such a check
if test x$enable_c_mbchar != xno; then
need_wlibio=yes
else
need_wlibio=no
fi
fi fi
;; ;;
...@@ -1275,7 +1294,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [ ...@@ -1275,7 +1294,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
CCODECVT_C=config/c_io_libio_codecvt.c CCODECVT_C=config/c_io_libio_codecvt.c
AC_LINK_FILES($CCODECVT_C, libio/c_codecvt.c) AC_LINK_FILES($CCODECVT_C, libio/c_codecvt.c)
# 2000-08-04 bkoz hack # 2000-08-04 bkoz hack
AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes) AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
AM_CONDITIONAL(GLIBCPP_NEED_XTRA_LIBIO, test "$need_xtra_libio" = yes) AM_CONDITIONAL(GLIBCPP_NEED_XTRA_LIBIO, test "$need_xtra_libio" = yes)
AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes) AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
...@@ -1288,7 +1307,8 @@ dnl ...@@ -1288,7 +1307,8 @@ dnl
dnl GLIBCPP_ENABLE_THREADS dnl GLIBCPP_ENABLE_THREADS
dnl --enable-threads=posix sets config/threads-posix.h et. al. dnl --enable-threads=posix sets config/threads-posix.h et. al.
dnl dnl
dnl default is no threads dnl Default is no threads, which also disables _IO_MTSAFE_IO in
dnl libio. Any actual thread package will enable it.
dnl dnl
AC_DEFUN(GLIBCPP_ENABLE_THREADS, [ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
dnl Note this comes from the gcc/config.in and libjava/config.in dnl Note this comes from the gcc/config.in and libjava/config.in
...@@ -1306,22 +1326,22 @@ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [ ...@@ -1306,22 +1326,22 @@ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
dnl Check if a valid thread package dnl Check if a valid thread package
case x${enable_threads_flag} in case x${enable_threads_flag} in
x | xno | xnone) x | xno | xnone)
# No threads # No threads
target_thread_file='single' target_thread_file='single'
;; ;;
xyes) xyes)
# default # default
target_thread_file='' target_thread_file=''
;; ;;
xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \ xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
xsolaris | xwin32 | xdce | xvxworks) xsolaris | xwin32 | xdce | xvxworks)
target_thread_file=$enable_threads_flag target_thread_file=$enable_threads_flag
;; ;;
*) *)
echo "$enable_threads is an unknown thread package" 1>&2 echo "$enable_threads is an unknown thread package" 1>&2
exit 1 exit 1
;; ;;
esac esac
dnl Check for thread package actually supported in libstdc++ dnl Check for thread package actually supported in libstdc++
...@@ -1343,6 +1363,9 @@ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [ ...@@ -1343,6 +1363,9 @@ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
AC_MSG_RESULT($THREADH) AC_MSG_RESULT($THREADH)
AC_LINK_FILES(config/$THREADH, bits/c++threads.h) AC_LINK_FILES(config/$THREADH, bits/c++threads.h)
if test $THREADH != threads-no.h; then
AC_DEFINE(_GLIBCPP_USE_THREADS)
fi
]) ])
...@@ -1351,16 +1374,16 @@ dnl GLIBCPP_ENABLE_ATOMICITY ...@@ -1351,16 +1374,16 @@ dnl GLIBCPP_ENABLE_ATOMICITY
AC_DEFUN(GLIBCPP_ENABLE_ATOMICITY, [ AC_DEFUN(GLIBCPP_ENABLE_ATOMICITY, [
AC_MSG_CHECKING([for atomicity.h]) AC_MSG_CHECKING([for atomicity.h])
case "$target" in case "$target" in
*-*-linux*) *-*-linux* | sparc*-*-*)
ATOMICITYH=$cpu_include_dir ATOMICITYH=$cpu_include_dir
;; ;;
*-*-aix*) *-*-aix*)
ATOMICITYH=$os_include_dir ATOMICITYH=$os_include_dir
;; ;;
*) *)
echo "$enable_threads is an unknown thread package" 1>&2 # bit of overkill on this text...
exit 1 AC_MSG_ERROR([Atomic locking requested, but $enable_threads is an unknown thread package and atomic operations are not present in the CPU])
;; ;;
esac esac
AC_MSG_RESULT($ATOMICITYH/bits/atomicity.h) AC_MSG_RESULT($ATOMICITYH/bits/atomicity.h)
AC_LINK_FILES($ATOMICITYH/bits/atomicity.h, bits/atomicity.h) AC_LINK_FILES($ATOMICITYH/bits/atomicity.h, bits/atomicity.h)
...@@ -1473,11 +1496,11 @@ changequote(<<, >>)dnl ...@@ -1473,11 +1496,11 @@ changequote(<<, >>)dnl
changequote([, ]) changequote([, ])
[case "$enableval" in [case "$enableval" in
yes) enable_cshadow_headers=yes yes) enable_cshadow_headers=yes
;; ;;
no) enable_cshadow_headers=no no) enable_cshadow_headers=no
;; ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers]) *) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers])
;; ;;
esac], esac],
enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT) enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT)
AC_MSG_RESULT($enable_cshadow_headers) AC_MSG_RESULT($enable_cshadow_headers)
...@@ -1486,13 +1509,13 @@ changequote([, ]) ...@@ -1486,13 +1509,13 @@ changequote([, ])
dnl NB: these things may be duplicated in c++config.h as well. dnl NB: these things may be duplicated in c++config.h as well.
case "$enable_cshadow_headers" in case "$enable_cshadow_headers" in
yes) yes)
CSHADOW_FLAGS="-fno-builtin" CSHADOW_FLAGS="-fno-builtin"
C_INCLUDE_DIR='$(top_srcdir)/include/c_std' C_INCLUDE_DIR='${top_srcdir}/include/c_std'
AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS) AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS)
;; ;;
no) no)
CSHADOW_FLAGS="" CSHADOW_FLAGS=""
C_INCLUDE_DIR='$(top_srcdir)/include/c' C_INCLUDE_DIR='${top_srcdir}/include/c'
;; ;;
esac esac
...@@ -1501,6 +1524,33 @@ changequote([, ]) ...@@ -1501,6 +1524,33 @@ changequote([, ])
AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes) AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes)
]) ])
dnl
dnl Check for wide character support. Has the same effect as the option
dnl in gcc's configure, but in a form that autoconf can mess with.
dnl
dnl GLIBCPP_ENABLE_C_MBCHAR
dnl --enable-c-mbchar requests all the wchar_t stuff.
dnl --disable-c-mbchar doesn't.
dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
dnl defaults to `no'.
AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
AC_ARG_ENABLE(c-mbchar,
changequote(<<, >>)dnl
<< --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
changequote([, ])dnl
[case "$enableval" in
yes) enable_c_mbchar=yes ;;
no) enable_c_mbchar=no ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
esac],
enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
])
dnl dnl
dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's. dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
dnl dnl
......
...@@ -149,8 +149,8 @@ LIB_AC_PROG_CXX ...@@ -149,8 +149,8 @@ LIB_AC_PROG_CXX
fi fi
# configure.host sets the following important variables # configure.host sets the following important variables
# glibcpp_cflags - host specific C compiler flags # glibcpp_cflags - host specific C compiler flags
# glibcpp_cxxflags - host specific C++ compiler flags # glibcpp_cxxflags - host specific C++ compiler flags
glibcpp_cflags= glibcpp_cflags=
glibcpp_cxxflags= glibcpp_cxxflags=
...@@ -180,7 +180,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [ ...@@ -180,7 +180,7 @@ AC_DEFUN(GLIBCPP_CHECK_COMPILER_VERSION, [
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
ok ok
#endif #endif
], gpp_satisfactory=yes, AC_MSG_ERROR("please upgrade to gcc-2.95 or above")) ], gpp_satisfactory=yes, AC_MSG_ERROR([please upgrade to gcc-2.95 or above]))
AC_MSG_RESULT($gpp_satisfactory) AC_MSG_RESULT($gpp_satisfactory)
]) ])
...@@ -680,7 +680,7 @@ dnl Check to see if there is native support for complex ...@@ -680,7 +680,7 @@ dnl Check to see if there is native support for complex
dnl dnl
dnl Don't compile bits in math/* if native support exits. dnl Don't compile bits in math/* if native support exits.
dnl dnl
dnl Define USE_COMPLEX_LONG_DOUBLE etc if "cargf" is found. dnl Define USE_COMPLEX_LONG_DOUBLE etc if "atan2l/copysignl" is found.
dnl dnl
dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
...@@ -713,34 +713,34 @@ dnl GLIBCPP_CHECK_CPU ...@@ -713,34 +713,34 @@ dnl GLIBCPP_CHECK_CPU
AC_DEFUN(GLIBCPP_CHECK_CPU, [ AC_DEFUN(GLIBCPP_CHECK_CPU, [
AC_MSG_CHECKING([for cpu config directory]) AC_MSG_CHECKING([for cpu config directory])
# Currently unused, but could be useful. # Currently unused, but could be useful.
# CPU_FLAGS= # CPU_FLAGS=
case "${target_cpu}" in case "${target_cpu}" in
alpha*) alpha*)
cpu_include_dir="config/cpu/alpha" cpu_include_dir="config/cpu/alpha"
;; ;;
arm*) arm*)
cpu_include_dir="config/cpu/arm" cpu_include_dir="config/cpu/arm"
;; ;;
ia64) ia64)
cpu_include_dir="config/cpu/ia64" cpu_include_dir="config/cpu/ia64"
;; ;;
i386) i386)
cpu_include_dir="config/cpu/i386" cpu_include_dir="config/cpu/i386"
;; ;;
i486 | i586 | i686 | i786) i486 | i586 | i686 | i786)
cpu_include_dir="config/cpu/i486" cpu_include_dir="config/cpu/i486"
;; ;;
powerpc | rs6000) powerpc | rs6000)
cpu_include_dir="config/cpu/powerpc" cpu_include_dir="config/cpu/powerpc"
;; ;;
sparc64 | ultrasparc) sparc64 | ultrasparc)
cpu_include_dir="config/cpu/sparc/sparc64" cpu_include_dir="config/cpu/sparc/sparc64"
;; ;;
sparc*) sparc*)
cpu_include_dir="config/cpu/sparc/sparc32" cpu_include_dir="config/cpu/sparc/sparc32"
;; ;;
*) *)
cpu_include_dir="config/cpu/generic" cpu_include_dir="config/cpu/generic"
;; ;;
esac esac
AC_MSG_RESULT($cpu_include_dir) AC_MSG_RESULT($cpu_include_dir)
...@@ -757,28 +757,28 @@ AC_DEFUN(GLIBCPP_CHECK_OS, [ ...@@ -757,28 +757,28 @@ AC_DEFUN(GLIBCPP_CHECK_OS, [
# OS_FLAGS= # OS_FLAGS=
case "${target_os}" in case "${target_os}" in
aix*) aix*)
os_include_dir="config/os/aix" os_include_dir="config/os/aix"
;; ;;
bsd* | freebsd*) bsd* | freebsd*)
os_include_dir="config/os/bsd" os_include_dir="config/os/bsd"
;; ;;
linux*) linux*)
os_include_dir="config/os/gnu-linux" os_include_dir="config/os/gnu-linux"
;; ;;
irix*) irix*)
os_include_dir="config/os/irix" os_include_dir="config/os/irix"
;; ;;
solaris2.5*) solaris2.5*)
os_include_dir="config/os/solaris/solaris2.5" os_include_dir="config/os/solaris/solaris2.5"
;; ;;
solaris2.6*) solaris2.6*)
os_include_dir="config/os/solaris/solaris2.6" os_include_dir="config/os/solaris/solaris2.6"
;; ;;
solaris2.7* | solaris2.8*) solaris2.7* | solaris2.8*)
os_include_dir="config/os/solaris/solaris2.7" os_include_dir="config/os/solaris/solaris2.7"
;; ;;
*) *)
os_include_dir="config/os/generic" os_include_dir="config/os/generic"
;; ;;
esac esac
AC_MSG_RESULT($os_include_dir) AC_MSG_RESULT($os_include_dir)
...@@ -807,8 +807,8 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -807,8 +807,8 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
[int [int
foo (int a) foo (int a)
{ return _ISspace + _ISprint + _IScntrl + _ISupper + _ISlower + _ISalpha \ { return _ISspace + _ISprint + _IScntrl + _ISupper + _ISlower + _ISalpha \
+ _ISdigit + _ISpunct + _ISxdigit + _ISalnum + _ISgraph \ + _ISdigit + _ISpunct + _ISxdigit + _ISalnum + _ISgraph \
+ __ctype_tolower[a] + __ctype_toupper[a] + __ctype_b[a];}], \ + __ctype_tolower[a] + __ctype_toupper[a] + __ctype_b[a];}], \
ctype_linux=yes, ctype_linux=no) ctype_linux=yes, ctype_linux=no)
AC_MSG_RESULT($ctype_linux) AC_MSG_RESULT($ctype_linux)
if test $ctype_linux = "yes"; then if test $ctype_linux = "yes"; then
...@@ -823,7 +823,7 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -823,7 +823,7 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
[int [int
foo (int a) foo (int a)
{ return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \ { return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \
+ _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}], \ + _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}], \
ctype_bsd=yes, ctype_bsd=no) ctype_bsd=yes, ctype_bsd=no)
AC_MSG_RESULT($ctype_bsd) AC_MSG_RESULT($ctype_bsd)
if test $ctype_bsd = "yes"; then if test $ctype_bsd = "yes"; then
...@@ -855,8 +855,8 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -855,8 +855,8 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
[int [int
foo (int a) foo (int a)
{ return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \ { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
+ _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \ + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
+ __trans_lower[a] + __trans_upper[a] + __ctype_mask[a];}], \ + __trans_lower[a] + __trans_upper[a] + __ctype_mask[a];}], \
ctype_solaris=yes, ctype_solaris=no) ctype_solaris=yes, ctype_solaris=no)
AC_MSG_RESULT($ctype_solaris) AC_MSG_RESULT($ctype_solaris)
...@@ -886,7 +886,7 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -886,7 +886,7 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
[int [int
foo (int a) foo (int a)
{ return _U + _L + _N + _S + _P + _C + _X + _B \ { return _U + _L + _N + _S + _P + _C + _X + _B \
+ __ctype[a];}], \ + __ctype[a];}], \
ctype_solaris25=yes, ctype_solaris25=no) ctype_solaris25=yes, ctype_solaris25=no)
AC_MSG_RESULT($ctype_solaris25) AC_MSG_RESULT($ctype_solaris25)
if test $ctype_solaris25 = "yes"; then if test $ctype_solaris25 = "yes"; then
...@@ -902,8 +902,8 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -902,8 +902,8 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
[int [int
foo (int a) foo (int a)
{ return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \ { return _ISSPACE + _ISPRINT + _ISCNTRL + _ISUPPER + _ISLOWER + _ISALPHA \
+ _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \ + _ISDIGIT + _ISPUNCT + _ISXDIGIT + _ISALNUM + _ISGRAPH \
+ _VALC('a') + _IS('c', 0);}], \ + _VALC('a') + _IS('c', 0);}], \
ctype_aix=yes, ctype_aix=no) ctype_aix=yes, ctype_aix=no)
AC_MSG_RESULT($ctype_aix) AC_MSG_RESULT($ctype_aix)
if test $ctype_aix = "yes"; then if test $ctype_aix = "yes"; then
...@@ -919,7 +919,7 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -919,7 +919,7 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
[int [int
foo (int a) foo (int a)
{ return _U + _L + _N + _S + _P + _C + _X + _B \ { return _U + _L + _N + _S + _P + _C + _X + _B \
+ _ctype_[a];}], \ + _ctype_[a];}], \
ctype_newlib=yes, ctype_newlib=no) ctype_newlib=yes, ctype_newlib=no)
AC_MSG_RESULT($ctype_newlib) AC_MSG_RESULT($ctype_newlib)
if test $ctype_newlib = "yes"; then if test $ctype_newlib = "yes"; then
...@@ -943,94 +943,103 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -943,94 +943,103 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [
dnl dnl
dnl Check to see if this target can enable the wchar_t parts of libstdc++. dnl Check to see if this target can enable the wchar_t parts of libstdc++.
dnl If --disable-c-mbchar was given, no wchar_t stuff is enabled. (This
dnl must have been previously checked.)
dnl dnl
dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found dnl Define _GLIBCPP_USE_WCHAR_T if all the bits are found
dnl Define _GLIBCPP_NEED_MBSTATE_T if mbstate_t is not in wchar.h dnl Define _GLIBCPP_NEED_MBSTATE_T if mbstate_t is not in wchar.h
dnl dnl
dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
if test x$enable_c_mbchar != xno; then
dnl Sanity check for existence of ISO C9X headers for extended encoding.
AC_CHECK_HEADER(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no) dnl Sanity check for existence of ISO C9X headers for extended encoding.
AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no) AC_CHECK_HEADER(wchar.h, ac_has_wchar_h=yes, ac_has_wchar_h=no)
AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
dnl Only continue checking if the ISO C9X headers exist.
if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes; then dnl Only continue checking if the ISO C9X headers exist.
if test x"$ac_has_wchar_h" = xyes && test x"$ac_has_wctype_h" = xyes; then
dnl Test wchar.h for mbstate_t, which is needed for char_traits and others.
AC_MSG_CHECKING([for mbstate_t])
AC_TRY_COMPILE([#include <wchar.h>],
[mbstate_t teststate;],
use_native_mbstatet=yes, use_native_mbstatet=no)
AC_MSG_RESULT($use_native_mbstatet)
if test x"$use_native_mbstatet" = xno; then
AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
fi
dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before dnl Test wchar.h for mbstate_t, which is needed for char_traits
dnl numeric_limits can instantiate type_traits<wchar_t> dnl and others.
AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX]) AC_MSG_CHECKING([for mbstate_t])
AC_TRY_COMPILE([#include <wchar.h>], AC_TRY_COMPILE([#include <wchar.h>],
[int i = WCHAR_MIN; int j = WCHAR_MAX;], [mbstate_t teststate;],
has_wchar_minmax=yes, has_wchar_minmax=no) use_native_mbstatet=yes, use_native_mbstatet=no)
AC_MSG_RESULT($has_wchar_minmax) AC_MSG_RESULT($use_native_mbstatet)
if test x"$use_native_mbstatet" = xno; then
AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
fi
dnl Test wchar.h for WCHAR_MIN, WCHAR_MAX, which is needed before
dnl numeric_limits can instantiate type_traits<wchar_t>
AC_MSG_CHECKING([for WCHAR_MIN and WCHAR_MAX])
AC_TRY_COMPILE([#include <wchar.h>],
[int i = WCHAR_MIN; int j = WCHAR_MAX;],
has_wchar_minmax=yes, has_wchar_minmax=no)
AC_MSG_RESULT($has_wchar_minmax)
dnl Test wchar.h for WEOF, which is what we use to determine whether
dnl to specialize for char_traits<wchar_t> or not.
AC_MSG_CHECKING([for WEOF])
AC_TRY_COMPILE([
#include <wchar.h>
#include <stddef.h>],
[wint_t i = WEOF;],
has_weof=yes, has_weof=no)
AC_MSG_RESULT($has_weof)
dnl Tests for wide character functions used in char_traits<wchar_t>.
AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
wcsrtombs mbsrtowcs, ac_wfuncs=yes, ac_wfuncs=no)
AC_MSG_CHECKING([for ISO C9X wchar_t support])
if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
&& test x"$ac_wfuncs" = xyes; then
ac_isoC9X_wchar_t=yes
else
ac_isoC9X_wchar_t=no
fi
AC_MSG_RESULT($ac_isoC9X_wchar_t)
dnl Use iconv for wchar_t to char conversions. As such, check for
dnl X/Open Portability Guide, version 2 features (XPG2).
AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
ac_XPG2funcs=yes, ac_XPG2funcs=no)
AC_MSG_CHECKING([for XPG2 wchar_t support])
if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes \
&& test x"$ac_XPG2funcs" = xyes; then
ac_XPG2_wchar_t=yes
else
ac_XPG2_wchar_t=no
fi
AC_MSG_RESULT($ac_XPG2_wchar_t)
dnl At the moment, only enable wchar_t specializations if all the
dnl above support is present.
AC_MSG_CHECKING([for enabled wchar_t specializations])
if test x"$ac_isoC9X_wchar_t" = xyes \
&& test x"$ac_XPG2_wchar_t" = xyes; then
libinst_wstring_la="libinst-wstring.la"
AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
AC_MSG_RESULT("yes")
else
libinst_wstring_la=""
AC_MSG_RESULT("no")
fi
AC_SUBST(libinst_wstring_la)
dnl Test wchar.h for WEOF, which is what we use to determine whether
dnl to specialize for char_traits<wchar_t> or not.
AC_MSG_CHECKING([for WEOF])
AC_TRY_COMPILE([
#include <wchar.h>
#include <stddef.h>],
[wint_t i = WEOF;],
has_weof=yes, has_weof=no)
AC_MSG_RESULT($has_weof)
dnl Tests for wide character functions used in char_traits<wchar_t>.
AC_CHECK_FUNCS(wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset \
wcsrtombs mbsrtowcs, ac_wfuncs=yes, ac_wfuncs=no)
AC_MSG_CHECKING([for ISO C9X wchar_t support])
if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes \
&& test x"$ac_wfuncs" = xyes; then
ac_isoC9X_wchar_t=yes
else
ac_isoC9X_wchar_t=no
fi
AC_MSG_RESULT($ac_isoC9X_wchar_t)
dnl Use iconv for wchar_t to char conversions. As such, check for
dnl X/Open Portability Guide, version 2 features (XPG2).
AC_CHECK_HEADER(iconv.h, ac_has_iconv_h=yes, ac_has_iconv_h=no)
AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
AC_CHECK_FUNCS(iconv_open iconv_close iconv nl_langinfo, \
ac_XPG2funcs=yes, ac_XPG2funcs=no)
AC_MSG_CHECKING([for XPG2 wchar_t support])
if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes \
&& test x"$ac_XPG2funcs" = xyes; then
ac_XPG2_wchar_t=yes
else
ac_XPG2_wchar_t=no
fi
AC_MSG_RESULT($ac_XPG2_wchar_t)
dnl At the moment, only enable wchar_t specializations if all the
dnl above support is present.
AC_MSG_CHECKING([for enabled wchar_t specializations])
if test x"$ac_isoC9X_wchar_t" = xyes \
&& test x"$ac_XPG2_wchar_t" = xyes; then
libinst_wstring_la="libinst-wstring.la"
AC_DEFINE(_GLIBCPP_USE_WCHAR_T)
AC_MSG_RESULT("yes")
else else
libinst_wstring_la="" AC_MSG_WARN([<wchar.h> not found])
AC_MSG_RESULT("no") AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
fi fi
AC_SUBST(libinst_wstring_la)
else else
AC_MSG_WARN([<wchar.h> not found]) dnl Wide characters disabled by the user. Maybe print a warning?
AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T) :
fi fi
]) ])
...@@ -1056,8 +1065,8 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [ ...@@ -1056,8 +1065,8 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT, [
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \ AC_TRY_COMPILE([struct dcomplex { __complex__ double x; }; \
dcomplex f(const dcomplex& x) { return dcomplex(x); }], \ dcomplex f(const dcomplex& x) { return dcomplex(x); }], \
[ dcomplex x; f(x); ], [ dcomplex x; f(x); ],
glibcpp_cv_complex=ok, glibcpp_cv_complex=ok,
glibcpp_cv_complex=buggy glibcpp_cv_complex=buggy
) )
...@@ -1132,10 +1141,10 @@ enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl ...@@ -1132,10 +1141,10 @@ enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
dnl Option parsed, now set things appropriately dnl Option parsed, now set things appropriately
case "${enable_debug}" in case "${enable_debug}" in
yes) yes)
DEBUG_FLAGS='-O0 -ggdb' DEBUG_FLAGS='-O0 -ggdb'
;; ;;
no) no)
DEBUG_FLAGS='-g' DEBUG_FLAGS='-g'
;; ;;
esac esac
AC_SUBST(DEBUG_FLAGS) AC_SUBST(DEBUG_FLAGS)
...@@ -1166,11 +1175,11 @@ changequote(<<, >>)dnl ...@@ -1166,11 +1175,11 @@ changequote(<<, >>)dnl
changequote([, ])dnl changequote([, ])dnl
[case "x$enableval" in [case "x$enableval" in
xyes) xyes)
AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;; AC_MSG_ERROR([--enable-cxx-flags needs compiler flags as arguments]) ;;
xno|x) xno|x)
enable_cxx_flags='' ;; enable_cxx_flags='' ;;
*) *)
enable_cxx_flags="$enableval" ;; enable_cxx_flags="$enableval" ;;
esac], esac],
enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT') enable_cxx_flags='GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT')
...@@ -1210,13 +1219,13 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [ ...@@ -1210,13 +1219,13 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
[ --enable-cstdio enable GNU libio for target io package. (default) [ --enable-cstdio enable GNU libio for target io package. (default)
--enable-cstdio=LIB use LIB target-speific io package.], --enable-cstdio=LIB use LIB target-speific io package.],
if test x$enable_cstdio = xno; then if test x$enable_cstdio = xno; then
enable_cstdio=libio enable_cstdio=libio
fi, fi,
enable_cstdio=libio) enable_cstdio=libio)
enable_cstdio_flag=$enable_cstdio enable_cstdio_flag=$enable_cstdio
dnl Check if a valid thread package dnl Check if a valid I/O package
case x${enable_cstdio_flag} in case x${enable_cstdio_flag} in
xlibio | x | xno | xnone | xyes) xlibio | x | xno | xnone | xyes)
# default # default
...@@ -1233,38 +1242,48 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [ ...@@ -1233,38 +1242,48 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
if test x$has_libio = x"yes"; then if test x$has_libio = x"yes"; then
case "$target" in case "$target" in
*-*-linux*) *-*-linux*)
AC_MSG_CHECKING([for glibc version >= 2.2]) AC_MSG_CHECKING([for glibc version >= 2.2])
AC_EGREP_CPP([ok], [ AC_EGREP_CPP([ok], [
#include <features.h> #include <features.h>
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
ok ok
#endif #endif
], glibc_satisfactory=yes, glibc_satisfactory=no) ], glibc_satisfactory=yes, glibc_satisfactory=no)
AC_MSG_RESULT($glibc_satisfactory) AC_MSG_RESULT($glibc_satisfactory)
;; ;;
esac esac
# XXX at the moment, admit defeat and force the recompilation # XXX at the moment, admit defeat and force the recompilation
# XXX of glibc even on glibc-2.2 systems, because libio is not synched. # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
glibc_satisfactory=no glibc_satisfactory=no
if test x$glibc_satisfactory = x"yes"; then if test x$glibc_satisfactory = x"yes"; then
need_libio=no need_libio=no
need_xtra_libio=no need_xtra_libio=no
need_wlibio=no need_wlibio=no
else else
need_libio=yes need_libio=yes
need_xtra_libio=yes need_xtra_libio=yes
# bkoz XXX need to add checks to enable this # bkoz XXX need to add checks to enable this
need_wlibio=yes # pme XXX here's a first pass at such a check
fi if test x$enable_c_mbchar != xno; then
need_wlibio=yes
else
need_wlibio=no
fi
fi
# Using libio, but <libio.h> doesn't exist on the target system. . . # Using libio, but <libio.h> doesn't exist on the target system. . .
else else
need_libio=yes need_libio=yes
need_xtra_libio=no need_xtra_libio=no
# bkoz XXX need to add checks to enable this # bkoz XXX need to add checks to enable this
need_wlibio=no # pme XXX here's a first pass at such a check
if test x$enable_c_mbchar != xno; then
need_wlibio=yes
else
need_wlibio=no
fi
fi fi
;; ;;
...@@ -1287,7 +1306,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [ ...@@ -1287,7 +1306,7 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
CCODECVT_C=config/c_io_libio_codecvt.c CCODECVT_C=config/c_io_libio_codecvt.c
AC_LINK_FILES($CCODECVT_C, libio/c_codecvt.c) AC_LINK_FILES($CCODECVT_C, libio/c_codecvt.c)
# 2000-08-04 bkoz hack # 2000-08-04 bkoz hack
AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes) AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
AM_CONDITIONAL(GLIBCPP_NEED_XTRA_LIBIO, test "$need_xtra_libio" = yes) AM_CONDITIONAL(GLIBCPP_NEED_XTRA_LIBIO, test "$need_xtra_libio" = yes)
AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes) AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
...@@ -1300,7 +1319,8 @@ dnl ...@@ -1300,7 +1319,8 @@ dnl
dnl GLIBCPP_ENABLE_THREADS dnl GLIBCPP_ENABLE_THREADS
dnl --enable-threads=posix sets config/threads-posix.h et. al. dnl --enable-threads=posix sets config/threads-posix.h et. al.
dnl dnl
dnl default is no threads dnl Default is no threads, which also disables _IO_MTSAFE_IO in
dnl libio. Any actual thread package will enable it.
dnl dnl
AC_DEFUN(GLIBCPP_ENABLE_THREADS, [ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
dnl Note this comes from the gcc/config.in and libjava/config.in dnl Note this comes from the gcc/config.in and libjava/config.in
...@@ -1318,22 +1338,22 @@ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [ ...@@ -1318,22 +1338,22 @@ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
dnl Check if a valid thread package dnl Check if a valid thread package
case x${enable_threads_flag} in case x${enable_threads_flag} in
x | xno | xnone) x | xno | xnone)
# No threads # No threads
target_thread_file='single' target_thread_file='single'
;; ;;
xyes) xyes)
# default # default
target_thread_file='' target_thread_file=''
;; ;;
xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \ xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
xsolaris | xwin32 | xdce | xvxworks) xsolaris | xwin32 | xdce | xvxworks)
target_thread_file=$enable_threads_flag target_thread_file=$enable_threads_flag
;; ;;
*) *)
echo "$enable_threads is an unknown thread package" 1>&2 echo "$enable_threads is an unknown thread package" 1>&2
exit 1 exit 1
;; ;;
esac esac
dnl Check for thread package actually supported in libstdc++ dnl Check for thread package actually supported in libstdc++
...@@ -1355,6 +1375,9 @@ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [ ...@@ -1355,6 +1375,9 @@ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
AC_MSG_RESULT($THREADH) AC_MSG_RESULT($THREADH)
AC_LINK_FILES(config/$THREADH, bits/c++threads.h) AC_LINK_FILES(config/$THREADH, bits/c++threads.h)
if test $THREADH != threads-no.h; then
AC_DEFINE(_GLIBCPP_USE_THREADS)
fi
]) ])
...@@ -1363,16 +1386,16 @@ dnl GLIBCPP_ENABLE_ATOMICITY ...@@ -1363,16 +1386,16 @@ dnl GLIBCPP_ENABLE_ATOMICITY
AC_DEFUN(GLIBCPP_ENABLE_ATOMICITY, [ AC_DEFUN(GLIBCPP_ENABLE_ATOMICITY, [
AC_MSG_CHECKING([for atomicity.h]) AC_MSG_CHECKING([for atomicity.h])
case "$target" in case "$target" in
*-*-linux*) *-*-linux* | sparc*-*-*)
ATOMICITYH=$cpu_include_dir ATOMICITYH=$cpu_include_dir
;; ;;
*-*-aix*) *-*-aix*)
ATOMICITYH=$os_include_dir ATOMICITYH=$os_include_dir
;; ;;
*) *)
echo "$enable_threads is an unknown thread package" 1>&2 # bit of overkill on this text...
exit 1 AC_MSG_ERROR([Atomic locking requested, but $enable_threads is an unknown thread package and atomic operations are not present in the CPU])
;; ;;
esac esac
AC_MSG_RESULT($ATOMICITYH/bits/atomicity.h) AC_MSG_RESULT($ATOMICITYH/bits/atomicity.h)
AC_LINK_FILES($ATOMICITYH/bits/atomicity.h, bits/atomicity.h) AC_LINK_FILES($ATOMICITYH/bits/atomicity.h, bits/atomicity.h)
...@@ -1485,11 +1508,11 @@ changequote(<<, >>)dnl ...@@ -1485,11 +1508,11 @@ changequote(<<, >>)dnl
changequote([, ]) changequote([, ])
[case "$enableval" in [case "$enableval" in
yes) enable_cshadow_headers=yes yes) enable_cshadow_headers=yes
;; ;;
no) enable_cshadow_headers=no no) enable_cshadow_headers=no
;; ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers]) *) AC_MSG_ERROR([Unknown argument to enable/disable shadowed C headers])
;; ;;
esac], esac],
enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT) enable_cshadow_headers=GLIBCPP_ENABLE_SHADOW_DEFAULT)
AC_MSG_RESULT($enable_cshadow_headers) AC_MSG_RESULT($enable_cshadow_headers)
...@@ -1498,13 +1521,13 @@ changequote([, ]) ...@@ -1498,13 +1521,13 @@ changequote([, ])
dnl NB: these things may be duplicated in c++config.h as well. dnl NB: these things may be duplicated in c++config.h as well.
case "$enable_cshadow_headers" in case "$enable_cshadow_headers" in
yes) yes)
CSHADOW_FLAGS="-fno-builtin" CSHADOW_FLAGS="-fno-builtin"
C_INCLUDE_DIR='$(top_srcdir)/include/c_std' C_INCLUDE_DIR='${top_srcdir}/include/c_std'
AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS) AC_DEFINE(_GLIBCPP_USE_SHADOW_HEADERS)
;; ;;
no) no)
CSHADOW_FLAGS="" CSHADOW_FLAGS=""
C_INCLUDE_DIR='$(top_srcdir)/include/c' C_INCLUDE_DIR='${top_srcdir}/include/c'
;; ;;
esac esac
...@@ -1513,6 +1536,33 @@ changequote([, ]) ...@@ -1513,6 +1536,33 @@ changequote([, ])
AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes) AM_CONDITIONAL(GLIBCPP_USE_CSHADOW, test "$enable_cshadow_headers" = yes)
]) ])
dnl
dnl Check for wide character support. Has the same effect as the option
dnl in gcc's configure, but in a form that autoconf can mess with.
dnl
dnl GLIBCPP_ENABLE_C_MBCHAR
dnl --enable-c-mbchar requests all the wchar_t stuff.
dnl --disable-c-mbchar doesn't.
dnl + Usage: GLIBCPP_ENABLE_C_MBCHAR[(DEFAULT)]
dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
dnl defaults to `no'.
AC_DEFUN(GLIBCPP_ENABLE_C_MBCHAR, [dnl
define([GLIBCPP_ENABLE_C_MBCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
AC_ARG_ENABLE(c-mbchar,
changequote(<<, >>)dnl
<< --enable-c-mbchar enable multibyte (wide) characters [default=>>GLIBCPP_ENABLE_C_MBCHAR_DEFAULT],
changequote([, ])dnl
[case "$enableval" in
yes) enable_c_mbchar=yes ;;
no) enable_c_mbchar=no ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable c-mbchar]) ;;
esac],
enable_c_mbchar=GLIBCPP_ENABLE_C_MBCHAR_DEFAULT)dnl
dnl Option parsed, now other scripts can test enable_c_mbchar for yes/no.
])
dnl dnl
dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's. dnl Set up *_INCLUDES and *_INCLUDE_DIR variables for all sundry Makefile.am's.
dnl dnl
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
/* Define if you have a working `mmap' system call. */ /* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP #undef HAVE_MMAP
// Include support for multiple threads, e.g., in the I/O package.
#undef _GLIBCPP_USE_THREADS
// Include support for 'long long' and 'unsigned long long'. // Include support for 'long long' and 'unsigned long long'.
#undef _GLIBCPP_USE_LONG_LONG #undef _GLIBCPP_USE_LONG_LONG
......
...@@ -50,7 +50,12 @@ namespace std { ...@@ -50,7 +50,12 @@ namespace std {
typedef _IO_off_t wstreamoff; typedef _IO_off_t wstreamoff;
#endif #endif
typedef _IO_lock_t __c_lock; #ifdef _GLIBCPP_USE_THREADS
typedef _IO_lock_t __c_lock;
#else
typedef int __c_lock;
#endif
// from basic_file.h // from basic_file.h
#define _GLIBCPP_BASIC_FILE_INHERITANCE 1 #define _GLIBCPP_BASIC_FILE_INHERITANCE 1
......
...@@ -28,5 +28,13 @@ ...@@ -28,5 +28,13 @@
// the GNU General Public License. // the GNU General Public License.
#ifndef _GLIBCPP_OS_DEFINES
# define _GLIBCPP_OS_DEFINES
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
#endif
...@@ -28,5 +28,14 @@ ...@@ -28,5 +28,14 @@
// the GNU General Public License. // the GNU General Public License.
#ifndef _GLIBCPP_OS_DEFINES
# define _GLIBCPP_OS_DEFINES
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
#endif
...@@ -28,5 +28,14 @@ ...@@ -28,5 +28,14 @@
// the GNU General Public License. // the GNU General Public License.
#ifndef _GLIBCPP_OS_DEFINES
# define _GLIBCPP_OS_DEFINES
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
#endif
...@@ -28,5 +28,14 @@ ...@@ -28,5 +28,14 @@
// the GNU General Public License. // the GNU General Public License.
#ifndef _GLIBCPP_OS_DEFINES
# define _GLIBCPP_OS_DEFINES
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
#endif
...@@ -28,5 +28,14 @@ ...@@ -28,5 +28,14 @@
// the GNU General Public License. // the GNU General Public License.
#ifndef _GLIBCPP_OS_DEFINES
# define _GLIBCPP_OS_DEFINES
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
#endif
...@@ -28,5 +28,14 @@ ...@@ -28,5 +28,14 @@
// the GNU General Public License. // the GNU General Public License.
#ifndef _GLIBCPP_OS_DEFINES
# define _GLIBCPP_OS_DEFINES
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
#endif
...@@ -28,5 +28,14 @@ ...@@ -28,5 +28,14 @@
// the GNU General Public License. // the GNU General Public License.
#ifndef _GLIBCPP_OS_DEFINES
# define _GLIBCPP_OS_DEFINES
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
#endif
...@@ -28,5 +28,14 @@ ...@@ -28,5 +28,14 @@
// the GNU General Public License. // the GNU General Public License.
#ifndef _GLIBCPP_OS_DEFINES
# define _GLIBCPP_OS_DEFINES
/* System-specific #define, typedefs, corrections, etc, go here. This
file will come before all others. */
#endif
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -31,8 +31,9 @@ GLIBCPP_CHECK_OS ...@@ -31,8 +31,9 @@ GLIBCPP_CHECK_OS
AC_CACHE_SAVE AC_CACHE_SAVE
# Enable all the crazy c++ stuff. # Enable all the crazy c++ stuff. C_MBCHAR must come early.
GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE) GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
GLIBCPP_ENABLE_C_MBCHAR([yes])
GLIBCPP_ENABLE_CSTDIO GLIBCPP_ENABLE_CSTDIO
GLIBCPP_ENABLE_LONG_LONG(yes) GLIBCPP_ENABLE_LONG_LONG(yes)
GLIBCPP_ENABLE_LONG_DOUBLE(yes) GLIBCPP_ENABLE_LONG_DOUBLE(yes)
...@@ -249,6 +250,8 @@ fi ...@@ -249,6 +250,8 @@ fi
# Sanity checking & User-visible messages. # Sanity checking & User-visible messages.
# Checks down here, otherwise they get scrolled off before # Checks down here, otherwise they get scrolled off before
# the user will notice. # the user will notice.
### warnings removed; none were applicable anymore
# Trying to get more people to read documentation. Possibly remove # Trying to get more people to read documentation. Possibly remove
# check and warn all the time. There is no "informational" AC_MSG_ # check and warn all the time. There is no "informational" AC_MSG_
......
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
#ifndef _LIBC #ifndef _LIBC
# include <bits/c++config.h> # include <bits/c++config.h>
# define _IO_MTSAFE_IO # ifdef _GLIBCPP_USE_THREADS
# define _IO_MTSAFE_IO
# endif
#endif #endif
/* Define types for libio in terms of the standard internal type names. */ /* Define types for libio in terms of the standard internal type names. */
......
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