This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[libstdc++] Fix _GLIBCPP_VERSION
- From: Phil Edwards <phil at jaj dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 2 Jul 2002 02:39:28 -0400
- Subject: [libstdc++] Fix _GLIBCPP_VERSION
This
2002-06-26 Benjamin Kosnik <bkoz@redhat.com>
* configure.in (INTERFACE): Remove.
(release_VERSION): Remove.
missed an occurance of release_VERSION, and as such, caused _GLIBCPP_VERSION
to be set to an empty string. Now that the library's release version is
taken directly from the compiler rather than being maintained seperately,
_GLIBCPP_VERSION is yet another variation of __GNUC__, __GNUC_MINOR__,
and __VERSION__. Reinventing the wheel, but with prettier spokes. :-)
Benjamin's patch also had code to discover the compiler version from the
sources. I've replaced that with a call to the compiler instead (simpler
code), and shuffled the configury script fragments a bit. So in addition
to using the version to determine the header file directory, we also use
it to create _GLIBCPP_VERSION.
Tested x86/linux, applied to trunk. I'll wait a day or so for any problems
to surface, and then move the patch to the branch (where the same bug
exists, and where the PR was originally reported).
2002-07-02 Phil Edwards <pme@gcc.gnu.org>
PR libstdc++/7173
* acinclude.m4: Simplify determination of gcc_version, and move
up to GLIBCPP_CONFIGURE.
* configure.in (release_VERSION): Really remove.
(AM_INIT_AUTOMAKE, AM_CONFIG_HEADER): Move after GLIBCPP_CONFIGURE.
* aclocal.m4, configure: Regenerate.
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.212
diff -u -3 -p -r1.212 acinclude.m4
--- acinclude.m4 27 Jun 2002 10:16:30 -0000 1.212
+++ acinclude.m4 2 Jul 2002 06:35:58 -0000
@@ -167,6 +167,11 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
LIB_AC_PROG_CXX
+ # For directory versioning (e.g., headers) and other variables.
+ AC_MSG_CHECKING([for GCC version number])
+ gcc_version=`$glibcpp_CXX -dumpversion`
+ AC_MSG_RESULT($gcc_version)
+
# For some reason, gettext needs this.
AC_ISC_POSIX
@@ -200,7 +205,6 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
# Find platform-specific directories containing configuration info. In
# addition to possibly modifying the same flags, it also sets up symlinks.
GLIBCPP_CHECK_TARGET
-
])
@@ -1839,15 +1843,6 @@ AC_ARG_ENABLE(version-specific-runtime-l
version_specific_libs=no)dnl
# Option set, now we can test it.
AC_MSG_RESULT($version_specific_libs)
-
-# Get the gcc version number. This is lifted from gcc/configure.in
-AC_MSG_CHECKING([for gcc version number])
-changequote(,)dnl
-gcc_version_trigger=${srcdir}/../gcc/version.c
-gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
-gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
-changequote([,])dnl
-AC_MSG_RESULT($gcc_version)
# Default case for install directory for include files.
if test $version_specific_libs = no && test $gxx_include_dir = no; then
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.in,v
retrieving revision 1.102
diff -u -3 -p -r1.102 configure.in
--- configure.in 1 Jul 2002 18:08:25 -0000 1.102
+++ configure.in 2 Jul 2002 06:35:58 -0000
@@ -37,12 +37,12 @@ AC_CANONICAL_SYSTEM
target_alias=${target_alias-$target}
AC_SUBST(target_alias)
-AM_INIT_AUTOMAKE($PACKAGE, $release_VERSION)
-AM_CONFIG_HEADER(config.h)
-
# Runs configure.target, finds CC, CXX and assorted other critical bits.
# Must run this before the GLIBCPP_ENABLE_* macros below.
GLIBCPP_CONFIGURE(.)
+
+AM_INIT_AUTOMAKE($PACKAGE, $gcc_version)
+AM_CONFIG_HEADER(config.h)
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL