From 3f8414df7a533cccd39bf19c0e311975d9ededde Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 15 Jun 2021 23:01:45 -0400 Subject: [PATCH] sim: create a makefile fragment to pass common settings down As we merge settings from subdirs into the common configure, we sometimes need to keep the settings working in both dirs. Create a makefile fragment to pass them down so we don't have to run the checks twice. For now, the file is empty, but we'll start moving logic in shortly. --- sim/ChangeLog | 6 ++++++ sim/Makefile.in | 4 +++- sim/arch-subdir.mk.in | 18 ++++++++++++++++++ sim/common/ChangeLog | 4 ++++ sim/common/Make-common.in | 3 +++ sim/configure | 3 ++- sim/configure.ac | 2 +- sim/ppc/ChangeLog | 4 ++++ sim/ppc/Makefile.in | 3 +++ 9 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 sim/arch-subdir.mk.in diff --git a/sim/ChangeLog b/sim/ChangeLog index 9740e1311bc..65d0f11f41e 100644 --- a/sim/ChangeLog +++ b/sim/ChangeLog @@ -1,3 +1,9 @@ +2021-06-18 Mike Frysinger + + * configure.ac: Output arch-subdir.mk. + * Makefile.in, configure: Regenerate. + * arch-subdir.mk.in: New file. + 2021-06-17 Mike Frysinger * configure.ac: Call SIM_AC_OPTION_ENDIAN. diff --git a/sim/Makefile.in b/sim/Makefile.in index f77abe38d8a..3a852206c6b 100644 --- a/sim/Makefile.in +++ b/sim/Makefile.in @@ -217,7 +217,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = arch-subdir.mk CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru @@ -866,6 +866,8 @@ $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 +arch-subdir.mk: $(top_builddir)/config.status $(srcdir)/arch-subdir.mk.in + cd $(top_builddir) && $(SHELL) ./config.status $@ clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in new file mode 100644 index 00000000000..9eae1f3e499 --- /dev/null +++ b/sim/arch-subdir.mk.in @@ -0,0 +1,18 @@ +## Fragment to pass common settings into arch subdir builds. +## NB: This should eventually be merged into sim/Makefile.am once there are no +## subdir configure scripts. +# +# Copyright (C) 1993-2021 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 61da7e916ef..842a8973f68 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,7 @@ +2021-06-18 Mike Frysinger + + * Make-common.in: Include ../arch-subdir.mk. + 2021-06-18 Mike Frysinger * cgen-run.c: Include sim-signal.h. diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 7a6a2030a47..b82e76c91f6 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -46,6 +46,9 @@ include $(srcroot)/gdb/silent-rules.mk GNULIB_PARENT_DIR = ../.. include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc +# Settings from top-level configure. +include ../arch-subdir.mk + prefix = @prefix@ exec_prefix = @exec_prefix@ diff --git a/sim/configure b/sim/configure index 959fa9037ad..74ca8eb806d 100755 --- a/sim/configure +++ b/sim/configure @@ -6883,7 +6883,7 @@ _ACEOF $as_echo "$sim_trace" >&6; } -ac_config_files="$ac_config_files Makefile" +ac_config_files="$ac_config_files arch-subdir.mk Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -7622,6 +7622,7 @@ do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "arch-subdir.mk") CONFIG_FILES="$CONFIG_FILES arch-subdir.mk" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; diff --git a/sim/configure.ac b/sim/configure.ac index 4ba2921ebaf..91af0bba586 100644 --- a/sim/configure.ac +++ b/sim/configure.ac @@ -118,5 +118,5 @@ SIM_AC_OPTION_PROFILE SIM_AC_OPTION_STDIO SIM_AC_OPTION_TRACE -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([arch-subdir.mk Makefile]) AC_OUTPUT diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 6f2531fcc3d..9f4f58b3a20 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,7 @@ +2021-06-18 Mike Frysinger + + * Makefile.in: Include ../arch-subdir.mk. + 2021-06-18 Mike Frysinger * sim-main.h: Delete sim-signal.h include. diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in index 4446922dede..b4cb587f905 100644 --- a/sim/ppc/Makefile.in +++ b/sim/ppc/Makefile.in @@ -25,6 +25,9 @@ srccom = $(srcdir)/../common srcroot = $(srcdir)/../.. srcsim = $(srcdir)/.. +# Settings from top-level configure. +include ../arch-subdir.mk + prefix = @prefix@ exec_prefix = @exec_prefix@ -- 2.39.2