summaryrefslogtreecommitdiff
path: root/c++tools
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-12-17 14:31:05 +0100
committerJakub Jelinek <jakub@redhat.com>2020-12-17 14:31:05 +0100
commit4e7e7c132619aa58a50edd38d25bd3f885e97d8a (patch)
tree9c8751d0b27c0f3e4cfe68ba56efded2b08a4c13 /c++tools
parent62cb9680e592057a49de66eac34da679338932f9 (diff)
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.
Diffstat (limited to 'c++tools')
-rw-r--r--c++tools/Makefile.in4
-rwxr-xr-xc++tools/configure23
-rw-r--r--c++tools/configure.ac3
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])