Currently some multilib variables are initialized, and config.ml.in
instantiated, whether or not a multilib build is being performed. I ran
into this because I am building the runtime libraries (libatomic right
now) separately from GCC. Multilib is disabled, and no multilib
variables are set, yet the configure script fails after it cannot find
`${multi_basedir}/config-ml.in`.
I understand this building them separately is not supported, but am
nevertheless hoping the patch can nevertheless be upstreamed on the
grounds that this generally cleans up the build system in accordance
with the principle that "feature foo" variables need not be written and
should not be read when feature foo is disabled. libgcc's configure
script, for example, has some similar-looking bespoke m4 script with `.
${libgcc_topdir}/config-ml.in` instead, side-stepping the issue. Perhaps
with this fixed, all the libraries could use the same macro. [I suppose
I'd be willing to investigate that.]
Thanks,
John
[Continuing from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86746. Did
not know this sort of thing should exclusively go to this list. My
apologies.]
From 3e0e7d6e5cfdc46342fcad5fe6b24b4f47af0d87 Mon Sep 17 00:00:00 2001
Message-Id:
<3e0e7d6e5cfdc46342fcad5fe6b24b4f47af0d87.1532988611.git.John.Ericson@Obsidian.Systems>
From: John Ericson <John.Ericson@Obsidian.Systems>
Date: Mon, 30 Jul 2018 18:06:02 -0400
Subject: [PATCH] multilib: Don't bother with multilib configuration
To: gcc-patches@gcc.gnu.org
* config/multi.m4: Don't bother with multilib configuration when
it is disabled.
---
ChangeLog | 5 +++++
config/multi.m4 | 50 +++++++++++++++++++++++++++----------------------
2 files changed, 33 insertions(+), 22 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4bc5123c84e..2445071bea4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-07-30 John Ericson <john.ericson@obsidian.systems>
+
+ * config/multi.m4: Don't bother with multilib configuration when it
+ is disabled.
+
2018-07-19 DJ Delorie <d...@redhat.com>
* MAINTAINERS (m32c, msp43, rl78, libiberty, build): Remove myself
diff --git a/config/multi.m4 b/config/multi.m4
index bba338a8265..f5081155564 100644
--- a/config/multi.m4
+++ b/config/multi.m4
@@ -20,40 +20,45 @@ AC_ARG_ENABLE(multilib,
no) multilib=no ;;
*) AC_MSG_ERROR([bad value $enableval for multilib option]) ;;
esac],
- [multilib=yes])
+[multilib=yes])
-# We may get other options which we leave undocumented:
-# --with-target-subdir, --with-multisrctop, --with-multisubdir
-# See config-ml.in if you want the gory details.
+if test "x$multilib" = xyes; then
-if test "$srcdir" = "."; then
- if test "$with_target_subdir" != "."; then
- multi_basedir="$srcdir/$with_multisrctop../$2"
+ # We may get other options which we leave undocumented:
+ # --with-target-subdir, --with-multisrctop, --with-multisubdir
+ # See config-ml.in if you want the gory details.
+
+ if test "$srcdir" = "."; then
+ if test "$with_target_subdir" != "."; then
+ multi_basedir="$srcdir/$with_multisrctop../$2"
+ else
+ multi_basedir="$srcdir/$with_multisrctop$2"
+ fi
else
- multi_basedir="$srcdir/$with_multisrctop$2"
+ multi_basedir="$srcdir/$2"
+ fi
+ AC_SUBST(multi_basedir)
+
+ # Even if the default multilib is not a cross compilation,
+ # it may be that some of the other multilibs are.
+ if test $cross_compiling = no && test $multilib = yes \
+ && test "x${with_multisubdir}" != x ; then
+ cross_compiling=maybe
fi
-else
- multi_basedir="$srcdir/$2"
-fi
-AC_SUBST(multi_basedir)
-# Even if the default multilib is not a cross compilation,
-# it may be that some of the other multilibs are.
-if test $cross_compiling = no && test $multilib = yes \
- && test "x${with_multisubdir}" != x ; then
- cross_compiling=maybe
fi
-AC_OUTPUT_COMMANDS([
+AC_CONFIG_COMMANDS([config-ml],
+[if test "x$multilib" = xyes; then
# Only add multilib support code if we just rebuilt the top-level
# Makefile.
case " $CONFIG_FILES " in
*" ]m4_default([$1],Makefile)[ "*)
ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in
;;
-esac],
- [
-srcdir="$srcdir"
+esac
+fi],
+[srcdir="$srcdir"
host="$host"
target="$target"
with_multisubdir="$with_multisubdir"
@@ -64,4 +69,5 @@ multi_basedir="$multi_basedir"
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
CC="$CC"
CXX="$CXX"
-GFORTRAN="$GFORTRAN"])])dnl
+GFORTRAN="$GFORTRAN"])
+])dnl
--
2.17.1