public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-6223] c++tools: Fix up c++tools for --with-gcc-major-version-only
@ 2020-12-17 13:32 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2020-12-17 13:32 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4e7e7c132619aa58a50edd38d25bd3f885e97d8a

commit r11-6223-g4e7e7c132619aa58a50edd38d25bd3f885e97d8a
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Dec 17 14:31:05 2020 +0100

    c++tools: Fix up c++tools for --with-gcc-major-version-only
    
    Seems c++tools doesn't honor --with-gcc-major-version-only.
    Our distro uses that flag and so everything is installed in
    /usr/lib/gcc/<target>/11/...
    /usr/libexec/gcc/<target>/11/...
    except
    /usr/libexec/gcc/<target>/11.0.0/g++-mapper-server
    
    The following patch should fix that.
    
    2020-12-17  Jakub Jelinek  <jakub@redhat.com>
    
            * configure.ac: Add GCC_BASE_VER.
            * Makefile.in (version): Remove variable.
            (gcc_version): New variable.
            (libexecsubdir): Use $(gcc_version) instead of $(version).
            * configure: Regenerated.

Diff:
---
 c++tools/Makefile.in  |  4 ++--
 c++tools/configure    | 23 +++++++++++++++++++++++
 c++tools/configure.ac |  3 +++
 3 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/c++tools/Makefile.in b/c++tools/Makefile.in
index 310b5674fec..87f9236c203 100644
--- a/c++tools/Makefile.in
+++ b/c++tools/Makefile.in
@@ -20,8 +20,8 @@ prefix := @prefix@
 bindir := @bindir@
 libexecdir := @libexecdir@
 target_noncanonical := @target_noncanonical@
-version := $(shell cat $(srcdir)/../gcc/BASE-VER)
-libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(version)
+gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
+libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
 INSTALL_PROGRAM := @INSTALL_PROGRAM@
 INSTALL_STRIP_PROGRAM := $(srcdir)/../install-sh -c -s
 AUTOCONF := @AUTOCONF@
diff --git a/c++tools/configure b/c++tools/configure
index e8658aac16e..ec0cef9200a 100755
--- a/c++tools/configure
+++ b/c++tools/configure
@@ -585,6 +585,7 @@ ac_unique_file="c++tools"
 ac_unique_file="server.cc"
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
+get_gcc_base_ver
 ac_ct_CC
 CFLAGS
 CC
@@ -658,6 +659,7 @@ ac_user_opts='
 enable_option_checking
 enable_c___tools
 enable_maintainer_mode
+with_gcc_major_version_only
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1287,6 +1289,12 @@ Optional Features:
                           enable maintainer mode. Add rules to rebuild
                           configurey bits
 
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-gcc-major-version-only
+                          use only GCC major number in filesystem paths
+
 Some influential environment variables:
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
@@ -3557,6 +3565,21 @@ $as_echo "#define HAVE_INET_NTOP 1" >>confdefs.h
 
 fi
 
+# Determine what GCC version number to use in filesystem paths.
+
+  get_gcc_base_ver="cat"
+
+# Check whether --with-gcc-major-version-only was given.
+if test "${with_gcc_major_version_only+set}" = set; then :
+  withval=$with_gcc_major_version_only; if test x$with_gcc_major_version_only = xyes ; then
+        get_gcc_base_ver="sed -e 's/^\([0-9]*\).*/\1/'"
+      fi
+
+fi
+
+
+
+
 ac_config_headers="$ac_config_headers config.h"
 
 ac_config_files="$ac_config_files Makefile"
diff --git a/c++tools/configure.ac b/c++tools/configure.ac
index c5560f68d4d..14c476b1ac7 100644
--- a/c++tools/configure.ac
+++ b/c++tools/configure.ac
@@ -206,6 +206,9 @@ if test $ac_cv_inet_ntop = yes; then
   [Define if inet_ntop provided.])
 fi
 
+# Determine what GCC version number to use in filesystem paths.
+GCC_BASE_VER
+
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES([Makefile])


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-17 13:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 13:32 [gcc r11-6223] c++tools: Fix up c++tools for --with-gcc-major-version-only Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).