This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Add TPF config support to libstdc++


Hello,

this adds config support for the TPF operating system
(and thus the s390x-ibm-tpf target) to the libstdc++ library.

Contributed by PJ Darcy <darcypj@us.ibm.com>.

OK for mainline?

Bye,
Ulrich


2003-12-18  Ulrich Weigand  <uweigand@de.ibm.com>
	    PJ Darcy  <darcypj@us.ibm.com>

	* configure.host: Add support for *-tpf.
	* crossconfig.m4: Likewise.
	* configure: Regenerate.
	* config/os/tpf: New directory.
	* config/os/tpf/os_defines.h: New file.
	* config/os/tpf/ctype_base.h: Likewise.
	* config/os/tpf/ctype_inline.h: Likewise.
	* config/os/tpf/ctype_noninline.h: Likewise.


Index: libstdc++-v3/configure.host
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.host,v
retrieving revision 1.21
diff -c -p -r1.21 configure.host
*** libstdc++-v3/configure.host	7 Nov 2003 16:49:18 -0000	1.21
--- libstdc++-v3/configure.host	18 Dec 2003 20:43:03 -0000
*************** case "${host_os}" in
*** 186,191 ****
--- 186,194 ----
    solaris2.[789] | solaris2.1[0-9])
      os_include_dir="os/solaris/solaris2.7"
      ;;
+   tpf)
+     os_include_dir="os/tpf"
+     ;;
    vxworks)
      os_include_dir="os/vxworks"
      ;;
Index: libstdc++-v3/crossconfig.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/crossconfig.m4,v
retrieving revision 1.10
diff -c -p -r1.10 crossconfig.m4
*** libstdc++-v3/crossconfig.m4	4 Dec 2003 19:37:14 -0000	1.10
--- libstdc++-v3/crossconfig.m4	18 Dec 2003 20:43:03 -0000
*************** case "${host}" in
*** 322,327 ****
--- 322,354 ----
      AC_DEFINE(HAVE_MODFF)
      AC_DEFINE(HAVE_HYPOT)
      ;;
+   *-tpf)
+     AC_CHECK_HEADERS([nan.h endian.h machine/endian.h  \
+       sys/param.h sys/types.h locale.h float.h inttypes.h])
+     SECTION_FLAGS='-ffunction-sections -fdata-sections'
+     AC_SUBST(SECTION_FLAGS)
+     GLIBCXX_CHECK_LINKER_FEATURES
+     GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
+     GLIBCXX_CHECK_WCHAR_T_SUPPORT
+     AC_DEFINE(HAVE_COPYSIGN)
+     AC_DEFINE(HAVE_COPYSIGNF)
+     AC_DEFINE(HAVE_FINITE)
+     AC_DEFINE(HAVE_FINITEF)
+     AC_DEFINE(HAVE_FREXPF)
+     AC_DEFINE(HAVE_HYPOTF)
+     AC_DEFINE(HAVE_ISINF)
+     AC_DEFINE(HAVE_ISINFF)
+     AC_DEFINE(HAVE_ISNAN)
+     AC_DEFINE(HAVE_ISNANF)
+     AC_DEFINE(HAVE_SINCOS)
+     AC_DEFINE(HAVE_SINCOSF)
+     if test x"long_double_math_on_this_cpu" = x"yes"; then
+       AC_DEFINE(HAVE_FINITEL)
+       AC_DEFINE(HAVE_HYPOTL)
+       AC_DEFINE(HAVE_ISINFL)
+       AC_DEFINE(HAVE_ISNANL)
+     fi
+     ;;
    *-vxworks)
      AC_DEFINE(HAVE_MMAP)
      AC_DEFINE(HAVE_ACOSF)
