https://gcc.gnu.org/g:ddcb471e76a9960d644b9c69cab05944abdd1092

commit r15-8055-gddcb471e76a9960d644b9c69cab05944abdd1092
Author: Richard Biener <rguent...@suse.de>
Date:   Fri Mar 14 13:09:31 2025 +0100

    cobol/119281 - make sure $(gcc_version) is set for libgcobol install
    
    When using --enable-version-specific-runtime-libs at least it's
    required that $(gcc_version) is set to be able to expand
    toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
    
    The following fixes this by adjusting configure.ac to call GCC_BASE_VER
    and Makefile.am to include a definition for gcc_version.
    
    libgcobol/
            * Makefile.am: Define gcc_version.
            * configure.ac: Execute GCC_BASE_VER.
            * Makefile.in: Regenerated.
            * configure: Likewise.

Diff:
---
 libgcobol/Makefile.am  |  3 +++
 libgcobol/Makefile.in  |  3 +++
 libgcobol/configure    | 27 +++++++++++++++++++++------
 libgcobol/configure.ac |  3 +++
 4 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/libgcobol/Makefile.am b/libgcobol/Makefile.am
index bee294e0c9de..eddf209807e6 100644
--- a/libgcobol/Makefile.am
+++ b/libgcobol/Makefile.am
@@ -22,6 +22,9 @@
 AUTOMAKE_OPTIONS = 1.8 foreign
 ACLOCAL_AMFLAGS = -I .. -I ../config
 
+# May be used by various substitution variables.
+gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
+
 if BUILD_LIBGCOBOL
 toolexeclib_LTLIBRARIES  = libgcobol.la
 endif
diff --git a/libgcobol/Makefile.in b/libgcobol/Makefile.in
index c93e9246e378..a6096d2a64aa 100644
--- a/libgcobol/Makefile.in
+++ b/libgcobol/Makefile.in
@@ -403,6 +403,9 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = 1.8 foreign
 ACLOCAL_AMFLAGS = -I .. -I ../config
+
+# May be used by various substitution variables.
+gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
 @BUILD_LIBGCOBOL_TRUE@toolexeclib_LTLIBRARIES = libgcobol.la
 libgcobol_la_SOURCES = \
        charmaps.cc                             \
diff --git a/libgcobol/configure b/libgcobol/configure
index bd946b65fc28..73433ebb13de 100755
--- a/libgcobol/configure
+++ b/libgcobol/configure
@@ -635,7 +635,6 @@ am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
 extra_darwin_ldflags_libgcobol
-get_gcc_base_ver
 VERSION_SUFFIX
 LIBGCOBOL_VERSION
 SPEC_LIBGCOBOL_DEPS
@@ -674,6 +673,7 @@ CXXFLAGS
 CXX
 MAINTAINER_MODE_FALSE
 MAINTAINER_MODE_TRUE
+get_gcc_base_ver
 toolexeclibdir
 toolexecdir
 MAINT
@@ -796,6 +796,7 @@ with_toolexeclibdir
 enable_version_specific_runtime_libs
 with_slibdir
 enable_maintainer_mode
+with_gcc_major_version_only
 enable_shared
 enable_static
 with_pic
@@ -803,7 +804,6 @@ enable_fast_install
 with_gnu_ld
 enable_libtool_lock
 enable_darwin_at_rpath
-with_gcc_major_version_only
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1466,11 +1466,11 @@ Optional Packages:
                           install libraries built with a cross compiler within
                           DIR
   --with-slibdir=DIR      shared libraries in DIR LIBDIR
+  --with-gcc-major-version-only
+                          use only GCC major number in filesystem paths
   --with-pic              try to use only PIC/non-PIC objects [default=use
                           both]
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-gcc-major-version-only
-                          use only GCC major number in filesystem paths
 
 Some influential environment variables:
   CC          C compiler command
@@ -5192,6 +5192,21 @@ esac
 
 
 
+# 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
+
+
+
+
 
 
 
@@ -12876,7 +12891,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12879 "configure"
+#line 12894 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12982,7 +12997,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12985 "configure"
+#line 13000 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/libgcobol/configure.ac b/libgcobol/configure.ac
index ec6658124468..2e4a88ef77fc 100644
--- a/libgcobol/configure.ac
+++ b/libgcobol/configure.ac
@@ -170,6 +170,9 @@ esac
 AC_SUBST(toolexecdir)
 AC_SUBST(toolexeclibdir)
 
+# Determine what GCC version number to use in filesystem paths.
+GCC_BASE_VER
+
 AH_TEMPLATE(PACKAGE, [Name of package])
 AH_TEMPLATE(VERSION, [Version number of package])

Reply via email to