Commit 697c2a39 by Phil Edwards Committed by Phil Edwards

acconfig.h: _GLIBCPP_USING_THREADS and some workaround types added.

2000-08-23  Phil Edwards  <pme@sourceware.cygnus.com>

	* acconfig.h:  _GLIBCPP_USING_THREADS and some workaround types added.
	* acinclude.m4:  New macro, GLIBCPP_ENABLE_WCHAR.  Set the threads
	  definition as well, and some minor spelling/spacing fixes.  If
	  building libio, check for certain typedefs.
	* libio/_G_config.h:  Wrap _IO_MTSAFE_IO in _GLIBCPP_USING_THREADS.
	  Conditionally define _LARGEFILE64_SOURCE, otherwise the 64-bit types
	  will never be there.
	* libio/libio.h:  In the null case, _IO_lock_t can't just be void.
	* src/string-inst.cc:  Use _GLIBCPP_USE_WCHAR_T.

	* configure.in:  Update the cache a bit more often.

	* mkcheck.in:  For check-install, also need to -I the testsuite dir.

From-SVN: r35901
parent 55efb413
2000-08-23 Phil Edwards <pme@sourceware.cygnus.com>
* acconfig.h: _GLIBCPP_USING_THREADS and some workaround types added.
* acinclude.m4: New macro, GLIBCPP_ENABLE_WCHAR. Set the threads
definition as well, and some minor spelling/spacing fixes. If
building libio, check for certain typedefs.
* libio/_G_config.h: Wrap _IO_MTSAFE_IO in _GLIBCPP_USING_THREADS.
Conditionally define _LARGEFILE64_SOURCE, otherwise the 64-bit types
will never be there.
* libio/libio.h: In the null case, _IO_lock_t can't just be void.
* src/string-inst.cc: Use _GLIBCPP_USE_WCHAR_T.
* configure.in: Update the cache a bit more often.
* mkcheck.in: For check-install, also need to -I the testsuite dir.
2000-08-22 Benjamin Kosnik <bkoz@purist.soma.redhat.com> 2000-08-22 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
* src/locale-inst.cc: Add codecvt<unicode_t, wchar_t, * src/locale-inst.cc: Add codecvt<unicode_t, wchar_t,
......
...@@ -69,6 +69,24 @@ ...@@ -69,6 +69,24 @@
// Define if modf is present in <math.h> // Define if modf is present in <math.h>
#undef HAVE_MODF #undef HAVE_MODF
// Define if multiple threads are to be taken into account.
#undef _GLIBCPP_USING_THREADS
// Define to some workaround if not directly available.
#undef off64_t
// Define to some workaround if not directly available.
#undef __off_t
// Define to some workaround if not directly available.
#undef __off64_t
// Define to some workaround if not directly available.
#undef __ssize_t
// Define to regular stat if not directly supported.
#undef stat64
// @BOTTOM@ // @BOTTOM@
// //
// Systems that have certain non-standard functions prefixed with an // Systems that have certain non-standard functions prefixed with an
......
...@@ -131,9 +131,11 @@ LIB_AC_PROG_CXX ...@@ -131,9 +131,11 @@ LIB_AC_PROG_CXX
# fails, because we are probably configuring with a cross compiler # fails, because we are probably configuring with a cross compiler
# which cant create executables. So we include AC_EXEEXT to keep # which cant create executables. So we include AC_EXEEXT to keep
# automake happy, but we dont execute it, since we dont care about # automake happy, but we dont execute it, since we dont care about
# the result. # the result. We must, however, execute something else to prevent sh
# from complaining about an empty body.
if false; then if false; then
AC_EXEEXT AC_EXEEXT
:
fi fi
# configure.host sets the following important variables # configure.host sets the following important variables
...@@ -893,12 +895,19 @@ AC_DEFUN(GLIBCPP_CHECK_CTYPE, [ ...@@ -893,12 +895,19 @@ 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 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 All of the above depends on --enable-wchar (the default).
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, [
AC_MSG_CHECKING([if wide character support is requested])
GLIBCPP_ENABLE_WCHAR([yes])
AC_MSG_RESULT($enable_wchar)
if test x"$enable_wchar" = xyes; then
dnl Sanity check for existence of ISO C9X headers for extended encoding. 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) 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) AC_CHECK_HEADER(wctype.h, ac_has_wctype_h=yes, ac_has_wctype_h=no)
...@@ -981,6 +990,8 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [ ...@@ -981,6 +990,8 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
AC_MSG_WARN([<wchar.h> not found]) AC_MSG_WARN([<wchar.h> not found])
AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T) AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
fi fi
fi
]) ])
...@@ -1192,6 +1203,8 @@ dnl Check for which I/O library to use: libio, or something specific. ...@@ -1192,6 +1203,8 @@ dnl Check for which I/O library to use: libio, or something specific.
dnl dnl
dnl GLIBCPP_ENABLE_CSTDIO dnl GLIBCPP_ENABLE_CSTDIO
dnl --enable-cstdio=libio sets config/c_io_libio.h and friends dnl --enable-cstdio=libio sets config/c_io_libio.h and friends
dnl --enable-cstdio=wince sets config/c_io_wince.h and friends, but those
dnl need to be written by somebody.
dnl dnl
dnl default is libio dnl default is libio
dnl dnl
...@@ -1203,11 +1216,12 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [ ...@@ -1203,11 +1216,12 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
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
...@@ -1275,6 +1289,25 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [ ...@@ -1275,6 +1289,25 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
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
# 2000-08-22 pme kludge -- if building libio, then probably need these
# typedefs which are used in _G_config.h
if test $need_libio = yes; then
AC_CHECK_TYPE(__off_t,off_t)
# off64_t should already be there, but just in case...
AC_CHECK_TYPE(off64_t,off_t)
AC_CHECK_TYPE(__off64_t,off64_t)
AC_CHECK_TYPE(__ssize_t,ssize_t)
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>],
[struct stat64 s;],
, dnl Nothing need be done if it's present
[dnl Not entirely comfortable with this
AC_DEFINE(stat64,stat)
]
)
fi
# 2000-08-22 pme kludge
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)
...@@ -1371,6 +1404,9 @@ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [ ...@@ -1371,6 +1404,9 @@ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
AC_SUBST(THREADOBJS) AC_SUBST(THREADOBJS)
AC_SUBST(THREADSPEC) AC_SUBST(THREADSPEC)
AC_LINK_FILES(config/$THREADH, bits/c++threads.h) AC_LINK_FILES(config/$THREADH, bits/c++threads.h)
if test "$THREADS" != none; then
AC_DEFINE(_GLIBCPP_USING_THREADS)
fi
]) ])
...@@ -1582,6 +1618,7 @@ dnl string, '#' otherwise ...@@ -1582,6 +1618,7 @@ dnl string, '#' otherwise
AC_SUBST(ifGNUmake) AC_SUBST(ifGNUmake)
]) ])
sinclude(../libtool.m4) sinclude(../libtool.m4)
dnl The lines below arrange for aclocal not to bring an installed dnl The lines below arrange for aclocal not to bring an installed
dnl libtool.m4 into aclocal.m4, while still arranging for automake to dnl libtool.m4 into aclocal.m4, while still arranging for automake to
...@@ -1591,3 +1628,31 @@ AC_DEFUN([AM_PROG_LIBTOOL]) ...@@ -1591,3 +1628,31 @@ AC_DEFUN([AM_PROG_LIBTOOL])
AC_DEFUN([AC_LIBTOOL_DLOPEN]) AC_DEFUN([AC_LIBTOOL_DLOPEN])
AC_DEFUN([AC_PROG_LD]) AC_DEFUN([AC_PROG_LD])
]) ])
dnl
dnl Check whether the user wants wide character support.
dnl
dnl GLIBCPP_ENABLE_WCHAR
dnl --enable-wchar [does stuff].
dnl --disable-wchar [does not do stuff].
dnl + Usage: GLIBCPP_ENABLE_WCHAR[(DEFAULT)]
dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
dnl defaults to `no'.
AC_DEFUN(GLIBCPP_ENABLE_WCHAR, [dnl
define([GLIBCPP_ENABLE_WCHAR_DEFAULT], ifelse($1, yes, yes, no))dnl
AC_ARG_ENABLE(wchar,
changequote(<<, >>)dnl
<< --enable-wchar turns on wide character support [default=>>GLIBCPP_ENABLE_WCHAR_DEFAULT],
changequote([, ])dnl
[case "$enableval" in
yes) enable_wchar=yes ;;
no) enable_wchar=no ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable wchar]) ;;
esac],
enable_wchar=GLIBCPP_ENABLE_WCHAR_DEFAULT)dnl
dnl We don't set things in the external files; other configure tests will
dnl use $enable_wchar ("yes"/"no") for their own work.
])
...@@ -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
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
// 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
...@@ -72,6 +75,24 @@ ...@@ -72,6 +75,24 @@
// Define if modf is present in <math.h> // Define if modf is present in <math.h>
#undef HAVE_MODF #undef HAVE_MODF
// Define if multiple threads are to be taken into account.
#undef _GLIBCPP_USING_THREADS
// Define to some workaround if not directly available.
#undef off64_t
// Define to some workaround if not directly available.
#undef __off_t
// Define to some workaround if not directly available.
#undef __off64_t
// Define to some workaround if not directly available.
#undef __ssize_t
// Define to regular stat if not directly supported.
#undef stat64
/* Define if you have the _acosf function. */ /* Define if you have the _acosf function. */
#undef HAVE__ACOSF #undef HAVE__ACOSF
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -28,6 +28,8 @@ AM_CONFIG_HEADER(config.h) ...@@ -28,6 +28,8 @@ AM_CONFIG_HEADER(config.h)
GLIBCPP_CHECK_COMPILER_VERSION GLIBCPP_CHECK_COMPILER_VERSION
GLIBCPP_CHECK_CPU GLIBCPP_CHECK_CPU
AC_CACHE_SAVE
# Enable all the crazy c++ stuff. # Enable all the crazy c++ stuff.
GLIBCPP_ENABLE_DEBUG GLIBCPP_ENABLE_DEBUG
GLIBCPP_ENABLE_CSTDIO GLIBCPP_ENABLE_CSTDIO
...@@ -116,6 +118,7 @@ else ...@@ -116,6 +118,7 @@ else
GLIBCPP_CHECK_MATH_SUPPORT GLIBCPP_CHECK_MATH_SUPPORT
GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
AC_CACHE_SAVE
GLIBCPP_CHECK_WCHAR_T_SUPPORT GLIBCPP_CHECK_WCHAR_T_SUPPORT
GLIBCPP_CHECK_CTYPE GLIBCPP_CHECK_CTYPE
......
...@@ -6,11 +6,16 @@ ...@@ -6,11 +6,16 @@
#ifndef _LIBC #ifndef _LIBC
# include <bits/c++config.h> # include <bits/c++config.h>
# ifdef _GLIBCPP_USING_THREADS
# define _IO_MTSAFE_IO # 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. */
#ifndef _LARGEFILE64_SOURCE
# define _LARGEFILE64_SOURCE
#endif
#include <sys/types.h> #include <sys/types.h>
#define __need_size_t #define __need_size_t
#define __need_wchar_t #define __need_wchar_t
......
...@@ -164,7 +164,7 @@ struct _IO_jump_t; struct _IO_FILE; ...@@ -164,7 +164,7 @@ struct _IO_jump_t; struct _IO_FILE;
/*# include <comthread.h>*/ /*# include <comthread.h>*/
# endif # endif
#else #else
typedef void _IO_lock_t; typedef void* _IO_lock_t;
#endif #endif
......
...@@ -57,7 +57,7 @@ fi ...@@ -57,7 +57,7 @@ fi
if [ $WHICH != "1" ]; then if [ $WHICH != "1" ]; then
INC_PATH="@CSHADOWFLAGS@ -I$BUILD_DIR -I$BUILD_DIR/libio -I$SRC_DIR/@ctype_include_dir@ -I$SRC_DIR/@cpu_include_dir@ -I$SRC_DIR/std -I$SRC_DIR -I$SRC_DIR/libio -I$SRC_DIR/testsuite" INC_PATH="@CSHADOWFLAGS@ -I$BUILD_DIR -I$BUILD_DIR/libio -I$SRC_DIR/@ctype_include_dir@ -I$SRC_DIR/@cpu_include_dir@ -I$SRC_DIR/std -I$SRC_DIR -I$SRC_DIR/libio -I$SRC_DIR/testsuite"
elif [ $WHICH -eq 1 ]; then elif [ $WHICH -eq 1 ]; then
INC_PATH="" INC_PATH="-I$SRC_DIR/testsuite"
fi fi
if [ $WHICH -eq 2 ]; then if [ $WHICH -eq 2 ]; then
......
...@@ -209,7 +209,7 @@ namespace std ...@@ -209,7 +209,7 @@ namespace std
const char* __ret = strchr(__beg, __c); const char* __ret = strchr(__beg, __c);
return (__ret ? __ret : __end); return (__ret ? __ret : __end);
} }
#else #elif defined(_GLIBCPP_USE_WCHAR_T)
template<> template<>
const wchar_t* const wchar_t*
wstring::_S_find(const wchar_t* __beg, const wchar_t* __end, wchar_t __c) wstring::_S_find(const wchar_t* __beg, const wchar_t* __end, wchar_t __c)
......
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