[patch] --enable-libstdcxx-v3

Benjamin Kosnik bkoz@cygnus.com
Wed Apr 5 19:59:00 GMT 2000


This patch uses a new configure switch, --enable-libstdcxx-v3, to
select between the libstdc++-v2 and libstdc++-v3 libraries. By
default, nothing changes, and libio and libstdc++ are built as before.
If --enable-libstdcxx-v3 is passed as a configuration-time switch,
then the following happens:

 - flag_honor_std is activacted 
 - libstdc++-v3 is configured and built instead of libio and libstdc++

Installation, headers, all depend on what is configured. Enabling
libstdc++-v3 requires that libstdc++-v3 be checked out, and placed
into a folder named "libstdc++-v" in the root level of the gcc CVS
tree.

-Benjamin

2000-04-05  Benjamin Kosnik  <bkoz@cygnus.com>
            Martin v. Loewis  <martin@loewis.home.cs.tu-berlin.de>

        * configure.in (enable_libstdcxx_v3): Add.
        (target_libs): Add bits here to switch between libstdc++-v2 and
        libstdc++-v3.
	* config.if: And this file too.
        * Makefile.in: Add libstdc++-v3 targets.

2000-04-05   Benjamin Kosnik  <bkoz@cygnus.com>

        * configure.in: And here.
        * configure: Regenerate.
        * acconfig.h: Add ENABLE_STD_NAMESPACE to set flag_honor_std if
        --enable-libstdcxx-v3 is passed at configure time.
        * config.h.in: Regenerate.

2000-04-05  Benjamin Kosnik  <bkoz@cygnus.com>

        * decl2.c: Make flag_honor_std dependant on ENABLE_STD_NAMESPACE.

Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/configure.in,v
retrieving revision 1.46
diff -u -p -c -p -r1.46 configure.in
*** configure.in	2000/03/30 02:08:17	1.46
--- configure.in	2000/04/06 02:53:54
*************** if [ "${enable_gdbgui}" = "yes" ] ; then
*** 47,52 ****
--- 47,59 ----
  	host_libs="${host_libs} libgui"
  fi
  
+ # Set up configure/Makefile variables if libstdc++-v3 is to be built.
+ if [ "${enable_libstdcxx_v3}" = "yes" ] ; then
+         libstdcxx_version="target-libstdc++-v3"
+ else
+         libstdcxx_version="target-libio target-libstdc++"
+ fi
+ 
  # these tools are built for the host environment
  # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
  # know that we are building the simulator.
*************** host_tools="texinfo byacc flex bison bin
*** 59,67 ****
  target_libs="target-libiberty \
  		target-libgloss \
  		target-newlib \
! 		target-libio \
  		target-librx \
- 		target-libstdc++ \
  		target-libg++ \
  		target-libf2c \
  		target-libchill \
--- 66,73 ----
  target_libs="target-libiberty \
  		target-libgloss \
  		target-newlib \
! 		${libstdcxx_version} \
  		target-librx \
  		target-libg++ \
  		target-libf2c \
  		target-libchill \
*************** esac
*** 561,567 ****
  
  case "${target}" in
    *-*-netware)
!     noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-librx target-newlib target-libiberty target-libgloss"
      ;;
    *-*-rtems*)
      noconfigdirs="$noconfigdirs target-libgloss"
--- 567,573 ----
  
  case "${target}" in
    *-*-netware)
!     noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version} target-librx target-newlib target-libiberty target-libgloss"
      ;;
    *-*-rtems*)
      noconfigdirs="$noconfigdirs target-libgloss"
*************** case "${target}" in
*** 598,608 ****
      noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
      noconfigdirs="$noconfigdirs expect dejagnu"
      # the C++ libraries don't build on top of CE's C libraries
!     noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio"
      skipdirs="$skipdirs target-newlib"
      case "${host}" in
        *-*-cygwin*) ;; # keep gdb and readline
!       *) noconfigdirs="$noconfigdirs gdb readline target-libio target-libstdc++ target-libg++"
  	 ;;
      esac
      ;;
--- 604,614 ----
      noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
      noconfigdirs="$noconfigdirs expect dejagnu"
      # the C++ libraries don't build on top of CE's C libraries
!     noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version}"
      skipdirs="$skipdirs target-newlib"
      case "${host}" in
        *-*-cygwin*) ;; # keep gdb and readline
!       *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version} target-libg++"
  	 ;;
      esac
      ;;
*************** case "${target}" in
*** 625,631 ****
      fi
      ;;
    c4x-*-*)
!     noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
      ;;
    thumb-*-coff)
      noconfigdirs="$noconfigdirs target-libgloss"
--- 631,637 ----
      fi
      ;;
    c4x-*-*)
