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

commit r17-6153-gd9ab084c9ed93c12152ffad9b410e32fd89c4979
Author: Alexandre Oliva <[email protected]>
Date:   Thu Nov 12 01:16:57 2026 -0300

    pass ADAC for sub configures
    
    When configuring gcc and gnattools, that use ACX_PROG_GNAT, we don't
    pass ADAC down, even though we may no longer have the ADAC set up for
    the top-level configure.  This causes them to use CC for the testing,
    and to set have_gnat=no.  That is without consequence, aside from
    potential user confusion upon watching the configure output.  This
    patch arranges for ADAC to be passed down in the environment for
    sub-configures, removing this potential confusion, using the specified
    ADAC for stage1 and CC after stage1.
    
    Since gcc/ and gnattools/ set up ADAC after being rebuilt with a
    config/acx.m4 that sets it, set ADAC in their Makefiles so as to use
    the specified ADAC rather than CC during stage1 (gcc) and
    post-bootstrap (gnattools), in case someone enters the subdirectory
    and builds there instead of relying on make variables passed by the
    top level.
    
    Make ADAC visible in configure --help, and get configure with cache
    enabled to detect changes to ADAC that could invalidate cached
    results.
    
    
    for  config/ChangeLog
    
            * acx.m4 (ACX_PROG_GNAT): Make ADAC visible in help, and cache
            sensitive.
    
    for  ChangeLog
    
            * Makefile.tpl (HOST_EXPORTS, POSTSTAGE1_HOST_EXPORTS): Pass
            ADAC to sub configures.
            * Makefile.in: Rebuild.
            * configure: Rebuild.
    
    for  gcc/ChangeLog
    
            * configure: Rebuild.
            * Makefile.in (ADAC): Use configured value.
    
    for  gnattools/ChangeLog
    
            * configure: Rebuild.
            * Makefile.in (ADAC): Use configured value.

Diff:
---
 Makefile.in           | 2 ++
 Makefile.tpl          | 2 ++
 config/acx.m4         | 1 +
 configure             | 3 +++
 gcc/Makefile.in       | 2 +-
 gcc/configure         | 7 +++++--
 gnattools/Makefile.in | 2 +-
 gnattools/configure   | 5 ++++-
 8 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index d6a35d36b880..dabe88d42c76 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -198,6 +198,7 @@ HOST_SUBDIR = @host_subdir@
 HOST_EXPORTS = \
        $(BASE_EXPORTS) \
        CC="$(CC)"; export CC; \
+       ADAC="$(ADAC)"; export ADAC; \
        ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
        CRAB1_LIBS="$(CRAB1_LIBS)"; export CRAB1_LIBS; \
        CFLAGS="$(CFLAGS)"; export CFLAGS; \
@@ -278,6 +279,7 @@ POSTSTAGE1_HOST_EXPORTS = \
          -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ \
          $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
        CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
+       ADAC="$$CC"; export ADAC; \
        $(POSTSTAGE1_CXX_EXPORT) \
        $(LTO_EXPORTS) \
        A68="$$r/$(HOST_SUBDIR)/prev-gcc/ga68$(exeext) 
-B$$r/$(HOST_SUBDIR)/prev-gcc/ \
diff --git a/Makefile.tpl b/Makefile.tpl
index b2475cb7f1f3..83870fccccfe 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -201,6 +201,7 @@ HOST_SUBDIR = @host_subdir@
 HOST_EXPORTS = \
        $(BASE_EXPORTS) \
        CC="$(CC)"; export CC; \
+       ADAC="$(ADAC)"; export ADAC; \
        ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
        CRAB1_LIBS="$(CRAB1_LIBS)"; export CRAB1_LIBS; \
        CFLAGS="$(CFLAGS)"; export CFLAGS; \
@@ -281,6 +282,7 @@ POSTSTAGE1_HOST_EXPORTS = \
          -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ \
          $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
        CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
+       ADAC="$$CC"; export ADAC; \
        $(POSTSTAGE1_CXX_EXPORT) \
        $(LTO_EXPORTS) \
        A68="$$r/$(HOST_SUBDIR)/prev-gcc/ga68$(exeext) 
