This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] --enable-[libstdcxx]-[debug, pch]
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 4 Jul 2003 13:39:29 -0400 (EDT)
- Subject: [v3] --enable-[libstdcxx]-[debug, pch]
Alexandre has pointed out that --enable-debug, and the libstdc++
interpretation of this, is not standard throughout gcc-land. For
instance, libjava has --enable-libgcj-debug, which doesn't build a
separate debug library, etc. In addition, it's thought that other
target libraries may also try to use PCH, making libstdc++'s use of
PCH include files also problematic, or at the very least erratic. This
implements his suggested way of dealing with this for --enable-debug
and --enable-pch, which are now --enable-libstdcxx-debug and
--enable-libstdcxx-pch.
It might be nice to get organized with what target libraries are
supposed to do, where they are installed, how they are versioned, and
how (relatively) common flags like --enable-debug should
work. However, this appears to be a non-starter. Thus, I give up.
tested with the various configs on x86/linux
2003-07-04 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCPP_ENABLE_DEBUG_FLAGS): To
--enable-libstdcxx-debug-flags.
(GLIBCPP_ENABLE_DEBUG_FLAGS): To --enable-libstdcxx-debug.
(GLIBCPP_ENABLE_PCH): To --enable-libstdcxx-pch.
* aclocal.m4: Regenerate.
* configure: Same.
* docs/html/configopts.html: Update.
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.250
diff -c -p -r1.250 acinclude.m4
*** acinclude.m4 4 Jul 2003 07:14:39 -0000 1.250
--- acinclude.m4 4 Jul 2003 17:28:31 -0000
*************** dnl Check to see if debugging libraries
*** 1013,1026 ****
dnl
dnl GLIBCPP_ENABLE_DEBUG
dnl
! dnl --enable-debug
dnl builds a separate set of debugging libraries in addition to the
dnl normal (shared, static) libstdc++ binaries.
dnl
! dnl --disable-debug
dnl builds only one (non-debug) version of libstdc++.
dnl
! dnl --enable-debug-flags=FLAGS
dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
dnl
dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
--- 1013,1026 ----
dnl
dnl GLIBCPP_ENABLE_DEBUG
dnl
! dnl --enable-libstdcxx-debug
dnl builds a separate set of debugging libraries in addition to the
dnl normal (shared, static) libstdc++ binaries.
dnl
! dnl --disable-libstdcxx-debug
dnl builds only one (non-debug) version of libstdc++.
dnl
! dnl --enable-libstdcxx-debug-flags=FLAGS
dnl iff --enable-debug == yes, then use FLAGS to build the debug library.
dnl
dnl + Usage: GLIBCPP_ENABLE_DEBUG[(DEFAULT)]
*************** dnl Where DEFAULT is either `yes'
*** 1028,1046 ****
dnl defaults to `no'.
AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
! AC_ARG_ENABLE(debug,
changequote(<<, >>)dnl
! << --enable-debug build extra debug library [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
changequote([, ])dnl
[case "${enableval}" in
! yes) enable_debug=yes ;;
! no) enable_debug=no ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
esac],
! enable_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
AC_MSG_CHECKING([for additional debug build])
! AC_MSG_RESULT($enable_debug)
! AM_CONDITIONAL(GLIBCPP_BUILD_DEBUG, test "$enable_debug" = yes)
])
--- 1028,1046 ----
dnl defaults to `no'.
AC_DEFUN(GLIBCPP_ENABLE_DEBUG, [dnl
define([GLIBCPP_ENABLE_DEBUG_DEFAULT], ifelse($1, yes, yes, no))dnl
! AC_ARG_ENABLE(libstdcxx_debug,
changequote(<<, >>)dnl
! << --enable-libstdcxx-debug build extra debug library [default=>>GLIBCPP_ENABLE_DEBUG_DEFAULT],
changequote([, ])dnl
[case "${enableval}" in
! yes) enable_libstdcxx_debug=yes ;;
! no) enable_libstdcxx_debug=no ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable extra debugging]) ;;
esac],
! enable_libstdcxx_debug=GLIBCPP_ENABLE_DEBUG_DEFAULT)dnl
AC_MSG_CHECKING([for additional debug build])
! AC_MSG_RESULT($enable_libstdcxx_debug)
! AM_CONDITIONAL(GLIBCPP_BUILD_DEBUG, test "$enable_libstdcxx_debug" = yes)
])
*************** dnl Check for explicit debug flags.
*** 1048,1079 ****
dnl
dnl GLIBCPP_ENABLE_DEBUG_FLAGS
dnl
! dnl --enable-debug-flags='-O1'
dnl is a general method for passing flags to be used when
dnl building debug libraries with --enable-debug.
dnl
! dnl --disable-debug-flags does nothing.
dnl + Usage: GLIBCPP_ENABLE_DEBUG_FLAGS(default flags)
dnl If "default flags" is an empty string (or "none"), the effect is
dnl the same as --disable or --enable=no.
AC_DEFUN(GLIBCPP_ENABLE_DEBUG_FLAGS, [dnl
define([GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
! AC_ARG_ENABLE(debug_flags,
changequote(<<, >>)dnl
! << --enable-debug-flags=FLAGS pass compiler FLAGS when building debug
! library;[default=>>GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT],
changequote([, ])dnl
[case "${enableval}" in
none) ;;
! -*) enable_debug_flags="${enableval}" ;;
*) AC_MSG_ERROR([Unknown argument to extra debugging flags]) ;;
esac],
! enable_debug_flags=GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT)dnl
dnl Option parsed, now set things appropriately
! case x"$enable_debug" in
xyes)
! case "$enable_debug_flags" in
none)
DEBUG_FLAGS="-g3 -O0";;
-*) #valid input
--- 1048,1080 ----
dnl
dnl GLIBCPP_ENABLE_DEBUG_FLAGS
dnl
! dnl --enable-libstdcxx-debug-flags='-O1'
dnl is a general method for passing flags to be used when
dnl building debug libraries with --enable-debug.
dnl
! dnl --disable-libstdcxx-debug-flags does nothing.
dnl + Usage: GLIBCPP_ENABLE_DEBUG_FLAGS(default flags)
dnl If "default flags" is an empty string (or "none"), the effect is
dnl the same as --disable or --enable=no.
AC_DEFUN(GLIBCPP_ENABLE_DEBUG_FLAGS, [dnl
define([GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT], ifelse($1,,, $1))dnl
! AC_ARG_ENABLE(libstdcxx_debug_flags,
changequote(<<, >>)dnl
! << --enable-libstdcxx-debug-flags=FLAGS pass compiler FLAGS when building
! debug library;
! [default=>>GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT],
changequote([, ])dnl
[case "${enableval}" in
none) ;;
! -*) enable_libstdcxx_debug_flags="${enableval}" ;;
*) AC_MSG_ERROR([Unknown argument to extra debugging flags]) ;;
esac],
! enable_libstdcxx_debug_flags=GLIBCPP_ENABLE_DEBUG_FLAGS_DEFAULT)dnl
dnl Option parsed, now set things appropriately
! case x"$enable_libstdcxx_debug" in
xyes)
! case "$enable_libstdcxx_debug_flags" in
none)
DEBUG_FLAGS="-g3 -O0";;
-*) #valid input
*************** define([GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT
*** 1111,1117 ****
AC_MSG_CHECKING([for extra compiler flags for building])
AC_ARG_ENABLE(cxx_flags,
changequote(<<, >>)dnl
! << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
[default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
changequote([, ])dnl
[case "x$enable_cxx_flags" in
--- 1112,1118 ----
AC_MSG_CHECKING([for extra compiler flags for building])
AC_ARG_ENABLE(cxx_flags,
changequote(<<, >>)dnl
! << --enable-cxx-flags=FLAGS pass compiler FLAGS when building library;
[default=>>GLIBCPP_ENABLE_CXX_FLAGS_DEFAULT],
changequote([, ])dnl
[case "x$enable_cxx_flags" in
*************** AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
*** 1339,1345 ****
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
--- 1340,1346 ----
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-specific io package. [default=stdio]
],
if test x$enable_cstdio = xno; then
enable_cstdio=stdio
*************** dnl Check to see if building and using a
*** 1378,1432 ****
dnl
dnl GLIBCPP_ENABLE_PCH
dnl
! dnl --enable-pch=yes
dnl default, this shows intent to use stdc++.h.gch If it looks like it
dnl may work, after some light-hearted attempts to puzzle out compiler
dnl support, flip bits on in include/Makefile.am
dnl
! dnl --disable-pch
dnl turns off attempts to use or build stdc++.h.gch.
dnl
AC_DEFUN(GLIBCPP_ENABLE_PCH, [dnl
define([GLIBCPP_ENABLE_PCH_DEFAULT], ifelse($1,,, $1))dnl
! AC_ARG_ENABLE(pch,
changequote(<<, >>)dnl
! << --enable-pch build pre-compiled libstdc++ includes [default=>>GLIBCPP_ENABLE_PCH_DEFAULT],
changequote([, ])dnl
[case "${enableval}" in
! yes) enable_pch=yes ;;
! no) enable_pch=no ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable PCH]) ;;
esac],
! enable_pch=GLIBCPP_ENABLE_PCH_DEFAULT)dnl
! if test x$enable_pch = xyes; then
ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-Werror -Winvalid-pch -Wno-deprecated -x c++-header'
AC_MSG_CHECKING([for compiler that seems to compile .gch files])
! if test x${glibcpp_pch_comp+set} != xset; then
! AC_CACHE_VAL(glibcpp_pch_comp, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <math.h>], ,
! [glibcpp_pch_comp=yes], [glibcpp_pch_comp=no])
AC_LANG_RESTORE
])
fi
! AC_MSG_RESULT([$glibcpp_pch_comp])
CXXFLAGS="$ac_save_CXXFLAGS"
fi
! if test x"$enable_pch" = xyes && test x"$glibcpp_pch_comp" = xno; then
enable_pch=no
fi
AC_MSG_CHECKING([for enabled PCH])
! AC_MSG_RESULT([$enable_pch])
! AM_CONDITIONAL(GLIBCPP_BUILD_PCH, test "$enable_pch" = yes)
if test "$enable_pch" = yes; then
glibcpp_PCHFLAGS="-include bits/stdc++.h"
else
--- 1379,1433 ----
dnl
dnl GLIBCPP_ENABLE_PCH
dnl
! dnl --enable-libstdcxx-pch=yes
dnl default, this shows intent to use stdc++.h.gch If it looks like it
dnl may work, after some light-hearted attempts to puzzle out compiler
dnl support, flip bits on in include/Makefile.am
dnl
! dnl --disable-libstdcxx-pch
dnl turns off attempts to use or build stdc++.h.gch.
dnl
AC_DEFUN(GLIBCPP_ENABLE_PCH, [dnl
define([GLIBCPP_ENABLE_PCH_DEFAULT], ifelse($1,,, $1))dnl
! AC_ARG_ENABLE(libstdcxx_pch,
changequote(<<, >>)dnl
! << --enable-libstdcxx-pch build pre-compiled libstdc++ includes [default=>>GLIBCPP_ENABLE_PCH_DEFAULT],
changequote([, ])dnl
[case "${enableval}" in
! yes) enable_libstdcxx_pch=yes ;;
! no) enable_libstdcxx_pch=no ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable PCH]) ;;
esac],
! enable_libstdcxx_pch=GLIBCPP_ENABLE_PCH_DEFAULT)dnl
! if test x$enable_libstdcxx_pch = xyes; then
ac_test_CXXFLAGS="${CXXFLAGS+set}"
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS='-Werror -Winvalid-pch -Wno-deprecated -x c++-header'
AC_MSG_CHECKING([for compiler that seems to compile .gch files])
! if test x${pch_comp+set} != xset; then
! AC_CACHE_VAL(pch_comp, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <math.h>], ,
! [pch_comp=yes], [pch_comp=no])
AC_LANG_RESTORE
])
fi
! AC_MSG_RESULT([$pch_comp])
CXXFLAGS="$ac_save_CXXFLAGS"
fi
! if test x"$enable_libstdcxx_pch" = xyes && test x"$pch_comp" = xno; then
enable_pch=no
fi
AC_MSG_CHECKING([for enabled PCH])
! AC_MSG_RESULT([$enable_libstdcxx_pch])
! AM_CONDITIONAL(GLIBCPP_BUILD_PCH, test "$enable_libstdcxx_pch" = yes)
if test "$enable_pch" = yes; then
glibcpp_PCHFLAGS="-include bits/stdc++.h"
else
Index: docs/html/configopts.html
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/docs/html/configopts.html,v
retrieving revision 1.30
diff -c -p -r1.30 configopts.html
*** docs/html/configopts.html 30 Jun 2003 17:40:10 -0000 1.30
--- docs/html/configopts.html 4 Jul 2003 17:28:31 -0000
*************** options</a></h1>
*** 144,150 ****
</p>
</dd>
! <dt><code>--enable-debug </code></dt>
<dd><p>Build separate debug libraries in addition to what is normally built.
By default, the debug libraries are compiled with
<code> CXXFLAGS='-g3 -O0'</code>
--- 144,150 ----
</p>
</dd>
! <dt><code>--enable-libstdcxx-debug </code></dt>
<dd><p>Build separate debug libraries in addition to what is normally built.
By default, the debug libraries are compiled with
<code> CXXFLAGS='-g3 -O0'</code>
*************** options</a></h1>
*** 159,165 ****
</p>
</dd>
! <dt><code>--enable-debug-flags=FLAGS</code></dt>
<dd><p>This option is only valid when <code> --enable-debug </code>
is also specified, and applies to the debug builds only. With
--- 159,165 ----
</p>
</dd>
! <dt><code>--enable-libstdcxx-debug-flags=FLAGS</code></dt>
<dd><p>This option is only valid when <code> --enable-debug </code>
is also specified, and applies to the debug builds only. With
*************** options</a></h1>
*** 168,174 ****
FLAGS is a quoted string of options, like
</p>
<pre>
! --enable-debug-flags='-g3 -O1 -gdwarf-2'</pre>
</dd>
<dt><code>--enable-cxx-flags=FLAGS</code></dt>
--- 168,174 ----
FLAGS is a quoted string of options, like
</p>
<pre>
! --enable-libstdcxx-debug-flags='-g3 -O1 -gdwarf-2'</pre>
</dd>
<dt><code>--enable-cxx-flags=FLAGS</code></dt>
*************** options</a></h1>
*** 262,268 ****
</p>
</dd>
! <dt><code>--enable-pch </code></dt>
<dd><p>In 3.4 and later, tries to turn on the generation of
stdc++.h.gch, a pre-compiled file including all the standard
C++ includes. If enabled (as by default), and the compiler
--- 262,268 ----
</p>
</dd>
! <dt><code>--enable-libstdcxx-pch </code></dt>
<dd><p>In 3.4 and later, tries to turn on the generation of
stdc++.h.gch, a pre-compiled file including all the standard
C++ includes. If enabled (as by default), and the compiler