This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

suggested --enable-concept-checks



This adds the --enable switch as suggested.  The effect is the same (defining
_GLIBCPP_CONCEPT_CHECKS), and is done via the automatic acconfig.h rather
than editing the prewritten c++config; everything still ends up in the
generated c++config.h.

It also shuffles some blanks around in the description text for some
other --enable's in acinclude.m4, just because I like nicely-formatted
output from configure's --help.  :-)

Enabling the switch will cause a horrible linker mess the first time you
try to link anything.  That's because the library is missing 253 template
symbols that would otherwise be automatically instantiated.  I'm trying
to come up with a way of handling those (easy) that doesn't suck (not easy).

Okay to apply to trunk, once I get the symbol problem solved?


Index: acconfig.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acconfig.h,v
retrieving revision 1.16
diff -c -3 -p -r1.16 acconfig.h
*** acconfig.h	2001/04/20 08:59:22	1.16
--- acconfig.h	2001/04/21 02:09:27
***************
*** 24,29 ****
--- 24,32 ----
  // Define if code specialized for wchar_t should be used.
  #undef _GLIBCPP_USE_WCHAR_T
  
+ // Define to concept checking code from the boost libraries.
+ #undef _GLIBCPP_CONCEPT_CHECKS
+ 
  // Define if you have the atan2f function.
  #undef _GLIBCPP_HAVE_ATAN2F 
  
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.142
diff -c -3 -p -r1.142 acinclude.m4
*** acinclude.m4	2001/04/20 22:26:53	1.142
--- acinclude.m4	2001/04/21 02:09:29
*************** dnl
*** 1039,1046 ****
  AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
    AC_MSG_CHECKING([for clocale to use])
    AC_ARG_ENABLE(clocale,
!   [  --enable-clocale       enable model for target locale package. 
!      --enable-clocale=MODEL use MODEL target-speific locale package. [default=generic]
    ], 
    if test x$enable_clocale = xno; then
       enable_clocale=generic
--- 1039,1046 ----
  AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
    AC_MSG_CHECKING([for clocale to use])
    AC_ARG_ENABLE(clocale,
!   [  --enable-clocale        enable model for target locale package. 
!   --enable-clocale=MODEL  use MODEL target-speific locale package. [default=generic]
    ], 
    if test x$enable_clocale = xno; then
       enable_clocale=generic
*************** dnl
*** 1083,1090 ****
  AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
    AC_MSG_CHECKING([for cstdio to use])
    AC_ARG_ENABLE(cstdio,
!   [  --enable-cstdio        enable stdio for target io package. 
!      --enable-cstdio=LIB    use LIB target-speific io package. [default=stdio]
    ], 
    if test x$enable_cstdio = xno; then
       enable_cstdio=stdio
--- 1083,1090 ----
  AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
    AC_MSG_CHECKING([for cstdio to use])
    AC_ARG_ENABLE(cstdio,
!   [  --enable-cstdio         enable stdio for target io package. 
!   --enable-cstdio=LIB     use LIB target-speific io package. [default=stdio]
    ], 
    if test x$enable_cstdio = xno; then
       enable_cstdio=stdio
*************** AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
*** 1203,1210 ****
    dnl Efforts should be made to keep this in sync.
    AC_MSG_CHECKING([for threads package to use])
    AC_ARG_ENABLE(threads,
!   [  --enable-threads       enable thread usage for target GCC.
!      --enable-threads=LIB   use LIB thread package for target GCC. [default=no]
    ],
    if test x$enable_threads = xno; then
      enable_threads=''
--- 1203,1210 ----
    dnl Efforts should be made to keep this in sync.
    AC_MSG_CHECKING([for threads package to use])
    AC_ARG_ENABLE(threads,
!   [  --enable-threads        enable thread usage for target GCC.
!   --enable-threads=LIB    use LIB thread package for target GCC. [default=no]
    ],
    if test x$enable_threads = xno; then
      enable_threads=''
*************** define([GLIBCPP_ENABLE_CHEADERS_DEFAULT]
*** 1458,1465 ****
  AC_MSG_CHECKING([for c header strategy to use])
  AC_ARG_ENABLE(cheaders,
  changequote(<<, >>)dnl
! <<  --enable-cheaders construct "C" header files for
!                            g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
  changequote([, ])
    [case "$enableval" in
     c) 
--- 1458,1464 ----
  AC_MSG_CHECKING([for c header strategy to use])
  AC_ARG_ENABLE(cheaders,
  changequote(<<, >>)dnl
! <<  --enable-cheaders       construct "C" header files for g++ [default=>>GLIBCPP_ENABLE_CHEADERS_DEFAULT],
  changequote([, ])
    [case "$enableval" in
     c) 
*************** AC_MSG_RESULT($gxx_include_dir)
*** 1672,1677 ****
--- 1671,1704 ----
  AC_SUBST(gxx_include_dir)
  AC_SUBST(glibcpp_toolexecdir)
  AC_SUBST(glibcpp_toolexeclibdir)
+ ])
+ 
+ 
+ dnl
+ dnl Check for whether the Boost-derived checks should be turned on.
+ dnl
+ dnl GLIBCPP_ENABLE_CONCEPT_CHECKS
+ dnl --enable-concept-checks turns them on.
+ dnl --disable-concept-checks leaves them off.
+ dnl  +  Usage:  GLIBCPP_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
+ dnl       Where DEFAULT is either `yes' or `no'.  If ommitted, it
+ dnl       defaults to `no'.
+ AC_DEFUN(GLIBCPP_ENABLE_CONCEPT_CHECKS, [dnl
+ define([GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT], ifelse($1, yes, yes, no))dnl
+ AC_ARG_ENABLE(concept-checks,
+ changequote(<<, >>)dnl
+ <<  --enable-concept-checks       use Boost-derived checks by default [default=>>GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT],
+ changequote([, ])dnl
+ [case "$enableval" in
+  yes) enable_concept_checks=yes ;;
+  no)  enable_concept_checks=no ;;
+  *)   AC_MSG_ERROR([Unknown argument to enable/disable concept-checks]) ;;
+  esac],
+ enable_concept_checks=GLIBCPP_ENABLE_CONCEPT_CHECKS_DEFAULT)dnl
+ dnl Option parsed, now set things appropriately
+ if test x"$enable_concept_checks" = xyes; then
+   AC_DEFINE(_GLIBCPP_CONCEPT_CHECKS)
+ fi
  ])
  
  
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.in,v
retrieving revision 1.59
diff -c -3 -p -r1.59 configure.in
*** configure.in	2001/04/20 08:59:24	1.59
--- configure.in	2001/04/21 02:09:30
*************** GLIBCPP_ENABLE_CHEADERS([c_std])
*** 70,75 ****
--- 70,76 ----
  GLIBCPP_ENABLE_THREADS
  GLIBCPP_ENABLE_CXX_FLAGS([none])
  GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
+ GLIBCPP_ENABLE_CONCEPT_CHECKS
  
  if test -n "$with_cross_host"; then
  
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.84
diff -c -3 -p -r1.84 Makefile.am
*** Makefile.am	2001/04/18 01:06:04	1.84
--- Makefile.am	2001/04/21 02:09:31
*************** tmp-libstdc++.INC: Makefile
*** 301,310 ****
  # set this option because CONFIG_CXXFLAGS has to be after
  # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
  # as the occasion call for it. (ie, --enable-debug)
- #
- # The no-implicit-templates flag will generate unresolved references to
- # the concept-checking symbols.  So we must disable the checks while
- # actually building the library.
  AM_CXXFLAGS = \
  	-fno-implicit-templates \
  	$(LIBSUPCXX_CXXFLAGS) \
--- 301,306 ----


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