-B$$r/$(HOST_SUBDIR)/prev-gcc/ \
diff --git a/config/acx.m4 b/config/acx.m4
index f2d050ad25e1..933ee7559966 100644
--- a/config/acx.m4
+++ b/config/acx.m4
@@ -399,6 +399,7 @@ AC_CHECK_TOOL(GNATBIND, gnatbind, no)
 AC_CHECK_TOOL(GNATMAKE, gnatmake, no)
 test x"$ADAC" != x || ADAC=$CC
 AC_SUBST(ADAC)
+AC_ARG_VAR(ADAC, [Ada compiler command])
 AC_CACHE_CHECK([whether $ADAC understands Ada and is recent enough],
                 acx_cv_cc_gcc_supports_ada,
 [cat >conftest.adb <<EOF
diff --git a/configure b/configure
index 78cffacd9bee..0dfa20d648ae 100755
--- a/configure
+++ b/configure
@@ -892,6 +892,7 @@ CPPFLAGS
 CXX
 CXXFLAGS
 CCC
+ADAC
 build_configargs
 host_configargs
 target_configargs
@@ -1695,6 +1696,7 @@ Some influential environment variables:
               you have headers in a nonstandard directory <include dir>
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
+  ADAC        Ada compiler command
   build_configargs
               additional configure arguments for build directories
   host_configargs
@@ -5840,6 +5842,7 @@ fi
 
 test x"$ADAC" != x || ADAC=$CC
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ADAC understands 
Ada and is recent enough" >&5
 $as_echo_n "checking whether $ADAC understands Ada and is recent enough... " 
>&6; }
 if ${acx_cv_cc_gcc_supports_ada+:} false; then :
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index df16b891b62f..c6059206a950 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -272,7 +272,7 @@ CPPFLAGS = @CPPFLAGS@
 
 AWK = @AWK@
 CC = @CC@
-ADAC = $(CC)
+ADAC = @ADAC@
 CXX = @CXX@
 BISON = @BISON@
 BISONFLAGS =
diff --git a/gcc/configure b/gcc/configure
index b8074c8f3644..e45605b73404 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -1088,6 +1088,7 @@ CPPFLAGS
 CXX
 CXXFLAGS
 CCC
+ADAC
 CXXCPP
 CPP
 PKG_CONFIG
@@ -1970,6 +1971,7 @@ Some influential environment variables:
               you have headers in a nonstandard directory <include dir>
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
+  ADAC        Ada compiler command
   CXXCPP      C++ preprocessor
   CPP         C preprocessor
   PKG_CONFIG  path to pkg-config utility
@@ -5342,6 +5344,7 @@ fi
 
 test x"$ADAC" != x || ADAC=$CC
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ADAC understands 
Ada and is recent enough" >&5
 $as_echo_n "checking whether $ADAC understands Ada and is recent enough... " 
>&6; }
 if ${acx_cv_cc_gcc_supports_ada+:} false; then :
@@ -22056,7 +22059,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 22059 "configure"
+#line 22062 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -22162,7 +22165,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 22165 "configure"
+#line 22168 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/gnattools/Makefile.in b/gnattools/Makefile.in
index a7bf278dcc2d..aec880c4fd16 100644
--- a/gnattools/Makefile.in
+++ b/gnattools/Makefile.in
@@ -35,7 +35,7 @@ LN_S=@LN_S@
 target_noncanonical=@target_noncanonical@
 GNATMAKE=@GNATMAKE@
 GNATBIND=@GNATBIND@
-ADAC=$(CC)
+ADAC=@ADAC@
 
 # Variables for the user (or the top level) to override.
 exeext = @EXEEXT@
diff --git a/gnattools/configure b/gnattools/configure
index 900cd0326085..a2f1c6a25abb 100755
--- a/gnattools/configure
+++ b/gnattools/configure
@@ -671,7 +671,8 @@ CC
 CFLAGS
 LDFLAGS
 LIBS
-CPPFLAGS'
+CPPFLAGS
+ADAC'
 
 
 # Initialize some variables set by options.
@@ -1298,6 +1299,7 @@ Some influential environment variables:
   LIBS        libraries to pass to the linker, e.g. -l<library>
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
+  ADAC        Ada compiler command
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -3001,6 +3003,7 @@ fi
 
 test x"$ADAC" != x || ADAC=$CC
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ADAC understands 
Ada and is recent enough" >&5
 $as_echo_n "checking whether $ADAC understands Ada and is recent enough... " 
>&6; }
 if ${acx_cv_cc_gcc_supports_ada+:} false; then :

Reply via email to