!     noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version}  target-librx target-libgloss"
      ;;
    thumb-*-coff)
      noconfigdirs="$noconfigdirs target-libgloss"
*************** case "${target}" in
*** 634,640 ****
      noconfigdirs="$noconfigdirs ld target-libgloss"
      ;;
    d10v-*-*)
!     noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio target-libgloss"
      ;;
    fr30-*-elf*)
      if [ x${is_cross_compiler} != xno ] ; then
--- 640,646 ----
      noconfigdirs="$noconfigdirs ld target-libgloss"
      ;;
    d10v-*-*)
!     noconfigdirs="$noconfigdirs target-librx target-libg++ ${libstdcxx_version} target-libgloss"
      ;;
    fr30-*-elf*)
      if [ x${is_cross_compiler} != xno ] ; then
*************** case "${target}" in
*** 643,649 ****
      ;;
    h8300*-*-* | \
    h8500-*-*)
!     noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
      ;;
    hppa*-*-*elf* | \
    hppa*-*-lites*)
--- 649,655 ----
      ;;
    h8300*-*-* | \
    h8500-*-*)
!     noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version}  target-librx target-libgloss"
      ;;
    hppa*-*-*elf* | \
    hppa*-*-lites*)
*************** case "${target}" in
*** 661,667 ****
      ;;
    i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*)
      # but don't build gdb
!     noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx"
      ;;
    *-*-linux*)
      # linux has rx in libc
--- 667,673 ----
      ;;
    i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*)
      # but don't build gdb
!     noconfigdirs="$noconfigdirs gdb target-libg++ ${libstdcxx_version} target-librx"
      ;;
    *-*-linux*)
      # linux has rx in libc
*************** case "${target}" in
*** 692,698 ****
      esac
      ;;    
    i[3456]86-*-pe)
!     noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
      ;;
    i[3456]86-*-sco3.2v5*)
      # The linker does not yet know about weak symbols in COFF,
--- 698,704 ----
      esac
      ;;    
    i[3456]86-*-pe)
!     noconfigdirs="$noconfigdirs target-libg++ ${libstdcxx_version} target-librx target-libgloss"
      ;;
    i[3456]86-*-sco3.2v5*)
      # The linker does not yet know about weak symbols in COFF,
*************** case "${target}" in
*** 831,837 ****
      fi
      ;;
    v810-*-*)
!     noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libio target-libg++ target-libstdc++ opcodes target-libgloss"
      ;;
    v850-*-*)
      noconfigdirs="$noconfigdirs target-libgloss"
--- 837,843 ----
      fi
      ;;
    v810-*-*)
!     noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} target-libg++ opcodes target-libgloss"
      ;;
    v850-*-*)
      noconfigdirs="$noconfigdirs target-libgloss"
Index: config.if
===================================================================
RCS file: /cvs/gcc/egcs/config.if,v
retrieving revision 1.2
diff -u -p -c -p -r1.2 config.if
*** config.if	1998/10/18 17:37:10	1.2
--- config.if	2000/04/06 02:54:13
*************** else
*** 21,29 ****
    if_topsrcdir=${top_srcdir}
  fi
  
! if [ -f ${if_topsrcdir}/libstdc++/Makefile.in ]; then
  # We check libstdc++ for libstdcxx_interface.
! libstdcxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/libstdc++/Makefile.in | sed 's/INTERFACE[ 	]*=[ 	]*\(.*\)/\1/'`
  else
  libstdcxx_interface=
  fi
--- 21,36 ----
    if_topsrcdir=${top_srcdir}
  fi
  
! if [ "${enable_libstdcxx_v3}" = "yes" ] ; then
!   libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3
! else
!   libstdcxx_srcdir=${if_topsrcdir}/libstdc++
! fi
! 
! echo "${libstdcxx_srcdir} is where"
! if [ -f ${libstdcxx_srcdir}/Makefile.in ]; then
  # We check libstdc++ for libstdcxx_interface.
! libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[ 	]*=[ 	]*\(.*\)/\1/'`
  else
  libstdcxx_interface=
  fi
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/Makefile.in,v
retrieving revision 1.44
diff -u -p -c -p -r1.44 Makefile.in
*** Makefile.in	2000/02/26 20:04:50	1.44
--- Makefile.in	2000/04/06 02:54:31
*************** INSTALL_X11_MODULES = \
*** 772,777 ****
--- 772,778 ----
  ALL_TARGET_MODULES = \
  	all-target-libio \
  	all-target-libstdc++ \
+ 	all-target-libstdc++-v3 \
  	all-target-librx \
  	all-target-libg++ \
  	all-target-newlib \
