From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id E74263858402 for ; Mon, 7 Nov 2022 14:51:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E74263858402 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id E7E71340FF7; Mon, 7 Nov 2022 14:51:58 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH] sim: build: add a proper var for enabled arches Date: Mon, 7 Nov 2022 21:51:54 +0700 Message-Id: <20221107145154.20302-1-vapier@gentoo.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The install code was using $SUBDIRS to track all enabled arches. This works, but isn't great if we want to add a subdir that isn't an arch port, or as we merge the subdirs into the top-level. Create a new var explicitly to track the list of enabled arches instead. --- sim/Makefile.am | 26 +++++------- sim/Makefile.in | 27 ++++++------- sim/configure | 102 ++++++++++++++++++++++++++++++++--------------- sim/configure.ac | 6 +++ 4 files changed, 98 insertions(+), 63 deletions(-) diff --git a/sim/Makefile.am b/sim/Makefile.am index 7cdcc6013077..7197590035f6 100644 --- a/sim/Makefile.am +++ b/sim/Makefile.am @@ -198,29 +198,25 @@ all-recursive: $(SIM_ALL_RECURSIVE_DEPS) install-data-local: installdirs $(SIM_INSTALL_DATA_LOCAL_DEPS) $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(libdir) lib=`echo sim | sed '$(program_transform_name)'`; \ - for d in $(SUBDIRS); do \ - if [ -e $$d/run$(EXEEXT) ]; then \ - n="$$lib"; \ - [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \ - n="lib$$n.a"; \ - $(INSTALL_DATA) $$d/libsim.a $(DESTDIR)$(libdir)/$$n || exit 1; \ - fi; \ + for d in $(SIM_ENABLED_ARCHES); do \ + n="$$lib"; \ + [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \ + n="lib$$n.a"; \ + $(INSTALL_DATA) $$d/libsim.a $(DESTDIR)$(libdir)/$$n || exit 1; \ done install-exec-local: installdirs $(SIM_INSTALL_EXEC_LOCAL_DEPS) $(AM_V_at)$(MKDIR_P) $(DESTDIR)$(bindir) run=`echo run | sed '$(program_transform_name)'`; \ - for d in $(SUBDIRS); do \ - if [ -e $$d/run$(EXEEXT) ]; then \ - n="$$run"; \ - [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \ - $(LIBTOOL) --mode=install \ - $(INSTALL_PROGRAM) $$d/run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) || exit 1; \ - fi; \ + for d in $(SIM_ENABLED_ARCHES); do \ + n="$$run"; \ + [ "$(SIM_PRIMARY_TARGET)" = "$$d" ] || n="$$n-$$d"; \ + $(LIBTOOL) --mode=install \ + $(INSTALL_PROGRAM) $$d/run$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) || exit 1; \ done uninstall-local: $(SIM_UNINSTALL_LOCAL_DEPS) rm -f $(DESTDIR)$(bindir)/run $(DESTDIR)$(libdir)/libsim.a - for d in $(SUBDIRS); do \ + for d in $(SIM_ENABLED_ARCHES); do \ rm -f $(DESTDIR)$(bindir)/run-$$d $(DESTDIR)$(libdir)/libsim-$$d.a; \ done diff --git a/sim/configure.ac b/sim/configure.ac index 135aa2198cfd..3c3743779229 100644 --- a/sim/configure.ac +++ b/sim/configure.ac @@ -48,9 +48,14 @@ dnl used when installing files to see if they need to be suffixed. SIM_PRIMARY_TARGET= AC_SUBST(SIM_PRIMARY_TARGET) +dnl Directories that we need to recurse into (i.e. add to $SUBDIRS). SIM_SUBDIRS= AC_SUBST(SIM_SUBDIRS) +dnl List of enabled arch backends. +SIM_ENABLED_ARCHES= +AC_SUBST(SIM_ENABLED_ARCHES) + dnl Used by common/Make-common.in to see which configure script created it. SIM_COMMON_BUILD_TRUE= SIM_COMMON_BUILD_FALSE='#' @@ -62,6 +67,7 @@ dnl Build a particular arch subdir. dnl arg[1] is the arch subdir name. dnl arg[2] is whether the arch has a dedicated configure script. m4_define([SIM_BUILD_TARGET], [dnl + AS_VAR_APPEND([SIM_ENABLED_ARCHES], [" $1"]) m4_if($2, [true], [dnl AC_CONFIG_SUBDIRS($1) ], [dnl -- 2.38.1