*** /dev/null	Mon Aug 11 14:39:14 2003
--- libstdc++-v3/config/os/tpf/ctype_base.h	Thu Dec 18 21:39:40 2003
***************
*** 0 ****
--- 1,56 ----
+ // Locale support TPF -*- C++ -*-
+ 
+ // Copyright (C) 2003 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
+   
+   struct ctype_base
+   {
+     // Non-standard typedefs.
+     typedef const int* 		__to_type;
+ 
+     // NB: Offsets into ctype<char>::_M_table force a particular size
+     // on the mask type. Because of this, we don't use an enum.
+     typedef unsigned short 	mask;   
+     static const mask upper    	= _ISupper;
+     static const mask lower 	= _ISlower;
+     static const mask alpha 	= _ISalpha;
+     static const mask digit 	= _ISdigit;
+     static const mask xdigit 	= _ISxdigit;
+     static const mask space 	= _ISspace;
+     static const mask print 	= _ISprint;
+     static const mask graph 	= _ISgraph;
+     static const mask blank	= _ISblank;
+     static const mask cntrl 	= _IScntrl;
+     static const mask punct 	= _ISpunct;
+     static const mask alnum 	= _ISalnum;
+   };
*** /dev/null	Mon Aug 11 14:39:14 2003
--- libstdc++-v3/config/os/tpf/ctype_inline.h	Thu Dec 18 21:39:40 2003
***************
*** 0 ****
--- 1,69 ----
+ // Locale support -*- C++ -*-
+ 
+ // Copyright (C) 2003 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
+   { return _M_table[static_cast<unsigned char>(__c)] & __m; }
+ 
+   const char*
+   ctype<char>::
+   is(const char* __low, const char* __high, mask* __vec) const
+   {
+     while (__low < __high)
+       *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
+     return __high;
+   }
+ 
+   const char*
+   ctype<char>::
+   scan_is(mask __m, const char* __low, const char* __high) const
+   {
+     while (__low < __high 
+ 	   && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
+       ++__low;
+     return __low;
+   }
+ 
+   const char*
+   ctype<char>::
+   scan_not(mask __m, const char* __low, const char* __high) const
+   {
+     while (__low < __high 
+ 	   && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
+       ++__low;
+     return __low;
+   }
*** /dev/null	Mon Aug 11 14:39:14 2003
--- libstdc++-v3/config/os/tpf/ctype_noninline.h	Thu Dec 18 21:39:40 2003
***************
*** 0 ****
--- 1,103 ----
+ // Locale support -*- C++ -*-
+ 
+ // Copyright (C) 2003 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
+ 
+   const ctype_base::mask*
+   ctype<char>::classic_table() throw()
+   {
+     const ctype_base::mask* __ret;
+     char* __old = strdup(setlocale(LC_CTYPE, NULL));
+     setlocale(LC_CTYPE, "C");
+     __ret = *__ctype_b_loc();
+     setlocale(LC_CTYPE, __old);
+     free(__old);
+     return __ret;
+   }
+ 
+   ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
+ 		     size_t __refs) 
+   : facet(__refs), _M_del(__table != 0 && __del)
+   {
+     char* __old=strdup(setlocale(LC_CTYPE, NULL));
+     setlocale(LC_CTYPE, "C");
+     _M_toupper = *__ctype_toupper_loc();
+     _M_tolower = *__ctype_tolower_loc();
+     _M_table = __table ? __table : *__ctype_b_loc();
+     setlocale(LC_CTYPE, __old);
+     free(__old);
+     _M_c_locale_ctype = _S_get_c_locale();
+   }
+ 
+   ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+   : facet(__refs), _M_del(__table != 0 && __del)
+   {
+     char* __old=strdup(setlocale(LC_CTYPE, NULL));
+     setlocale(LC_CTYPE, "C");
+     _M_toupper = *__ctype_toupper_loc();
+     _M_tolower = *__ctype_tolower_loc();
+     _M_table = __table ? __table : *__ctype_b_loc();
+     setlocale(LC_CTYPE, __old);
+     free(__old);
+     _M_c_locale_ctype = _S_get_c_locale();
+   }
+ 
+   char
+   ctype<char>::do_toupper(char __c) const
+   { return _M_toupper[static_cast<unsigned char>(__c)]; }
+ 
+   const char*
+   ctype<char>::do_toupper(char* __low, const char* __high) const
+   {
+     while (__low < __high)
+       {
+ 	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
+ 	++__low;
+       }
+     return __high;
+   }
+ 
+   char
+   ctype<char>::do_tolower(char __c) const
+   { return _M_tolower[static_cast<unsigned char>(__c)]; }
+ 
+   const char* 
+   ctype<char>::do_tolower(char* __low, const char* __high) const
+   {
+     while (__low < __high)
+       {
+ 	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
+ 	++__low;
+       }
+     return __high;
+   }
*** /dev/null	Mon Aug 11 14:39:14 2003
--- libstdc++-v3/config/os/tpf/os_defines.h	Thu Dec 18 21:39:45 2003
***************
*** 0 ****
--- 1,48 ----
+ // Specific definitions for TPF  -*- C++ -*-
+ 
+ // Copyright (C) 2003 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.
+ 
+ #ifndef _GLIBCXX_OS_DEFINES
+ #define _GLIBCXX_OS_DEFINES 1
+ 
+ // System-specific #define, typedefs, corrections, etc, go here.  This
+ // file will come before all others.
+ 
+ // TPF is a big endian OS, let it be known here.
+ #define _BIG_ENDIAN 1
+ #define BIG_ENDIAN  1 
+ 
+ // This keeps isanum, et al from being propagated as macros.
+ #define __NO_CTYPE 1
+ 
+ #include <features.h>
+ 
+ // We must not see the optimized string functions GNU libc defines.
+ #define __NO_STRING_INLINES
+ 
+ #endif
-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]