*************** ALL_TARGET_MODULES = \
*** 795,800 ****
--- 796,802 ----
  CONFIGURE_TARGET_MODULES = \
  	configure-target-libio \
  	configure-target-libstdc++ \
+ 	configure-target-libstdc++-v3 \
  	configure-target-librx \
  	configure-target-libg++ \
  	configure-target-newlib \
*************** CONFIGURE_TARGET_MODULES = \
*** 818,823 ****
--- 820,826 ----
  CHECK_TARGET_MODULES = \
  	check-target-libio \
  	check-target-libstdc++ \
+ 	check-target-libstdc++-v3 \
  	check-target-libg++ \
  	check-target-newlib \
  	check-target-libf2c \
*************** CHECK_TARGET_MODULES = \
*** 836,841 ****
--- 839,845 ----
  INSTALL_TARGET_MODULES = \
  	install-target-libio \
  	install-target-libstdc++ \
+ 	install-target-libstdc++-v3 \
  	install-target-libg++ \
  	install-target-newlib \
  	install-target-libf2c \
*************** CLEAN_MODULES = \
*** 922,927 ****
--- 926,932 ----
  CLEAN_TARGET_MODULES = \
  	clean-target-libio \
  	clean-target-libstdc++ \
+ 	clean-target-libstdc++-v3 \
  	clean-target-librx \
  	clean-target-libg++ \
  	clean-target-newlib \
*************** all-target-libjava: configure-target-lib
*** 1634,1640 ****
--- 1639,1647 ----
  configure-target-librx: $(ALL_GCC) configure-target-newlib
  all-target-librx: configure-target-librx
  configure-target-libstdc++: $(ALL_GCC)
+ configure-target-libstdc++-v3: $(ALL_GCC)
  all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio
+ all-target-libstdc++-v3: configure-target-libstdc++-v3 all-gas all-ld all-gcc all-target-libiberty all-target-newlib 
  configure-target-libstub: $(ALL_GCC)
  all-target-libstub: configure-target-libstub
  all-libtool:
Index: gcc/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/configure.in,v
retrieving revision 1.351
diff -u -p -c -p -r1.351 configure.in
*** configure.in	2000/04/05 07:34:36	1.351
--- configure.in	2000/04/06 02:54:53
*************** echo "Building a new-abi g++ compiler."
*** 4601,4606 ****
--- 4601,4621 ----
  ])
  AC_SUBST(GXX_ABI_FLAG)
  
+ # Build a new-libstdc++ system (ie libstdc++-v3)
+ AC_MSG_CHECKING([for libstdc++ to install])
+ AC_ARG_ENABLE(libstdcxx-v3,
+ [  --enable-libstdcxx-v3 
+ 			  enable libstdc++-v3 for building and installation],
+   [enable_libstdcxx_v3=yes], [enable_libstdcxx_v3=no])
+ 
+ if test x$enable_libstdcxx_v3 = xyes; then
+   AC_MSG_RESULT(v3)
+   AC_DEFINE(ENABLE_STD_NAMESPACE)
+ else
+   AC_MSG_RESULT(v2)
+ fi
+ 
+ 
  # Make empty files to contain the specs and options for each language.
  # Then add #include lines to for a compiler that has specs and/or options.
  
Index: gcc/acconfig.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/acconfig.h,v
retrieving revision 1.44
diff -u -p -c -p -r1.44 acconfig.h
*** acconfig.h	2000/04/05 07:34:36	1.44
--- acconfig.h	2000/04/06 02:55:09
***************
*** 4,9 ****
--- 4,15 ----
  /* Define if printf supports "%p".  */
  #undef HAVE_PRINTF_PTR
  
+ /* Define if you want to enable namespaces (-fhonor-std) by default. */
+ #undef ENABLE_STD_NAMESPACE
+ #if !defined(ENABLE_STD_NAMESPACE)
+ #  define ENABLE_STD_NAMESPACE 0
+ #endif
+ 
  /* Define if you want to always select the new-abi for g++.  */
  #undef ENABLE_NEW_GXX_ABI
  
Index: gcc/cp/decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.323
diff -u -p -c -p -r1.323 decl2.c
*** decl2.c	2000/04/04 18:13:19	1.323
--- decl2.c	2000/04/06 02:55:38
*************** int flag_use_cxa_atexit;
*** 452,458 ****
  
  /* Nonzero to not ignore namespace std. */
  
! int flag_honor_std;
  
  /* Nonzero if we should expand functions calls inline at the tree
     level, rather than at the RTL level.  */
--- 452,458 ----
  
  /* Nonzero to not ignore namespace std. */
  
! int flag_honor_std = ENABLE_STD_NAMESPACE;
  
  /* Nonzero if we should expand functions calls inline at the tree
     level, rather than at the RTL level.  */


More information about the Gcc-patches mailing list