From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1521) id 2ED103858D3C; Sat, 5 Feb 2022 00:38:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2ED103858D3C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Frysinger To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] libgloss: restore multilib settings in subdir makefiles X-Act-Checkin: newlib-cygwin X-Git-Author: Mike Frysinger X-Git-Refname: refs/heads/master X-Git-Oldrev: 899cf3c9529d21e56fb062324c0396d51a3566e6 X-Git-Newrev: 67c600b99545390c9ebaf96a84f47c3614e492ce Message-Id: <20220205003812.2ED103858D3C@sourceware.org> Date: Sat, 5 Feb 2022 00:38:12 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Feb 2022 00:38:12 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D67c600b9954= 5390c9ebaf96a84f47c3614e492ce commit 67c600b99545390c9ebaf96a84f47c3614e492ce Author: Mike Frysinger Date: Fri Feb 4 01:17:54 2022 -0500 libgloss: restore multilib settings in subdir makefiles =20 Commit 754f8def0dfeeb43afa5a96ad1971fd0ef02c419 ("libgloss: merge stub arch configure scripts up a level") had an unintended side-effect: the MULTI* variables in the Makefiles no longer get rewritten at configure time in the subdirs. Only the top-level Makefile still is. This is because the configure integration of multilib (both the way libgloss did it manually and the way AM_ENABLE_MULTILIB does it) only rewrites "Makefile". =20 We could try propagating the MULTI* variables from libgloss/Makefile down via FLAGS_TO_PASS, but this runs into a limitation: the multilib logic uses this variable to switch from libgloss/ to each multilib libgloss/, and libgloss uses this variable to enter subdirectories. The latter we want, but the former ends up overridding the Makefile environment. We could side-step that with some GNU Make directives, but it feels like we're getting a bit too deep down the rabbit hole. =20 Instead, let's call config-ml.in ourselves for each subdir Makefile that the top-level configure generates. This restores the previous behavior and should be less risky in general. =20 This logic should be unnecessary when/if we switch libgloss over to a non-recursive Automake build (since all build+install settings are in the single libgloss/Makefile), but it'll be a while before we can land that rework, so let's fix this up now. Diff: --- libgloss/arm/configure | 2 ++ libgloss/arm/configure.ac | 4 +++- libgloss/configure | 15 ++++++++++++++- libgloss/configure.ac | 13 +++++++++++++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/libgloss/arm/configure b/libgloss/arm/configure index 8e3866b56..84878afff 100755 --- a/libgloss/arm/configure +++ b/libgloss/arm/configure @@ -3926,6 +3926,8 @@ $as_echo X"$file" | done } ;; + "cpu-init/Makefile":F) ac_file=3Dcpu-init/Makefile . ${srcdir}/../= ../config-ml.in + ;; "default-1":C) # Only add multilib support code if we just rebuilt the top-level # Makefile. diff --git a/libgloss/arm/configure.ac b/libgloss/arm/configure.ac index 2b98b5453..3d7ba7da1 100644 --- a/libgloss/arm/configure.ac +++ b/libgloss/arm/configure.ac @@ -62,7 +62,9 @@ AC_SUBST_FILE(host_makefile_frag) # Configure cpu init plug-ins if test -d "${srcdir}/cpu-init"; then subdirs=3D"${subdirs} cpu-init" - AC_CONFIG_FILES([cpu-init/Makefile]) + AC_CONFIG_FILES([cpu-init/Makefile], [dnl + ac_file=3Dcpu-init/Makefile . ${srcdir}/../../config-ml.in + ]) AC_SUBST(subdirs) fi =20 diff --git a/libgloss/configure b/libgloss/configure index 3fc20d6a2..64f08cf16 100755 --- a/libgloss/configure +++ b/libgloss/configure @@ -4794,6 +4794,9 @@ target_makefile_frag_path=3D$target_makefile_frag =20 =20 =20 +ac_config_commands=3D"$ac_config_commands default-1" + + # Default to --enable-multilib # Check whether --enable-multilib was given. if test "${enable_multilib+set}" =3D set; then : @@ -4829,7 +4832,7 @@ if test $cross_compiling =3D no && test $multilib =3D= yes \ cross_compiling=3Dmaybe fi =20 -ac_config_commands=3D"$ac_config_commands default-1" +ac_config_commands=3D"$ac_config_commands default-2" =20 =20 ac_config_files=3D"$ac_config_files Makefile" @@ -5554,6 +5557,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=3D1 # INIT-COMMANDS # AMDEP_TRUE=3D"$AMDEP_TRUE" ac_aux_dir=3D"$ac_aux_dir" +subdirs=3D"$subdirs" =20 srcdir=3D"$srcdir" host=3D"$host" @@ -5618,6 +5622,7 @@ do "libnosys/Makefile") CONFIG_FILES=3D"$CONFIG_FILES libnosys/Makefile" = ;; "depfiles") CONFIG_COMMANDS=3D"$CONFIG_COMMANDS depfiles" ;; "default-1") CONFIG_COMMANDS=3D"$CONFIG_COMMANDS default-1" ;; + "default-2") CONFIG_COMMANDS=3D"$CONFIG_COMMANDS default-2" ;; "Makefile") CONFIG_FILES=3D"$CONFIG_FILES Makefile" ;; =20 *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; @@ -6347,6 +6352,14 @@ $as_echo X"$file" | } ;; "default-1":C) +for subdir in $subdirs; do + case " $CONFIG_FILES " in + *" $subdir/Makefile "*) + ac_file=3D$subdir/Makefile . ${multi_basedir}/config-ml.in + ;; + esac +done ;; + "default-2":C) # Only add multilib support code if we just rebuilt the top-level # Makefile. case " $CONFIG_FILES " in diff --git a/libgloss/configure.ac b/libgloss/configure.ac index ac812c69b..1fa877729 100644 --- a/libgloss/configure.ac +++ b/libgloss/configure.ac @@ -330,6 +330,19 @@ target_makefile_frag_path=3D$target_makefile_frag AC_SUBST(target_makefile_frag_path) AC_SUBST_FILE(target_makefile_frag) =20 +dnl AM_ENABLE_MULTILIB only processes the top-level Makefile, but we want = the +dnl multilib settings to propagate to all sub-Makefiles that we recurse in= to +dnl too. This can go away if we ever get rid of sub-Makefiles and only use +dnl Automake + makefile include fragments. +AC_OUTPUT_COMMANDS([ +for subdir in $subdirs; do + case " $CONFIG_FILES " in + *" $subdir/Makefile "*) + ac_file=3D$subdir/Makefile . ${multi_basedir}/config-ml.in + ;; + esac +done], [subdirs=3D"$subdirs"]) + AM_ENABLE_MULTILIB(, ..) =20 AC_CONFIG_FILES([Makefile])