+2000-05-09 Benjamin Kosnik <bkoz@gnu.org>
+
+ * acinclude.m4 (GLIBCPP_CHECK_CPU): Change powerpc bits to
+ -mcpu=powerpc.
+
+ * config/generic/bits/ctype_specializations.h (ctype<char>::is):
+ Make more generic.
+
+ * config/bsd: New directory.
+ * config/bsd/ctype.cc: New.
+ * config/bsd/bits/ctype_base.h (ctype_base): New.
+ * config/bsd/bits/ctype_specializations.h: New.
+ * acinclude.m4 (GLIBCPP_CHECK_CTYPE): Add bsd tests.
+
2000-05-09 Phil Edwards <pme@sourceware.cygnus.com>
* acinclude.m4: New macro, GLIBCPP_ENABLE_CXX_FLAGS.
DEBUGFLAGS = @DEBUGFLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
+EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCC_OBJDIR = @GCC_OBJDIR@
GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@
;;
powerpc | rs6000)
cpu_include_dir="config/cpu/powerpc"
- CPUFLAGS='-mnew-mnemonics -Wa,-mppc -mpowerpc'
+ CPUFLAGS='-mcpu=powerpc'
;;
sparc64 | ultrasparc)
cpu_include_dir="config/cpu/sparc/sparc64"
ctype_default=no
fi
+ dnl Test for <ctype> functionality -- BSD
+ AC_MSG_CHECKING([<ctype> for bsd ])
+ AC_TRY_COMPILE([#include <ctype.h>],
+ [int
+ foo (int a)
+ { return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \
+ + _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}], \
+ ctype_bsd=yes, ctype_bsd=no)
+ AC_MSG_RESULT($ctype_bsd)
+ if test $ctype_bsd = "yes"; then
+ ctype_include_dir="config/bsd"
+ ctype_default=no
+ fi
+
dnl Test for <ctype> functionality -- solaris 2.6 and 2.7
if test $ctype_default = "yes"; then
AC_MSG_CHECKING([<ctype> for solaris 2.[6,7,8] ])
;;
powerpc | rs6000)
cpu_include_dir="config/cpu/powerpc"
- CPUFLAGS='-mnew-mnemonics -Wa,-mppc -mpowerpc'
+ CPUFLAGS='-mcpu=powerpc'
;;
sparc64 | ultrasparc)
cpu_include_dir="config/cpu/sparc/sparc64"
ctype_default=no
fi
+ dnl Test for <ctype> functionality -- BSD
+ AC_MSG_CHECKING([<ctype> for bsd ])
+ AC_TRY_COMPILE([#include <ctype.h>],
+ [int
+ foo (int a)
+ { return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \
+ + _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}], \
+ ctype_bsd=yes, ctype_bsd=no)
+ AC_MSG_RESULT($ctype_bsd)
+ if test $ctype_bsd = "yes"; then
+ ctype_include_dir="config/bsd"
+ ctype_default=no
+ fi
+
dnl Test for <ctype> functionality -- solaris 2.6 and 2.7
if test $ctype_default = "yes"; then
AC_MSG_CHECKING([<ctype> for solaris 2.[6,7,8] ])
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
+// If using the namespace std, you need this. Eventually this should
+// not be an option. In the meantime, and as things like std_ctype.h
+// need to be hacked out, give people the option. If this is set to 1,
+// CXXFLAGS should include -fhonor-std. If this is undefined, CXXFLAGS
+// should include -fno-honor-std.
+#undef _GLIBCPP_USE_NAMESPACES
+
// Include support for 'long long' and 'unsigned long long'.
#undef _GLIBCPP_USE_LONG_LONG
--- /dev/null
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// Information as gleaned from /usr/include/ctype.h on FreeBSD 4.0
+
+ struct ctype_base
+ {
+ typedef unsigned long mask;
+ // Non-standard typedefs.
+ typedef const int* __to_type;
+
+ enum
+ {
+ space = _CTYPE_S,
+ print = _CTYPE_R,
+ cntrl = _CTYPE_C,
+ upper = _CTYPE_U,
+ lower = _CTYPE_L,
+ alpha = _CTYPE_A,
+ digit = _CTYPE_D,
+ punct = _CTYPE_P,
+ xdigit = _CTYPE_X,
+ alnum = _CTYPE_A | _CTYPE_D,
+ graph = _CTYPE_G
+ };
+ };
+
+
+
--- /dev/null
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
+// functions go in ctype.cc
+
+ bool
+ ctype<char>::
+ is(mask __m, char __c) const throw()
+ {
+ if (__m & digit || __m & xdigit)
+ return __isctype(__c, __m);
+ else
+ return __istype(__c);
+ }
+
+ const char*
+ ctype<char>::
+ is(const char* __low, const char* __high, mask* __vec) const throw()
+ {
+ // XXX
+ while (__low < __high)
+ *__vec++ = _M_table[(unsigned char)(*__low++)];
+ return __high;
+ }
+
+ const char*
+ ctype<char>::
+ scan_is(mask __m, const char* __low, const char* __high) const throw()
+ {
+ while (__low < __high && !this->is(__m, *__low))
+ ++__low;
+ return __low;
+ }
+
+ const char*
+ ctype<char>::
+ scan_not(mask __m, const char* __low, const char* __high) const throw()
+ {
+ while (__low < __high && this->is(__m, *__low) != 0)
+ ++__low;
+ return __low;
+ }
+
+
+
+
+
--- /dev/null
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+//
+// ISO C++ 14882: 22.1 Locales
+//
+
+// Information as gleaned from /usr/include/ctype.h
+
+ ctype<char>::ctype(const mask* __table = 0, bool __del = false,
+ size_t __refs = 0) throw()
+ : _Ctype_nois<char>(__refs), _M_del(__table != 0 && __del),
+ _M_toupper(NULL), _M_tolower(NULL),
+ _M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table)
+ { }
+
+ char
+ ctype<char>::do_toupper(char __c) const
+ { return toupper((int) __c); }
+
+ const char*
+ ctype<char>::do_toupper(char* __low, const char* __high) const
+ {
+ while (__low < __high)
+ {
+ *__low = toupper((int) *__low);
+ ++__low;
+ }
+ return __high;
+ }
+
+ char
+ ctype<char>::do_tolower(char __c) const
+ { return tolower((int) __c); }
+
+ const char*
+ ctype<char>::do_tolower(char* __low, const char* __high) const
+ {
+ while (__low < __high)
+ {
+ *__low = tolower((int) *__low);
+ ++__low;
+ }
+ return __high;
+ }
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+ ctype<wchar_t>::ctype(size_t /*__refs*/) throw()
+ : _M_toupper(NULL), _M_tolower(NULL),
+ _M_ctable(NULL)
+ { }
+
+ wchar_t
+ ctype<wchar_t>::do_toupper(char_type __c) const
+ { return (__c < _S_table_size) ? _S_toupper[__c] : __c; }
+
+ const wchar_t*
+ ctype<wchar_t>::do_toupper(char_type* low, const char_type* high) const
+ {
+ for (;low < high; ++low)
+ if (*low < _S_table_size)
+ *low = _S_toupper[*low];
+ return high;
+ }
+
+ wchar_t
+ ctype<wchar_t>::do_tolower(char_type __c) const
+ { return (__c < _S_table_size) ? _S_tolower[__c] : __c; }
+
+ const wchar_t*
+ ctype<wchar_t>::do_tolower(char_type* __low, const char_type* __high) const
+ {
+ for (; __low < __high; ++__low)
+ if (*__low < _S_table_size)
+ *__low = _S_toupper[*__low];
+ return __high;
+ }
+#endif
+
+
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const throw()
{
- while (__low < __high && !(_M_table[(unsigned char)(*__low)] & __m))
+ while (__low < __high && !this->is(__m, *__low))
++__low;
return __low;
}
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const throw()
{
- while (__low < __high
- && (_M_table[(unsigned char)(*__low)] & __m) != 0)
+ while (__low < __high && this->is(__m, *__low) != 0)
++__low;
return __low;
}
;;
powerpc | rs6000)
cpu_include_dir="config/cpu/powerpc"
- CPUFLAGS='-mnew-mnemonics -Wa,-mppc -mpowerpc'
+ CPUFLAGS='-mcpu=powerpc'
;;
sparc64 | ultrasparc)
cpu_include_dir="config/cpu/sparc/sparc64"
ctype_default=no
fi
+ echo $ac_n "checking <ctype> for bsd ""... $ac_c" 1>&6
+echo "configure:3529: checking <ctype> for bsd " >&5
+ cat > conftest.$ac_ext <<EOF
+#line 3531 "configure"
+#include "confdefs.h"
+#include <ctype.h>
+int main() {
+int
+ foo (int a)
+ { return _CTYPE_S + _CTYPE_R + _CTYPE_C + _CTYPE_U + _CTYPE_L + _CTYPE_A \
+ + _CTYPE_D + _CTYPE_P + _CTYPE_X + _CTYPE_G ;}
+; return 0; }
+EOF
+if { (eval echo configure:3541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ \
+ ctype_bsd=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ctype_bsd=no
+fi
+rm -f conftest*
+ echo "$ac_t""$ctype_bsd" 1>&6
+ if test $ctype_bsd = "yes"; then
+ ctype_include_dir="config/bsd"
+ ctype_default=no
+ fi
+
if test $ctype_default = "yes"; then
echo $ac_n "checking <ctype> for solaris 2.6,7,8 ""... $ac_c" 1>&6
-echo "configure:3530: checking <ctype> for solaris 2.6,7,8 " >&5
+echo "configure:3560: checking <ctype> for solaris 2.6,7,8 " >&5
cat > conftest.$ac_ext <<EOF
-#line 3532 "configure"
+#line 3562 "configure"
#include "confdefs.h"
#include <ctype.h>
int main() {
+ __trans_lower[a] + __trans_upper[a] + __ctype_mask[a];}
; return 0; }
EOF
-if { (eval echo configure:3543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
\
ctype_solaris=yes
if test $ctype_solaris = "yes"; then
echo $ac_n "checking for version""... $ac_c" 1>&6
-echo "configure:3558: checking for version" >&5
+echo "configure:3588: checking for version" >&5
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CXXCPP $CPPFLAGS'
cross_compiling=$ac_cv_prog_cxx_cross
cat > conftest.$ac_ext <<EOF
-#line 3567 "configure"
+#line 3597 "configure"
#include "confdefs.h"
#include <ctype.h>
int main() {
typedef long* __to_type; __to_type const& _M_toupper = __trans_upper;
; return 0; }
EOF
-if { (eval echo configure:3574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
\
ctype_solaris26=yes
if test $ctype_default = "yes"; then
echo $ac_n "checking <ctype> for solaris 2.5.1 ""... $ac_c" 1>&6
-echo "configure:3606: checking <ctype> for solaris 2.5.1 " >&5
+echo "configure:3636: checking <ctype> for solaris 2.5.1 " >&5
cat > conftest.$ac_ext <<EOF
-#line 3608 "configure"
+#line 3638 "configure"
#include "confdefs.h"
#include <ctype.h>
int main() {
+ __ctype[a];}
; return 0; }
EOF
-if { (eval echo configure:3618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3648: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
\
ctype_solaris25=yes
if test $ctype_default = "yes"; then
echo $ac_n "checking <ctype> for aix ""... $ac_c" 1>&6
-echo "configure:3638: checking <ctype> for aix " >&5
+echo "configure:3668: checking <ctype> for aix " >&5
cat > conftest.$ac_ext <<EOF
-#line 3640 "configure"
+#line 3670 "configure"
#include "confdefs.h"
#include <ctype.h>
int main() {
+ _VALC('a') + _IS('c', 0);}
; return 0; }
EOF
-if { (eval echo configure:3651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
\
ctype_aix=yes
if test $ctype_default = "yes"; then
echo $ac_n "checking <ctype> for newlib ""... $ac_c" 1>&6
-echo "configure:3671: checking <ctype> for newlib " >&5
+echo "configure:3701: checking <ctype> for newlib " >&5
cat > conftest.$ac_ext <<EOF
-#line 3673 "configure"
+#line 3703 "configure"
#include "confdefs.h"
#include <ctype.h>
int main() {
+ _ctype_[a];}
; return 0; }
EOF
-if { (eval echo configure:3683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
\
ctype_newlib=yes
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3717: checking for $ac_hdr" >&5
+echo "configure:3747: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3722 "configure"
+#line 3752 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3756: checking for $ac_func" >&5
+echo "configure:3786: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3761 "configure"
+#line 3791 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:3784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3809: checking for working mmap" >&5
+echo "configure:3839: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 3817 "configure"
+#line 3847 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
}
EOF
-if { (eval echo configure:3957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:4020: checking for LC_MESSAGES" >&5
+echo "configure:4050: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'ac_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4025 "configure"
+#line 4055 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:4032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_val_LC_MESSAGES=yes
else
DEBUGFLAGS = @DEBUGFLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
+EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCC_OBJDIR = @GCC_OBJDIR@
GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@
DEBUGFLAGS = @DEBUGFLAGS@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
+EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
GCC_OBJDIR = @GCC_OBJDIR@
GLIBCPP_CFLAGS = @GLIBCPP_CFLAGS@
GLIBCPP_CXXFLAGS = @GLIBCPP_CXXFLAGS@