]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pass --enable-obsolete down to gcc/configure for auto-build.h
authorAlexandre Oliva <oliva@adacore.com>
Mon, 4 Nov 2019 13:40:12 +0000 (13:40 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Mon, 4 Nov 2019 13:40:12 +0000 (13:40 +0000)
Configuring GCC for obsolete targets works as long as build = host.
When it isn't, --enable-obsolete is not passed down to the additional
build configure started by gcc/configure, used to generate
auto-build.h.  The build configure fails and we end up without a
auto-build.h, but the host configure proceeds, so we only get a fatal
failure much later, when make realizes auto-build.h is not there and
there's no rule to create it.

This patch gets the host configure to fail when the build configure
does, leaving the temporary build configure dir behind for
investigation.  It also arranges for --eanble-obsolete to be passed
down to the build configure.

Alas, the latter triggered a warning in the build configure because
--enable-obsolete is not a recognized configure option.  That's not
reported in the host configure because of the
--disable-option-checking passed by the top-level configure, so I
arranged for that to be passed down to the build configure as well.

Finally, since my initial suspicion when investigating this failure
was that auto-build.h had been removed after configuration and there
was no rule to rebuild it, I'm adding rules to gcc/Makefile to get it
created or updated as needed.  Since it is configure that creates it,
as run by e.g. config.status --recheck, and config.status is created
after auto-build.h, I've made config.status depend on auto-build.h,
and added a dummy rule to create auto-build.h.  This would normally
not be enough to create a header when needed, but since Makefile
depends on config.status, and make first updates Makefile, it ends up
working, as long as nothing else that Makefile depends on requires
auto-build.h but not config.status.  The config.status dependency and
the auto-build.h rule are only enabled in the cases in which
auto-build.h is actually used, namely when build != host.

for  gcc/ChangeLog

* configure.ac: Pass --enable-obsolete=* and
--enable-option-checking=* down to build configure, and fail
if it fails.  AC_SUBST HAVE_AUTO_BUILD.
* configure: Rebuild.
* Makefile.in [HAVE_AUTO_BUILD] (auto-build.h): New rule.
[HAVE_AUTO_BUILD] (config.status): Depend on auto-build.h.

From-SVN: r277777

gcc/ChangeLog
gcc/Makefile.in
gcc/configure
gcc/configure.ac

index 193e8e40d1976d82b4df0335a75015f5b4f7702c..536ad7fd4bcfeacf5a822a668694b67cc91bad1b 100644 (file)
@@ -1,3 +1,12 @@
+2019-11-04  Alexandre Oliva <oliva@adacore.com>
+
+       * configure.ac: Pass --enable-obsolete=* and
+       --enable-option-checking=* down to build configure, and fail
+       if it fails.  AC_SUBST HAVE_AUTO_BUILD.
+       * configure: Rebuild.
+       * Makefile.in [HAVE_AUTO_BUILD] (auto-build.h): New rule.
+       [HAVE_AUTO_BUILD] (config.status): Depend on auto-build.h.
+
 2019-11-04  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
 
        * config.in: Regenerate.
index 035b58f50c0d51623a7ef21989da48124a4c9b41..95f054c4d4f35a9cb12e2b7c94bfce361f9ac877 100644 (file)
@@ -1899,6 +1899,14 @@ cstamp-h: config.in config.status
        CONFIG_FILES= \
        LANGUAGES="$(CONFIG_LANGUAGES)" $(SHELL) config.status
 
+# On configurations that require auto-build.h, it is created while
+# running configure, so make config.status depend on it, so that
+# config.status --recheck runs and updates or creates it.
+@HAVE_AUTO_BUILD@auto-build.h: $(srcdir)/configure $(srcdir)/config.gcc
+@HAVE_AUTO_BUILD@      @if test -f $@; then echo rerunning config.status to update $@; \
+@HAVE_AUTO_BUILD@      else echo rerunning config.status to update $@; fi
+@HAVE_AUTO_BUILD@config.status: auto-build.h
+
 # Really, really stupid make features, such as SUN's KEEP_STATE, may force
 # a target to build even if it is up-to-date.  So we must verify that
 # config.status does not exist before failing.
index 9fe04293f726043f81ce8afe1b625faf63d2e9a4..6808c23d26b847ff2408ef6e8bb3aba126fd3cb5 100755 (executable)
@@ -774,6 +774,7 @@ LIBINTL_DEP
 LIBINTL
 USE_NLS
 get_gcc_base_ver
+HAVE_AUTO_BUILD
 extra_opt_files
 extra_modes_file
 NATIVE_SYSTEM_HEADER_DIR
@@ -12208,6 +12209,7 @@ done
 if test x$host = x$build
 then
        build_auto=auto-host.h
+       HAVE_AUTO_BUILD='# '
 else
        # We create a subdir, then run autoconf in the subdir.
        # To prevent recursion we set host and build for the new
@@ -12230,7 +12232,10 @@ else
        GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \
        ${realsrcdir}/configure \
                --enable-languages=${enable_languages-all} \
-               --target=$target_alias --host=$build_alias --build=$build_alias
+               ${enable_obsolete+--enable-obsolete="$enable_obsolete"} \
+               ${enable_option_checking+--enable-option-checking="$enable_option_checking"} \
+               --target=$target_alias --host=$build_alias \
+               --build=$build_alias || exit # retaining $tempdir
 
        # We just finished tests for the build machine, so rename
        # the file auto-build.h in the gcc directory.
@@ -12238,9 +12243,11 @@ else
        cd ..
        rm -rf $tempdir
        build_auto=auto-build.h
+       HAVE_AUTO_BUILD=
 fi
 
 
+
 tm_file="${tm_file} defaults.h"
 tm_p_file="${tm_p_file} tm-preds.h"
 tm_d_file="${tm_d_file} defaults.h"
@@ -18926,7 +18933,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18929 "configure"
+#line 18936 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19032,7 +19039,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 19035 "configure"
+#line 19042 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 0fe4e5472728e90eb4993da89e5b33754036870e..1a0d68208e4b51b3360c293a1565ce4afa228c5d 100644 (file)
@@ -1838,6 +1838,7 @@ AC_SUBST(extra_opt_files)
 if test x$host = x$build
 then
        build_auto=auto-host.h
+       HAVE_AUTO_BUILD='# '
 else
        # We create a subdir, then run autoconf in the subdir.
        # To prevent recursion we set host and build for the new
@@ -1860,7 +1861,10 @@ else
        GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \
        ${realsrcdir}/configure \
                --enable-languages=${enable_languages-all} \
-               --target=$target_alias --host=$build_alias --build=$build_alias
+               ${enable_obsolete+--enable-obsolete="$enable_obsolete"} \
+               ${enable_option_checking+--enable-option-checking="$enable_option_checking"} \
+               --target=$target_alias --host=$build_alias \
+               --build=$build_alias || exit # retaining $tempdir
 
        # We just finished tests for the build machine, so rename
        # the file auto-build.h in the gcc directory.
@@ -1868,8 +1872,10 @@ else
        cd ..
        rm -rf $tempdir
        build_auto=auto-build.h
+       HAVE_AUTO_BUILD=
 fi
 AC_SUBST(build_subdir)
+AC_SUBST(HAVE_AUTO_BUILD)
 
 tm_file="${tm_file} defaults.h"
 tm_p_file="${tm_p_file} tm-preds.h"