[PATCH 1/2] sim: create a makefile fragment to pass common settings

Mike Frysinger vapier@gentoo.org
Fri Jun 18 05:21:27 GMT 2021


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/Makefile.in           |  4 +++-
 sim/arch-subdir.mk.in     | 18 ++++++++++++++++++
 sim/common/Make-common.in |  3 +++
 sim/configure             |  3 ++-
 sim/configure.ac          |  2 +-
 sim/ppc/Makefile.in       |  3 +++
 6 files changed, 30 insertions(+), 3 deletions(-)
 create mode 100644 sim/arch-subdir.mk.in

diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
new file mode 100644
index 000000000000..9eae1f3e4998
--- /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 <http://www.gnu.org/licenses/>.
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 7a6a2030a47b..b82e76c91f6f 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.ac b/sim/configure.ac
index 4ba2921ebaf3..91af0bba5860 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
-- 
2.31.1



More information about the Gdb-patches mailing list