From patchwork Mon Nov 7 14:51:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 60107 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4B2B33858415 for ; Mon, 7 Nov 2022 14:52:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B2B33858415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667832748; bh=toyukEZDqjJ2nWnD9W18L4t/74nz0xmzAj/HiQvsT2k=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=roCflS3WxhqSiqyQMLrDAP+xti7N2qX+DtFx2Q5xLOnEnWTZuloXYz7pV9JHAj2Z5 qwzF6C32FLmJGjIgHdtSuz+uBpy93CDyKYreqgXw/QuqG/6wgKCO08HIxAN1R+L/qN V6JTuiPgkYDvrrUirJbi3SmuRsl2q/YNJHdLegjs= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 Received: by smtp.gentoo.org (Postfix, from userid 559) id E7E71340FF7; Mon, 7 Nov 2022 14:51:58 +0000 (UTC) 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 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Mike Frysinger via Gdb-patches From: Mike Frysinger Reply-To: Mike Frysinger Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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