public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 00/10] sim build improvements
@ 2021-04-08 20:33 Tom Tromey
  2021-04-08 20:33 ` [PATCH 01/10] Make mostlyclean an alias for clean Tom Tromey
                   ` (10 more replies)
  0 siblings, 11 replies; 31+ messages in thread
From: Tom Tromey @ 2021-04-08 20:33 UTC (permalink / raw)
  To: gdb-patches

I ran "make distclean" in a sim subdirectory and broke my build tree.
So, I looked into this failure, and then I found a number of other
build issues that could be fixed.  This series is the result.

If you apply this, and once this lands, you'll have to do a clean
build.

Let me know what you think.

Tom



^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 01/10] Make mostlyclean an alias for clean
  2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
@ 2021-04-08 20:33 ` Tom Tromey
  2021-04-09  0:25   ` Mike Frysinger
  2021-04-08 20:33 ` [PATCH 02/10] Introduce stamp file for hw-config.h Tom Tromey
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-08 20:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

I found out by accident that "mostlyclean" in a sim subdir removes all
the configure artifacts.  The usual rule is:

* If the maintainer built it, maintainer-clean should remove it;
* If configure built it, distclean should remove it;
* If make built it, "clean" should remove it;
* If there is a handy subset of "clean" that is "easy" to rebuild,
  "mostlyclean" should remove it; otherwise mostlyclean should be an
  alias for clean

This patch makes mostlyclean an alias for clean.

sim/common/ChangeLog
2021-04-07  Tom Tromey  <tom@tromey.com>

	* Make-common.in (mostlyclean): Now an alias for clean, not
	distclean.
---
 sim/common/ChangeLog      | 5 +++++
 sim/common/Make-common.in | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 28f50abb220..34e8d5c5298 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -504,7 +504,7 @@ TAGS: force
 	etags --regex '/^\([[:lower:]_]+\) (/\1/' --regex '/^\/[*] TAGS: .*/' \
 		*.[ch] ../common/*.[ch]
 
-clean: $(SIM_EXTRA_CLEAN)
+mostlyclean clean: $(SIM_EXTRA_CLEAN)
 	rm -f *.[oa] *~ core
 	rm -f run$(EXEEXT) libsim.a
 	rm -f gentmap targ-map.c targ-vals.h stamp-tvals
@@ -513,7 +513,7 @@ clean: $(SIM_EXTRA_CLEAN)
 	fi
 	rm -f tmp-mloop.hin tmp-mloop.h tmp-mloop.cin tmp-mloop.c
 
-distclean mostlyclean maintainer-clean realclean: clean $(SIM_EXTRA_DISTCLEAN)
+distclean maintainer-clean realclean: clean $(SIM_EXTRA_DISTCLEAN)
 	rm -f TAGS
 	rm -f Makefile config.cache config.log config.status .gdbinit
 	rm -f config.h stamp-h
-- 
2.26.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 02/10] Introduce stamp file for hw-config.h
  2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
  2021-04-08 20:33 ` [PATCH 01/10] Make mostlyclean an alias for clean Tom Tromey
@ 2021-04-08 20:33 ` Tom Tromey
  2021-04-09  0:25   ` Mike Frysinger
  2021-04-08 20:33 ` [PATCH 03/10] Add stamp files for generated files in sim/ppc Tom Tromey
                   ` (8 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-08 20:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This adds a stamp file for hw-config.h, to avoid unnecessary rebuilds.
It also arranges to remove hw-config.h in "mostlyclean", because the
file is created by "make".

2021-04-08  Tom Tromey  <tom@tromey.com>

	* Make-common.in (stamp-hw): New target.
	(hw-config.h): Depend on stamp-hw.
	(mostlyclean): Remove stamp-hw and hw-config.h.
---
 sim/common/ChangeLog      | 6 ++++++
 sim/common/Make-common.in | 7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 34e8d5c5298..f1ebc5e30c7 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -438,7 +438,8 @@ $(all_object_files) : $(generated_files)
 @GMAKE_TRUE@-include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
 
 # FIXME This is one very simple-minded way of generating the file hw-config.h
-hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile
+hw-config.h: stamp-hw ; @true
+stamp-hw: Makefile.in $(srccom)/Make-common.in config.status Makefile
 	rm -f tmp-hw.h
 	echo "/* generated by Makefile */" > tmp-hw.h
 	sim_hw="$(SIM_HW)"; \
@@ -452,7 +453,8 @@ hw-config.h: Makefile.in $(srccom)/Make-common.in config.status Makefile
 	done >> tmp-hw.h
 	echo "  NULL," >> tmp-hw.h
 	echo "};" >> tmp-hw.h
-	mv tmp-hw.h hw-config.h
+	$(SHELL) $(srcroot)/move-if-change tmp-hw.h hw-config.h
+	@echo stamp > stamp-hw
 
 test-hw-events: $(srccom)/hw-events.c libsim.a
 	$(CC) $(ALL_CFLAGS) -DMAIN -o test-hw-events$(EXEEXT) \
@@ -507,6 +509,7 @@ TAGS: force
 mostlyclean clean: $(SIM_EXTRA_CLEAN)
 	rm -f *.[oa] *~ core
 	rm -f run$(EXEEXT) libsim.a
+	rm -f hw-config.h stamp-hw
 	rm -f gentmap targ-map.c targ-vals.h stamp-tvals
 	if [ ! -f Make-common.in ] ; then \
 		rm -f $(BUILT_SRC_FROM_COMMON) ; \
-- 
2.26.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 03/10] Add stamp files for generated files in sim/ppc
  2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
  2021-04-08 20:33 ` [PATCH 01/10] Make mostlyclean an alias for clean Tom Tromey
  2021-04-08 20:33 ` [PATCH 02/10] Introduce stamp file for hw-config.h Tom Tromey
@ 2021-04-08 20:33 ` Tom Tromey
  2021-04-09  0:25   ` Mike Frysinger
  2021-04-08 20:33 ` [PATCH 04/10] Require GNU make Tom Tromey
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-08 20:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes the sim/ppc Makefile to use the stamp file idiom for a
couple of generated files, avoiding extra rebuilds.

sim/ppc/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (stamp-vals, stamp-map): New targets.
	(targ-vals.h, targ-map.c): Update.
	(clean): Remove files.
---
 sim/ppc/ChangeLog   | 6 ++++++
 sim/ppc/Makefile.in | 9 +++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index d9d01985404..7686937f421 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -635,15 +635,19 @@ targ-vals.def: $(srcdir)/../common/nltvals.def
 	cat $(srcdir)/../common/nltvals.def > tmp-vals.def
 	$(SHELL) $(srcdir)/../../move-if-change tmp-vals.def targ-vals.def
 
-targ-vals.h: Makefile gentmap $(srcdir)/../../move-if-change
+targ-vals.h: stamp-vals ; @true
+stamp-vals: Makefile gentmap $(srcdir)/../../move-if-change
 	rm -f tmp-vals.h
 	./gentmap -h > tmp-vals.h
 	$(SHELL) $(srcdir)/../../move-if-change tmp-vals.h targ-vals.h
+	@echo stamp > stamp-vals
 
-targ-map.c: Makefile gentmap $(srcdir)/../../move-if-change
+targ-map.c: stamp-map; @true
+stamp-map: Makefile gentmap $(srcdir)/../../move-if-change
 	rm -f tmp-map.c
 	./gentmap -c > tmp-map.c
 	$(SHELL) $(srcdir)/../../move-if-change tmp-map.c targ-map.c
+	@echo stamp > stamp-map
 
 callback.o: $(srcdir)/../common/callback.c $(TARG_VALS_H) $(CONFIG_H)
 	$(CC) -c $(STD_CFLAGS) -DHAVE_CONFIG_H $(srcdir)/../common/callback.c
@@ -871,6 +875,7 @@ TAGS: $(BUILT_SRC)
 
 clean mostlyclean:
 	rm -f tmp-* *.[oasi] core psim$(EXEEXT) run$(EXEEXT) igen dgen $(BUILT_SRC_WO_CONFIG) gentmap
+	rm -f stamp-vals targ-vals.h stamp-map targ-map.c
 
 distclean realclean: clean
 	rm -f TAGS Makefile config.cache config.status config.h defines.h stamp-h config.log
-- 
2.26.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 04/10] Require GNU make
  2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
                   ` (2 preceding siblings ...)
  2021-04-08 20:33 ` [PATCH 03/10] Add stamp files for generated files in sim/ppc Tom Tromey
@ 2021-04-08 20:33 ` Tom Tromey
  2021-04-09  0:31   ` Mike Frysinger
  2021-04-08 20:33 ` [PATCH 05/10] Remove and modernize dependencies in sim Tom Tromey
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-08 20:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

GDB has required GNU make for quite some time, and this patch applies
this approach to the sim as well.  Requiring GNU make means that
automatic dependency tracking can be simple and reliable, and it also
makes other refactorings simpler.

sim/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* m4/sim_ac_common.m4 (SIM_AC_COMMON): Don't check for make.

sim/aarch64/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/arm/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/avr/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/bfin/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/common/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Make-common.in: Require GNU make.

sim/cr16/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/cris/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/d10v/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/erc32/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/example-synacor/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/frv/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/ft32/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/h8300/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/iq2000/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/lm32/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/m32c/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/m32r/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/m68hc11/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/mcore/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/microblaze/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/mips/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/mn10300/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/moxie/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/msp430/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/or1k/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/pru/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/riscv/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/rl78/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/rx/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/sh/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.

sim/v850/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.
---
 sim/ChangeLog                 |  4 ++
 sim/aarch64/ChangeLog         |  4 ++
 sim/aarch64/configure         | 69 +----------------------------------
 sim/arm/ChangeLog             |  4 ++
 sim/arm/configure             | 69 +----------------------------------
 sim/avr/ChangeLog             |  4 ++
 sim/avr/configure             | 69 +----------------------------------
 sim/bfin/ChangeLog            |  4 ++
 sim/bfin/configure            | 69 +----------------------------------
 sim/bpf/configure             | 69 +----------------------------------
 sim/common/ChangeLog          |  4 ++
 sim/common/Make-common.in     | 30 +++++++--------
 sim/cr16/ChangeLog            |  4 ++
 sim/cr16/configure            | 69 +----------------------------------
 sim/cris/ChangeLog            |  4 ++
 sim/cris/configure            | 69 +----------------------------------
 sim/d10v/ChangeLog            |  4 ++
 sim/d10v/configure            | 69 +----------------------------------
 sim/erc32/ChangeLog           |  4 ++
 sim/erc32/configure           | 69 +----------------------------------
 sim/example-synacor/ChangeLog |  4 ++
 sim/example-synacor/configure | 69 +----------------------------------
 sim/frv/ChangeLog             |  4 ++
 sim/frv/configure             | 69 +----------------------------------
 sim/ft32/ChangeLog            |  4 ++
 sim/ft32/configure            | 69 +----------------------------------
 sim/h8300/ChangeLog           |  4 ++
 sim/h8300/configure           | 69 +----------------------------------
 sim/iq2000/ChangeLog          |  4 ++
 sim/iq2000/configure          | 69 +----------------------------------
 sim/lm32/ChangeLog            |  4 ++
 sim/lm32/configure            | 69 +----------------------------------
 sim/m32c/ChangeLog            |  4 ++
 sim/m32c/configure            | 69 +----------------------------------
 sim/m32r/ChangeLog            |  4 ++
 sim/m32r/configure            | 69 +----------------------------------
 sim/m4/sim_ac_common.m4       | 10 -----
 sim/m68hc11/ChangeLog         |  4 ++
 sim/m68hc11/configure         | 69 +----------------------------------
 sim/mcore/ChangeLog           |  4 ++
 sim/mcore/configure           | 69 +----------------------------------
 sim/microblaze/ChangeLog      |  4 ++
 sim/microblaze/configure      | 69 +----------------------------------
 sim/mips/ChangeLog            |  4 ++
 sim/mips/configure            | 69 +----------------------------------
 sim/mn10300/ChangeLog         |  4 ++
 sim/mn10300/configure         | 69 +----------------------------------
 sim/moxie/ChangeLog           |  4 ++
 sim/moxie/configure           | 69 +----------------------------------
 sim/msp430/ChangeLog          |  4 ++
 sim/msp430/configure          | 69 +----------------------------------
 sim/or1k/ChangeLog            |  4 ++
 sim/or1k/configure            | 69 +----------------------------------
 sim/pru/ChangeLog             |  4 ++
 sim/pru/configure             | 69 +----------------------------------
 sim/riscv/ChangeLog           |  4 ++
 sim/riscv/configure           | 69 +----------------------------------
 sim/rl78/ChangeLog            |  4 ++
 sim/rl78/configure            | 69 +----------------------------------
 sim/rx/ChangeLog              |  4 ++
 sim/rx/configure              | 69 +----------------------------------
 sim/sh/ChangeLog              |  4 ++
 sim/sh/configure              | 69 +----------------------------------
 sim/v850/ChangeLog            |  4 ++
 sim/v850/configure            | 69 +----------------------------------
 65 files changed, 205 insertions(+), 2102 deletions(-)

diff --git a/sim/aarch64/configure b/sim/aarch64/configure
index bb1e6296c96..70c5488a2de 100755
--- a/sim/aarch64/configure
+++ b/sim/aarch64/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12220,10 +12159,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/arm/configure b/sim/arm/configure
index 7e8c3452ce8..a73ba1597a8 100755
--- a/sim/arm/configure
+++ b/sim/arm/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12216,10 +12155,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/avr/configure b/sim/avr/configure
index 853462d64d5..f492aa553b0 100755
--- a/sim/avr/configure
+++ b/sim/avr/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12216,10 +12155,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/bfin/configure b/sim/bfin/configure
index fc432d0ca03..49f1c8ba9dd 100755
--- a/sim/bfin/configure
+++ b/sim/bfin/configure
@@ -680,9 +680,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7148,64 +7145,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11255,7 +11194,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11258 "configure"
+#line 11197 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11361,7 +11300,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11364 "configure"
+#line 11303 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12691,10 +12630,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/bpf/configure b/sim/bpf/configure
index 8f4a1ebc91f..76524c23c09 100755
--- a/sim/bpf/configure
+++ b/sim/bpf/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7138,64 +7135,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11245,7 +11184,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11248 "configure"
+#line 11187 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11351,7 +11290,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11354 "configure"
+#line 11293 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12353,10 +12292,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index f1ebc5e30c7..c3c5748d061 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -401,21 +401,21 @@ hw_main_headers = \
 # simpler scheme.
 #
 
-@GMAKE_TRUE@ifeq ($(DEPMODE),depmode=gcc3)
+ifeq ($(DEPMODE),depmode=gcc3)
 # Note that we put the dependencies into a .Tpo file, then move them
 # into place if the compile succeeds.  We need this because gcc does
 # not atomically write the dependency output file.
-@GMAKE_TRUE@override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
-@GMAKE_TRUE@	-MF $(DEPDIR)/$(basename $(@F)).Tpo
-@GMAKE_TRUE@override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \
-@GMAKE_TRUE@	$(DEPDIR)/$(basename $(@F)).Po
-@GMAKE_TRUE@else
-@GMAKE_TRUE@override COMPILE.pre = source='$<' object='$@' libtool=no \
-@GMAKE_TRUE@	DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC)
+override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
+	-MF $(DEPDIR)/$(basename $(@F)).Tpo
+override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \
+	$(DEPDIR)/$(basename $(@F)).Po
+else
+override COMPILE.pre = source='$<' object='$@' libtool=no \
+	DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC)
 # depcomp handles atomicity for us, so we don't need a postcompile
 # step.
-@GMAKE_TRUE@override POSTCOMPILE =
-@GMAKE_TRUE@endif
+override POSTCOMPILE =
+endif
 
 all_object_files = $(LIB_OBJS) $(SIM_RUN_OBJS)
 generated_files = \
@@ -428,14 +428,14 @@ generated_files = \
 # Ensure that generated files are created early.  Use order-only
 # dependencies if available.  They require GNU make 3.80 or newer,
 # and the .VARIABLES variable was introduced at the same time.
-@GMAKE_TRUE@ifdef .VARIABLES
-@GMAKE_TRUE@$(all_object_files): | $(generated_files)
-@GMAKE_TRUE@else
+ifdef .VARIABLES
+$(all_object_files): | $(generated_files)
+else
 $(all_object_files) : $(generated_files)
-@GMAKE_TRUE@endif
+endif
 
 # Dependencies.
-@GMAKE_TRUE@-include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
+-include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
 
 # FIXME This is one very simple-minded way of generating the file hw-config.h
 hw-config.h: stamp-hw ; @true
diff --git a/sim/cr16/configure b/sim/cr16/configure
index 16b0d7237a8..793aff7353d 100755
--- a/sim/cr16/configure
+++ b/sim/cr16/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12213,10 +12152,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/cris/configure b/sim/cris/configure
index d882057cb8a..56740dabd5d 100755
--- a/sim/cris/configure
+++ b/sim/cris/configure
@@ -677,9 +677,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7139,64 +7136,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11246,7 +11185,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11249 "configure"
+#line 11188 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11352,7 +11291,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11355 "configure"
+#line 11294 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12419,10 +12358,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/d10v/configure b/sim/d10v/configure
index 7bde3b270c3..84f33c45134 100755
--- a/sim/d10v/configure
+++ b/sim/d10v/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12213,10 +12152,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/erc32/configure b/sim/erc32/configure
index 3f7227b2e7e..8729505a5f1 100755
--- a/sim/erc32/configure
+++ b/sim/erc32/configure
@@ -683,9 +683,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7120,64 +7117,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11227,7 +11166,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11230 "configure"
+#line 11169 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11333,7 +11272,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11336 "configure"
+#line 11275 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12254,10 +12193,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/example-synacor/configure b/sim/example-synacor/configure
index 4392bc8c316..8e8bdcdbb2d 100755
--- a/sim/example-synacor/configure
+++ b/sim/example-synacor/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12216,10 +12155,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/frv/configure b/sim/frv/configure
index e3b9f0701c5..b55e7ead7cc 100755
--- a/sim/frv/configure
+++ b/sim/frv/configure
@@ -678,9 +678,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7142,64 +7139,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11249,7 +11188,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11252 "configure"
+#line 11191 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11355,7 +11294,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11358 "configure"
+#line 11297 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12424,10 +12363,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/ft32/configure b/sim/ft32/configure
index f3a84fae6b4..5dc69fd8d73 100755
--- a/sim/ft32/configure
+++ b/sim/ft32/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12216,10 +12155,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/h8300/configure b/sim/h8300/configure
index 07f4d74ae62..0d022c6a801 100755
--- a/sim/h8300/configure
+++ b/sim/h8300/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12226,10 +12165,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/iq2000/configure b/sim/iq2000/configure
index 5b5954d3f03..2207210db52 100755
--- a/sim/iq2000/configure
+++ b/sim/iq2000/configure
@@ -677,9 +677,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7139,64 +7136,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11246,7 +11185,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11249 "configure"
+#line 11188 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11352,7 +11291,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11355 "configure"
+#line 11294 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12403,10 +12342,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/lm32/configure b/sim/lm32/configure
index 3b50a57b003..08f0eba9836 100755
--- a/sim/lm32/configure
+++ b/sim/lm32/configure
@@ -677,9 +677,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7139,64 +7136,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11246,7 +11185,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11249 "configure"
+#line 11188 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11352,7 +11291,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11355 "configure"
+#line 11294 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12402,10 +12341,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/m32c/configure b/sim/m32c/configure
index 0ef2184ccaf..349101584e0 100755
--- a/sim/m32c/configure
+++ b/sim/m32c/configure
@@ -681,9 +681,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7118,64 +7115,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11225,7 +11164,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11228 "configure"
+#line 11167 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11331,7 +11270,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11334 "configure"
+#line 11273 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12129,10 +12068,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/m32r/configure b/sim/m32r/configure
index 1b02402f618..60a0d8eab38 100755
--- a/sim/m32r/configure
+++ b/sim/m32r/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7141,64 +7138,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11248,7 +11187,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11251 "configure"
+#line 11190 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11354,7 +11293,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11357 "configure"
+#line 11296 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12418,10 +12357,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/m4/sim_ac_common.m4 b/sim/m4/sim_ac_common.m4
index 8cb45a8b72a..31964bb7165 100644
--- a/sim/m4/sim_ac_common.m4
+++ b/sim/m4/sim_ac_common.m4
@@ -35,16 +35,6 @@ AC_SUBST(PACKAGE)
 ZW_CREATE_DEPDIR
 ZW_PROG_COMPILER_DEPENDENCIES([CC])
 
-# Check for the 'make' the user wants to use.
-AC_CHECK_PROGS(MAKE, make)
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
-AM_CONDITIONAL(GMAKE, test "$MAKE_IS_GNU" = yes)
-
 dnl We don't use gettext, but bfd does.  So we do the appropriate checks
 dnl to see if there are intl libraries we should link against.
 ALL_LINGUAS=
diff --git a/sim/m68hc11/configure b/sim/m68hc11/configure
index 8185d98a4d9..398dd283617 100755
--- a/sim/m68hc11/configure
+++ b/sim/m68hc11/configure
@@ -676,9 +676,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7128,64 +7125,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11235,7 +11174,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11238 "configure"
+#line 11177 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11341,7 +11280,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11344 "configure"
+#line 11283 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12323,10 +12262,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/mcore/configure b/sim/mcore/configure
index 7bde3b270c3..84f33c45134 100755
--- a/sim/mcore/configure
+++ b/sim/mcore/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12213,10 +12152,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/microblaze/configure b/sim/microblaze/configure
index 7e8c3452ce8..a73ba1597a8 100755
--- a/sim/microblaze/configure
+++ b/sim/microblaze/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12216,10 +12155,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/mips/configure b/sim/mips/configure
index e89ed1c83e5..92d41ece133 100755
--- a/sim/mips/configure
+++ b/sim/mips/configure
@@ -686,9 +686,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7158,64 +7155,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11265,7 +11204,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11268 "configure"
+#line 11207 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11371,7 +11310,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11374 "configure"
+#line 11313 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13142,10 +13081,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/mn10300/configure b/sim/mn10300/configure
index 3106bdad8d7..b5a2b6a712a 100755
--- a/sim/mn10300/configure
+++ b/sim/mn10300/configure
@@ -674,9 +674,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7134,64 +7131,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11241,7 +11180,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11244 "configure"
+#line 11183 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11347,7 +11286,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11350 "configure"
+#line 11289 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12429,10 +12368,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/moxie/configure b/sim/moxie/configure
index cf51ce0f548..6bf47d4d8a4 100755
--- a/sim/moxie/configure
+++ b/sim/moxie/configure
@@ -680,9 +680,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7126,64 +7123,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11233,7 +11172,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11236 "configure"
+#line 11175 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11339,7 +11278,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11342 "configure"
+#line 11281 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12310,10 +12249,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/msp430/configure b/sim/msp430/configure
index f2e49ba6730..14abf9a6ef9 100755
--- a/sim/msp430/configure
+++ b/sim/msp430/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12229,10 +12168,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/or1k/configure b/sim/or1k/configure
index 8eca2376225..d65e7140e3d 100755
--- a/sim/or1k/configure
+++ b/sim/or1k/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7138,64 +7135,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11245,7 +11184,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11248 "configure"
+#line 11187 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11351,7 +11290,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11354 "configure"
+#line 11293 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12375,10 +12314,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/pru/configure b/sim/pru/configure
index 853462d64d5..f492aa553b0 100755
--- a/sim/pru/configure
+++ b/sim/pru/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12216,10 +12155,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/riscv/configure b/sim/riscv/configure
index d631f311703..4b4fc6b8db2 100755
--- a/sim/riscv/configure
+++ b/sim/riscv/configure
@@ -677,9 +677,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7130,64 +7127,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11237,7 +11176,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11240 "configure"
+#line 11179 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11343,7 +11282,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11346 "configure"
+#line 11285 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12332,10 +12271,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/rl78/configure b/sim/rl78/configure
index 903ba63a58f..e00d20404f3 100755
--- a/sim/rl78/configure
+++ b/sim/rl78/configure
@@ -681,9 +681,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7118,64 +7115,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11225,7 +11164,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11228 "configure"
+#line 11167 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11331,7 +11270,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11334 "configure"
+#line 11273 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12127,10 +12066,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/rx/configure b/sim/rx/configure
index bfb8c79ecfa..4ad5c706464 100755
--- a/sim/rx/configure
+++ b/sim/rx/configure
@@ -681,9 +681,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7123,64 +7120,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11230,7 +11169,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11233 "configure"
+#line 11172 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11336,7 +11275,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11339 "configure"
+#line 11278 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12172,10 +12111,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/sh/configure b/sim/sh/configure
index 7bde3b270c3..84f33c45134 100755
--- a/sim/sh/configure
+++ b/sim/sh/configure
@@ -679,9 +679,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7125,64 +7122,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11232,7 +11171,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11235 "configure"
+#line 11174 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11338,7 +11277,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11341 "configure"
+#line 11280 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12213,10 +12152,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/sim/v850/configure b/sim/v850/configure
index 3f1085fc332..9176b7ff64c 100755
--- a/sim/v850/configure
+++ b/sim/v850/configure
@@ -677,9 +677,6 @@ INCINTL
 LIBINTL_DEP
 LIBINTL
 USE_NLS
-GMAKE_FALSE
-GMAKE_TRUE
-MAKE
 CCDEPMODE
 DEPDIR
 am__leading_dot
@@ -7131,64 +7128,6 @@ else CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 fi
 
 
-# Check for the 'make' the user wants to use.
-for ac_prog in make
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MAKE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$MAKE"; then
-  ac_cv_prog_MAKE="$MAKE" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_MAKE="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-MAKE=$ac_cv_prog_MAKE
-if test -n "$MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE" >&5
-$as_echo "$MAKE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$MAKE" && break
-done
-
-MAKE_IS_GNU=
-case "`$MAKE --version 2>&1 | sed 1q`" in
-  *GNU*)
-    MAKE_IS_GNU=yes
-    ;;
-esac
- if test "$MAKE_IS_GNU" = yes; then
-  GMAKE_TRUE=
-  GMAKE_FALSE='#'
-else
-  GMAKE_TRUE='#'
-  GMAKE_FALSE=
-fi
-
-
 ALL_LINGUAS=
 # If we haven't got the data from the intl directory,
 # assume NLS is disabled.
@@ -11238,7 +11177,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11241 "configure"
+#line 11180 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11344,7 +11283,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11347 "configure"
+#line 11286 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12322,10 +12261,6 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 
-if test -z "${GMAKE_TRUE}" && test -z "${GMAKE_FALSE}"; then
-  as_fn_error $? "conditional \"GMAKE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${PLUGINS_TRUE}" && test -z "${PLUGINS_FALSE}"; then
   as_fn_error $? "conditional \"PLUGINS\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
-- 
2.26.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 05/10] Remove and modernize dependencies in sim
  2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
                   ` (3 preceding siblings ...)
  2021-04-08 20:33 ` [PATCH 04/10] Require GNU make Tom Tromey
@ 2021-04-08 20:33 ` Tom Tromey
  2021-04-11 17:50   ` Mike Frysinger
  2021-04-08 20:33 ` [PATCH 06/10] Remove INCLUDE variable from some sim Makefiles Tom Tromey
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-08 20:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

Some spots in the sim build used manual dependencies, and some spots
did a compilation by hand but did not use the automatic dependency
tracking code.  This patch fixes these spots.

I didn't touch ppc, because it doesn't use the common Makefile code.
I also didn't touch objects that are for the build machine, because
automatic dependencies don't work for those.

2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (armemu26.o, armemu32.o): Use COMPILE and
	POSTCOMPILE.

sim/bpf/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (arch.o, cpu.o, sim-if.o, traps.o): Remove.
	(mloop-le.o, mloop-be.o, decode-le.o, decode-be.o, sim-le.o)
	(sim-be.o): Use COMPILE and POSTCOMPILE.

sim/cr16/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (SIM_EXTRA_DEPS): New variable.
	(simops.o): Remove.

sim/cris/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (sim-if.o, dv-cris.o, dv-rv.o, arch.o, traps.o)
	(devices.o, crisv10f.o, mloopv10f.o, cpuv10.o, decodev10.o)
	(modelv10.o, crisv32f.o, mloopv32f.o, cpuv32.o, decodev32.o)
	(modelv32.o): Remove.

sim/d10v/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (SIM_EXTRA_DEPS): New variable.
	(simops.o): Remove.

sim/frv/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (arch.o, devices.o, frv.o, traps.o, pipeline.o)
	(interrupts.o, memory.o, cache.o, options.o, reset.o)
	(registers.o, profile.o, profile-fr400.o, profile-fr450.o)
	(profile-fr500.o, profile-fr550.o, sim-if.o, mloop.o, cpu.o)
	(decode.o, sem.o, model.o): Remove.

sim/iq2000/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (sim-if.o): Remove.
	(arch.o): Use COMPILE and POSTCOMPILE.
	(devices.o, iq2000.o, mloop.o, cpu.o, decode.o, sem.o, model.o):
	Remove.

sim/lm32/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (arch.o, traps.o, sim-if.o, lm32.o, mloop.o)
	(cpu.o, decode.o, sem.o, model.o): Remove.

sim/m32r/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (sim-if.o, arch.o, traps.o, traps-linux.o)
	(devices.o, m32r.o, mloop.o, cpu.o, decode.o, sem.o, model.o)
	(m32rx.o, mloopx.o, cpux.o, decodex.o, semx.o, modelx.o)
	(m32r2.o, mloop2.o, cpu2.o, decode2.o, sem2.o, model2.o): Remove.

sim/m68hc11/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (interp.o): Remove.

sim/mips/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (interp.o, m16run.o, micromipsrun.o, multi-run.o):
	Remove.

sim/mn10300/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (interp.o): Remove.
	(idecode.o op_utils.o semantics.o): Remove.

sim/or1k/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (mloop.o, arch.o, cpu.o, decode.o, sem.o)
	(sem-switch.o, model.o): Remove.

sim/rl78/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (err.o, fpu.o, gdb-if.o, load.o, main.o, mem.o)
	(reg.o, rl78.o): Remove.

sim/rx/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (err.o, fpu.o, gdb-if.o, load.o, main.o, mem.o)
	(misc.o, reg.o, rx.o, syscalls.o, trace.o): Remove.

sim/sh/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (SIM_EXTRA_DEPS): New variable.
	(interp.o): Remove.

sim/v850/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (interp.o, simops.o, semantics.o): Remove.
---
 sim/arm/ChangeLog       |  5 +++++
 sim/arm/Makefile.in     | 10 ++++++----
 sim/bpf/ChangeLog       |  6 ++++++
 sim/bpf/Makefile.in     | 37 +++++++++++++++----------------------
 sim/cr16/ChangeLog      |  5 +++++
 sim/cr16/Makefile.in    |  4 ++--
 sim/cris/ChangeLog      |  7 +++++++
 sim/cris/Makefile.in    | 27 ---------------------------
 sim/d10v/ChangeLog      |  5 +++++
 sim/d10v/Makefile.in    |  4 ++--
 sim/frv/ChangeLog       |  8 ++++++++
 sim/frv/Makefile.in     | 27 ---------------------------
 sim/iq2000/ChangeLog    |  7 +++++++
 sim/iq2000/Makefile.in  | 17 +++--------------
 sim/lm32/ChangeLog      |  5 +++++
 sim/lm32/Makefile.in    | 14 --------------
 sim/m32r/ChangeLog      |  7 +++++++
 sim/m32r/Makefile.in    | 32 --------------------------------
 sim/m68hc11/ChangeLog   |  4 ++++
 sim/m68hc11/Makefile.in |  2 --
 sim/mips/ChangeLog      |  5 +++++
 sim/mips/Makefile.in    |  9 ---------
 sim/mn10300/ChangeLog   |  5 +++++
 sim/mn10300/Makefile.in |  4 ----
 sim/or1k/ChangeLog      |  5 +++++
 sim/or1k/Makefile.in    |  7 -------
 sim/rl78/ChangeLog      |  5 +++++
 sim/rx/ChangeLog        |  5 +++++
 sim/rx/Makefile.in      | 16 ----------------
 sim/sh/ChangeLog        |  5 +++++
 sim/sh/Makefile.in      |  3 +--
 sim/v850/ChangeLog      |  4 ++++
 sim/v850/Makefile.in    |  4 ----
 33 files changed, 122 insertions(+), 188 deletions(-)

diff --git a/sim/arm/Makefile.in b/sim/arm/Makefile.in
index ff8beb5ce34..29166952ce1 100644
--- a/sim/arm/Makefile.in
+++ b/sim/arm/Makefile.in
@@ -29,8 +29,10 @@ SIM_OBJS = \
 
 ## COMMON_POST_CONFIG_FRAG
 
-armemu26.o: armemu.c armdefs.h armemu.h
-	$(CC) -c $(srcdir)/armemu.c -o armemu26.o $(ALL_CFLAGS)
+armemu26.o: armemu.c
+	$(COMPILE) $(srcdir)/armemu.c
+	$(POSTCOMPILE)
 
-armemu32.o: armemu.c armdefs.h armemu.h
-	$(CC) -c $(srcdir)/armemu.c -o armemu32.o -DMODE32 $(ALL_CFLAGS)
+armemu32.o: armemu.c
+	$(COMPILE) -DMODE32 $(srcdir)/armemu.c
+	$(POSTCOMPILE)
diff --git a/sim/bpf/Makefile.in b/sim/bpf/Makefile.in
index 8052a900713..b29b3c02dc0 100644
--- a/sim/bpf/Makefile.in
+++ b/sim/bpf/Makefile.in
@@ -60,33 +60,26 @@ BPF_INCLUDE_DEPS = \
 
 # Dependencies for binaries from CGEN generated source
 
-arch.o: arch.c $(SIM_MAIN_DEPS)
-cpu.o: cpu.c $(BPF_INCLUDE_DEPS)
-decode-le.o: decode-le.c $(BPF_INCLUDE_DEPS)
-decode-be.o: decode-be.c $(BPF_INCLUDE_DEPS)
-
-sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h eng.h
-	$(COMPILE) $<
+mloop-le.o: mloop-le.c
+	$(COMPILE) -DWANT_ISA_EBPFLE mloop-le.c
 	$(POSTCOMPILE)
-
-traps.o: traps.c $(SIM_MAIN_DEPS) eng.h
-	$(COMPILE) $<
+mloop-be.o: mloop-be.c
+	$(COMPILE) -DWANT_ISA_EBPFBE mloop-be.c
 	$(POSTCOMPILE)
 
-mloop-le.o: mloop-le.c $(BPF_INCLUDE_DEPS)
-	$(CC) -c mloop-le.c $(ALL_CFLAGS) -DWANT_ISA_EBPFLE
-mloop-be.o: mloop-be.c $(BPF_INCLUDE_DEPS)
-	$(CC) -c mloop-be.c $(ALL_CFLAGS) -DWANT_ISA_EBPFBE
-
-decode-le.o: decode-le.c $(BPF_INCLUDE_DEPS)
-	$(CC) -c $(srcdir)/decode-le.c $(ALL_CFLAGS) -DWANT_ISA_EBPFLE
+decode-le.o: decode-le.c
+	$(COMPILE) -DWANT_ISA_EBPFLE $(srcdir)/decode-le.c
+	$(POSTCOMPILE)
 decode-be.o: decode-be.c $(BPF_INCLUDE_DEPS)
-	$(CC) -c $(srcdir)/decode-be.c $(ALL_CFLAGS) -DWANT_ISA_EBPFBE
+	$(COMPILE) -DWANT_ISA_EBPFBE $(srcdir)/decode-be.c
+	$(POSTCOMPILE)
 
-sem-le.o: sem-le.c $(BPF_INCLUDE_DEPS)
-	$(CC) -c $(srcdir)/sem-le.c $(ALL_CFLAGS) -DWANT_ISA_EBPFLE
-sem-be.o: sem-be.c $(BPF_INCLUDE_DEPS)
-	$(CC) -c $(srcdir)/sem-be.c $(ALL_CFLAGS) -DWANT_ISA_EBPFBE
+sem-le.o: sem-le.c
+	$(COMPILE) -DWANT_ISA_EBPFLE $(srcdir)/sem-le.c
+	$(POSTCOMPILE)
+sem-be.o: sem-be.c
+	$(COMPILE) -DWANT_ISA_EBPFBE $(srcdir)/sem-be.c
+	$(POSTCOMPILE)
 
 arch = bpf
 
diff --git a/sim/cr16/Makefile.in b/sim/cr16/Makefile.in
index 7be0537985b..8cfe3ea3b26 100644
--- a/sim/cr16/Makefile.in
+++ b/sim/cr16/Makefile.in
@@ -25,6 +25,8 @@ SIM_OBJS = \
 	simops.o
 SIM_EXTRA_CLEAN = clean-extra
 
+SIM_EXTRA_DEPS = simops.h
+
 INCLUDE = cr16_sim.h $(srcroot)/include/gdb/callback.h targ-vals.h \
 	$(srcroot)/include/gdb/sim-cr16.h
 
@@ -33,8 +35,6 @@ NL_TARGET = -DNL_TARGET_cr16
 
 ## COMMON_POST_CONFIG_FRAG
 
-simops.o: simops.h
-
 simops.h: gencode
 	./gencode -h >$@
 
diff --git a/sim/cris/Makefile.in b/sim/cris/Makefile.in
index f932db28a79..5879cffe80b 100644
--- a/sim/cris/Makefile.in
+++ b/sim/cris/Makefile.in
@@ -47,19 +47,6 @@ NL_TARGET = -DNL_TARGET_cris
 
 arch = cris
 
-sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(sim-core_h) $(sim-options_h)
-
-# Needs CPU-specific knowledge.
-dv-cris.o: dv-cris.c $(SIM_MAIN_DEPS) $(sim-core_h)
-
-# This is the same rule as dv-core.o etc.
-dv-rv.o: dv-rv.c $(hw_main_headers) $(sim_main_headers)
-
-arch.o: arch.c $(SIM_MAIN_DEPS)
-
-traps.o: traps.c targ-vals.h $(SIM_MAIN_DEPS) $(sim-options_h)
-devices.o: devices.c $(SIM_MAIN_DEPS)
-
 # rvdummy is just used for testing.  It does nothing if
 # --enable-sim-hardware isn't active.
 
@@ -78,8 +65,6 @@ CRISV10F_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpuv10.h decodev10.h engv10.h
 
-crisv10f.o: crisv10f.c cris-tmpl.c $(CRISV10F_INCLUDE_DEPS)
-
 # FIXME: What is mono and what does "Use of `mono' is wip" mean (other
 # than the apparent; some "mono" feature is work in progress)?
 mloopv10f.c engv10.h: stamp-v10fmloop
@@ -90,11 +75,6 @@ stamp-v10fmloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
 	$(SHELL) $(srcroot)/move-if-change eng.hin engv10.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloopv10f.c
 	touch stamp-v10fmloop
-mloopv10f.o: mloopv10f.c semcrisv10f-switch.c $(CRISV10F_INCLUDE_DEPS)
-
-cpuv10.o: cpuv10.c $(CRISV10F_INCLUDE_DEPS)
-decodev10.o: decodev10.c $(CRISV10F_INCLUDE_DEPS)
-modelv10.o: modelv10.c $(CRISV10F_INCLUDE_DEPS)
 
 # CRISV32 objs
 
@@ -102,8 +82,6 @@ CRISV32F_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpuv32.h decodev32.h engv32.h
 
-crisv32f.o: crisv32f.c cris-tmpl.c $(CRISV32F_INCLUDE_DEPS)
-
 # FIXME: What is mono and what does "Use of `mono' is wip" mean (other
 # than the apparent; some "mono" feature is work in progress)?
 mloopv32f.c engv32.h: stamp-v32fmloop
@@ -116,11 +94,6 @@ stamp-v32fmloop: stamp-v10fmloop $(srcdir)/../common/genmloop.sh mloop.in Makefi
 	$(SHELL) $(srcroot)/move-if-change eng.hin engv32.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloopv32f.c
 	touch stamp-v32fmloop
-mloopv32f.o: mloopv32f.c semcrisv32f-switch.c $(CRISV32F_INCLUDE_DEPS)
-
-cpuv32.o: cpuv32.c $(CRISV32F_INCLUDE_DEPS)
-decodev32.o: decodev32.c $(CRISV32F_INCLUDE_DEPS)
-modelv32.o: modelv32.c $(CRISV32F_INCLUDE_DEPS)
 
 cris-clean:
 	for v in 10 32; do \
diff --git a/sim/d10v/Makefile.in b/sim/d10v/Makefile.in
index c2907fc5879..13b902dec5d 100644
--- a/sim/d10v/Makefile.in
+++ b/sim/d10v/Makefile.in
@@ -26,6 +26,8 @@ SIM_OBJS = \
 	endian.o
 SIM_EXTRA_CLEAN = clean-extra
 
+SIM_EXTRA_DEPS = simops.h
+
 INCLUDE = d10v_sim.h $(srcroot)/include/gdb/callback.h targ-vals.h endian.c \
 	$(srcroot)/include/gdb/sim-d10v.h
 
@@ -34,8 +36,6 @@ NL_TARGET = -DNL_TARGET_d10v
 
 ## COMMON_POST_CONFIG_FRAG
 
-simops.o: simops.h
-
 simops.h: gencode
 	./gencode -h >$@
 
diff --git a/sim/frv/Makefile.in b/sim/frv/Makefile.in
index 63d18df31b6..0d40a568fdd 100644
--- a/sim/frv/Makefile.in
+++ b/sim/frv/Makefile.in
@@ -47,10 +47,6 @@ NL_TARGET = -DNL_TARGET_frv
 
 arch = frv
 
-arch.o: arch.c $(SIM_MAIN_DEPS)
-
-devices.o: devices.c $(SIM_MAIN_DEPS)
-
 # FRV objs
 
 FRVBF_INCLUDE_DEPS = \
@@ -58,23 +54,6 @@ FRVBF_INCLUDE_DEPS = \
 	$(SIM_EXTRA_DEPS) \
 	cpu.h decode.h eng.h
 
-frv.o: frv.c $(FRVBF_INCLUDE_DEPS)
-traps.o: traps.c $(FRVBF_INCLUDE_DEPS)
-pipeline.o: pipeline.c $(FRVBF_INCLUDE_DEPS)
-interrupts.o: interrupts.c $(FRVBF_INCLUDE_DEPS)
-memory.o: memory.c $(FRVBF_INCLUDE_DEPS)
-cache.o: cache.c $(FRVBF_INCLUDE_DEPS)
-options.o: options.c $(FRVBF_INCLUDE_DEPS)
-reset.o: reset.c $(FRVBF_INCLUDE_DEPS)
-registers.o: registers.c $(FRVBF_INCLUDE_DEPS)
-profile.o: profile.c profile-fr400.h profile-fr500.h profile-fr550.h $(FRVBF_INCLUDE_DEPS)
-profile-fr400.o: profile-fr400.c profile-fr400.h $(FRVBF_INCLUDE_DEPS)
-profile-fr450.o: profile-fr450.c $(FRVBF_INCLUDE_DEPS)
-profile-fr500.o: profile-fr500.c profile-fr500.h $(FRVBF_INCLUDE_DEPS)
-profile-fr550.o: profile-fr550.c profile-fr550.h $(FRVBF_INCLUDE_DEPS)
-sim-if.o: sim-if.c $(FRVBF_INCLUDE_DEPS) $(srcdir)/../common/sim-core.h eng.h
-
-
 # FIXME: Use of `mono' is wip.
 mloop.c eng.h: stamp-mloop
 stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
@@ -84,12 +63,6 @@ stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
 	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
 	touch stamp-mloop
-mloop.o: mloop.c $(FRVBF_INCLUDE_DEPS)
-
-cpu.o: cpu.c $(FRVBF_INCLUDE_DEPS)
-decode.o: decode.c $(FRVBF_INCLUDE_DEPS)
-sem.o: sem.c $(FRVBF_INCLUDE_DEPS)
-model.o: model.c $(FRVBF_INCLUDE_DEPS)
 
 frv-clean:
 	rm -f mloop.c eng.h stamp-mloop
diff --git a/sim/iq2000/Makefile.in b/sim/iq2000/Makefile.in
index f3ab6351b25..18d0715ec59 100644
--- a/sim/iq2000/Makefile.in
+++ b/sim/iq2000/Makefile.in
@@ -41,12 +41,9 @@ SIM_EXTRA_CLEAN = iq2000-clean
 
 arch = iq2000
 
-sim-if.o: $(srcdir)/sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h
-
-arch.o: arch.c $(SIM_MAIN_DEPS)
-	$(CC) -c $(srcdir)/arch.c $(ALL_CFLAGS) -UHAVE_CPU_IQ10BF
-
-devices.o: $(srcdir)/devices.c $(SIM_MAIN_DEPS)
+arch.o: arch.c
+	$(COMPILE) -UHAVE_CPU_IQ10BF $(srcdir)/arch.c
+	$(POSTCOMPILE)
 
 # IQ2000 objs
 
@@ -54,8 +51,6 @@ IQ2000BF_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpu.h decode.h eng.h
 
-iq2000.o: $(srcdir)/iq2000.c $(IQ2000BF_INCLUDE_DEPS)
-
 # FIXME: Use of `mono' is wip.
 mloop.c eng.h: stamp-mloop
 stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
@@ -65,12 +60,6 @@ stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
 	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
 	touch stamp-mloop
-mloop.o: mloop.c $(srcdir)/sem-switch.c $(IQ2000BF_INCLUDE_DEPS)
-
-cpu.o: $(srcdir)/cpu.c $(IQ2000BF_INCLUDE_DEPS)
-decode.o: $(srcdir)/decode.c $(IQ2000BF_INCLUDE_DEPS)
-sem.o: $(srcdir)/sem.c $(IQ2000BF_INCLUDE_DEPS)
-model.o: $(srcdir)/model.c $(IQ2000BF_INCLUDE_DEPS)
 
 iq2000-clean:
 	rm -f mloop.c eng.h stamp-mloop
diff --git a/sim/lm32/Makefile.in b/sim/lm32/Makefile.in
index 6a71aceb45b..834c41150a1 100644
--- a/sim/lm32/Makefile.in
+++ b/sim/lm32/Makefile.in
@@ -28,18 +28,10 @@ NL_TARGET = -DNL_TARGET_lm32
 
 arch = lm32 
 
-arch.o: arch.c $(SIM_MAIN_DEPS)
-
-traps.o: traps.c targ-vals.h $(SIM_MAIN_DEPS)
-
-sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h
-
 LM32BF_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpu.h decode.h eng.h
 
-lm32.o: lm32.c $(LM32BF_INCLUDE_DEPS)
-
 # FIXME: Use of `mono' is wip.
 mloop.c eng.h: stamp-mloop
 stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
@@ -49,12 +41,6 @@ stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
 	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
 	touch stamp-mloop
-mloop.o: mloop.c sem-switch.c 
-
-cpu.o: cpu.c $(LM32BF_INCLUDE_DEPS)
-decode.o: decode.c $(LM32BF_INCLUDE_DEPS)
-sem.o: sem.c $(LM32BF_INCLUDE_DEPS)
-model.o: model.c $(LM32BF_INCLUDE_DEPS)
 
 lm32-clean:
 	rm -f mloop.c eng.h stamp-mloop
diff --git a/sim/m32r/Makefile.in b/sim/m32r/Makefile.in
index 4111c2e17d2..9b24995860d 100644
--- a/sim/m32r/Makefile.in
+++ b/sim/m32r/Makefile.in
@@ -50,22 +50,12 @@ NL_TARGET = -DNL_TARGET_m32r
 
 arch = m32r
 
-sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h
-
-arch.o: arch.c $(SIM_MAIN_DEPS)
-
-traps.o: traps.c targ-vals.h $(SIM_MAIN_DEPS)
-traps-linux.o: traps.c syscall.h targ-vals.h $(SIM_MAIN_DEPS)
-devices.o: devices.c $(SIM_MAIN_DEPS)
-
 # M32R objs
 
 M32RBF_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpu.h decode.h eng.h
 
-m32r.o: m32r.c $(M32RBF_INCLUDE_DEPS)
-
 # FIXME: Use of `mono' is wip.
 mloop.c eng.h: stamp-mloop ; @true
 stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
@@ -75,12 +65,6 @@ stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
 	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
 	touch stamp-mloop
-mloop.o: mloop.c sem-switch.c $(M32RBF_INCLUDE_DEPS)
-
-cpu.o: cpu.c $(M32RBF_INCLUDE_DEPS)
-decode.o: decode.c $(M32RBF_INCLUDE_DEPS)
-sem.o: sem.c $(M32RBF_INCLUDE_DEPS)
-model.o: model.c $(M32RBF_INCLUDE_DEPS)
 
 # M32RX objs
 
@@ -88,8 +72,6 @@ M32RXF_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpux.h decodex.h engx.h
 
-m32rx.o: m32rx.c $(M32RXF_INCLUDE_DEPS)
-
 # FIXME: Use of `mono' is wip.
 mloopx.c engx.h: stamp-xmloop ; @true
 stamp-xmloop: $(srcdir)/../common/genmloop.sh mloopx.in Makefile
@@ -100,12 +82,6 @@ stamp-xmloop: $(srcdir)/../common/genmloop.sh mloopx.in Makefile
 	$(SHELL) $(srcroot)/move-if-change engx.hin engx.h
 	$(SHELL) $(srcroot)/move-if-change mloopx.cin mloopx.c
 	touch stamp-xmloop
-mloopx.o: mloopx.c semx-switch.c $(M32RXF_INCLUDE_DEPS)
-
-cpux.o: cpux.c $(M32RXF_INCLUDE_DEPS)
-decodex.o: decodex.c $(M32RXF_INCLUDE_DEPS)
-semx.o: semx.c $(M32RXF_INCLUDE_DEPS)
-modelx.o: modelx.c $(M32RXF_INCLUDE_DEPS)
 
 # M32R2 objs
 
@@ -113,8 +89,6 @@ M32R2F_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpu2.h decode2.h eng2.h
 
-m32r2.o: m32r2.c $(M32R2F_INCLUDE_DEPS)
-
 # FIXME: Use of `mono' is wip.
 mloop2.c eng2.h: stamp-2mloop ; @true
 stamp-2mloop: $(srcdir)/../common/genmloop.sh mloop2.in Makefile
@@ -126,12 +100,6 @@ stamp-2mloop: $(srcdir)/../common/genmloop.sh mloop2.in Makefile
 	$(SHELL) $(srcroot)/move-if-change mloop2.cin mloop2.c
 	touch stamp-2mloop
 
-mloop2.o: mloop2.c $(srcdir)/sem2-switch.c $(M32R2F_INCLUDE_DEPS)
-cpu2.o: cpu2.c $(M32R2F_INCLUDE_DEPS)
-decode2.o: decode2.c $(M32R2F_INCLUDE_DEPS)
-sem2.o: sem2.c $(M32R2F_INCLUDE_DEPS)
-model2.o: model2.c $(M32R2F_INCLUDE_DEPS)
-
 m32r-clean:
 	rm -f mloop.c eng.h stamp-mloop
 	rm -f mloopx.c engx.h stamp-xmloop
diff --git a/sim/m68hc11/Makefile.in b/sim/m68hc11/Makefile.in
index 9e2248fc638..9ebcf65c629 100644
--- a/sim/m68hc11/Makefile.in
+++ b/sim/m68hc11/Makefile.in
@@ -54,7 +54,5 @@ gencode.o: gencode.c
 gencode: gencode.o
 	$(LINK_FOR_BUILD) $^
 
-interp.o: interp.c $(INCLUDE)
-
 clean-extra:
 	rm -f gencode m68hc11int.c
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index 00906451c4c..c150224041f 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -86,15 +86,6 @@ SIM_EXTRA_LIBS = $(MIPS_EXTRA_LIBS)
 
 ## COMMON_POST_CONFIG_FRAG
 
-interp.o: $(srcdir)/interp.c config.h sim-main.h itable.h
-
-m16run.o: sim-main.h m16_idecode.h m32_idecode.h m16run.c $(SIM_EXTRA_DEPS)
-
-micromipsrun.o: sim-main.h micromips16_idecode.h micromips32_idecode.h \
-		micromips_m32_idecode.h micromipsrun.c $(SIM_EXTRA_DEPS)
-
-multi-run.o: multi-include.h tmp-mach-multi
-
 IGEN_TRACE= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all
 IGEN_INSN=$(srcdir)/mips.igen
 IGEN_DC=$(srcdir)/mips.dc
diff --git a/sim/mn10300/Makefile.in b/sim/mn10300/Makefile.in
index 773b7f9a0c5..b966b07187b 100644
--- a/sim/mn10300/Makefile.in
+++ b/sim/mn10300/Makefile.in
@@ -39,8 +39,6 @@ SIM_EXTRA_CFLAGS = -DPOLL_QUIT_INTERVAL=0x20
 
 ## COMMON_POST_CONFIG_FRAG
 
-idecode.o op_utils.o semantics.o: targ-vals.h
-
 BUILT_SRC_FROM_IGEN = \
 	icache.h \
 	icache.c \
@@ -109,5 +107,3 @@ tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen
 	$(SHELL) $(srcdir)/../../move-if-change tmp-engine.c engine.c
 	$(SHELL) $(srcdir)/../../move-if-change tmp-irun.c irun.c
 	touch tmp-igen
-
-interp.o: interp.c $(INCLUDE)
diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in
index 24625603cb0..649486fd4e1 100644
--- a/sim/or1k/Makefile.in
+++ b/sim/or1k/Makefile.in
@@ -75,16 +75,9 @@ stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
 	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
 	touch stamp-mloop
-mloop.o: mloop.c sem-switch.c $(OR1K32BF_INCLUDE_DEPS)
 or1k.o: or1k.c $(OR1K32BF_INCLUDE_DEPS)
 	$(COMPILE) $<
 	$(POSTCOMPILE)
-arch.o: arch.c $(SIM_MAIN_DEPS)
-cpu.o: cpu.c $(OR1K32BF_INCLUDE_DEPS)
-decode.o: decode.c $(OR1K32BF_INCLUDE_DEPS)
-sem.o: sem.c $(OR1K32BF_INCLUDE_DEPS)
-sem-switch.o: sem-switch.c $(OR1K32BF_INCLUDE_DEPS)
-model.o: model.c $(OR1K32BF_INCLUDE_DEPS)
 
 sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h eng.h
 	$(COMPILE) $<
diff --git a/sim/rx/Makefile.in b/sim/rx/Makefile.in
index 4de062153c7..de5bcfc148b 100644
--- a/sim/rx/Makefile.in
+++ b/sim/rx/Makefile.in
@@ -44,19 +44,3 @@ LIBS = $B/bfd/libbfd.a $B/libiberty/libiberty.a
 ## COMMON_POST_CONFIG_FRAG
 
 arch = rx
-
-err.o : err.h
-fpu.o : cpu.h fpu.h
-gdb-if.o : cpu.h mem.h load.h syscalls.h err.h \
-           $(srcdir)/../../include/gdb/callback.h \
-	   $(srcdir)/../../include/gdb/remote-sim.h \
-	   $(srcdir)/../../include/gdb/signals.h \
-	   $(srcdir)/../../include/gdb/sim-rx.h
-load.o : ../../bfd/bfd.h cpu.h mem.h
-main.o : ../../bfd/bfd.h cpu.h mem.h misc.h load.h trace.h err.h
-mem.o : mem.h cpu.h syscalls.h misc.h err.h
-misc.o : cpu.h misc.h
-reg.o : cpu.h trace.h
-rx.o : $(srcdir)/../../include/opcode/rx.h cpu.h mem.h syscalls.h fpu.h
-syscalls.o : $(srcdir)/../../include/gdb/callback.h cpu.h mem.h syscalls.h syscall.h
-trace.o : ../../bfd/bfd.h $(srcdir)/../../include/dis-asm.h cpu.h mem.h load.h
diff --git a/sim/sh/Makefile.in b/sim/sh/Makefile.in
index 54f1e0ab94b..3910c4f5614 100644
--- a/sim/sh/Makefile.in
+++ b/sim/sh/Makefile.in
@@ -23,11 +23,10 @@ SIM_OBJS = \
 	table.o
 SIM_EXTRA_LIBS = -lm
 SIM_EXTRA_CLEAN = sh-clean
+SIM_EXTRA_DEPS = table.c code.c ppi.c
 
 ## COMMON_POST_CONFIG_FRAG
 
-interp.o: interp.c code.c table.c ppi.c $(srcroot)/include/gdb/sim-sh.h
-
 code.c: gencode
 	./gencode -x >code.c
 #	indent code.c
diff --git a/sim/v850/Makefile.in b/sim/v850/Makefile.in
index 250129c549f..1f9d8c55c37 100644
--- a/sim/v850/Makefile.in
+++ b/sim/v850/Makefile.in
@@ -110,7 +110,3 @@ tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen
 
 clean-extra: clean-igen
 	rm -f table.c simops.h gencode
-
-interp.o: interp.c $(INCLUDE)
-simops.o: simops.c simops.h $(INCLUDE) targ-vals.h
-semantics.o: $(INCLUDE)
-- 
2.26.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 06/10] Remove INCLUDE variable from some sim Makefiles
  2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
                   ` (4 preceding siblings ...)
  2021-04-08 20:33 ` [PATCH 05/10] Remove and modernize dependencies in sim Tom Tromey
@ 2021-04-08 20:33 ` Tom Tromey
  2021-04-09  0:27   ` Mike Frysinger
  2021-04-08 20:33 ` [PATCH 07/10] Remove LIBS from two " Tom Tromey
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-08 20:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

Some Makefiles in sim define INCLUDE but don't use it.  This removes
these instances.

2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (INCLUDE): Remove.

sim/m68hc11/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (INCLUDE): Remove.

sim/mn10300/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (INCLUDE): Remove.

sim/v850/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (INCLUDE): Remove.
---
 sim/bfin/ChangeLog      | 4 ++++
 sim/bfin/Makefile.in    | 2 --
 sim/m68hc11/ChangeLog   | 4 ++++
 sim/m68hc11/Makefile.in | 3 ---
 sim/mn10300/ChangeLog   | 4 ++++
 sim/mn10300/Makefile.in | 2 --
 sim/v850/ChangeLog      | 4 ++++
 sim/v850/Makefile.in    | 2 --
 8 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/sim/bfin/Makefile.in b/sim/bfin/Makefile.in
index 0c3e7551d4f..a5c16764682 100644
--- a/sim/bfin/Makefile.in
+++ b/sim/bfin/Makefile.in
@@ -29,8 +29,6 @@ SIM_OBJS = \
 	machs.o \
 	sim-resume.o
 
-INCLUDE = bfin-sim.h
-
 SIM_EXTRA_CFLAGS = @SDL_CFLAGS@
 SIM_EXTRA_LIBS = @SDL_LIBS@ -lm
 
diff --git a/sim/m68hc11/Makefile.in b/sim/m68hc11/Makefile.in
index 9ebcf65c629..8a044914ed6 100644
--- a/sim/m68hc11/Makefile.in
+++ b/sim/m68hc11/Makefile.in
@@ -36,9 +36,6 @@ SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 \
 		   -DWITH_TARGET_WORD_MSB=31
 SIM_EXTRA_CLEAN = clean-extra
 
-INCLUDE = $(srcdir)/../../include/gdb/callback.h \
-	  interrupts.h sim-main.h
-
 
 ## COMMON_POST_CONFIG_FRAG
 
diff --git a/sim/mn10300/Makefile.in b/sim/mn10300/Makefile.in
index b966b07187b..4b715cb46d6 100644
--- a/sim/mn10300/Makefile.in
+++ b/sim/mn10300/Makefile.in
@@ -32,8 +32,6 @@ SIM_EXTRA_DEPS = mn10300_sim.h itable.h idecode.h
 # Select mn10300 support in nltvals.def.
 NL_TARGET = -DNL_TARGET_mn10300
 
-INCLUDE = mn10300_sim.h $(srcdir)/../../include/gdb/callback.h
-
 # List of extra flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS = -DPOLL_QUIT_INTERVAL=0x20
 
diff --git a/sim/v850/Makefile.in b/sim/v850/Makefile.in
index 1f9d8c55c37..3e1b4054174 100644
--- a/sim/v850/Makefile.in
+++ b/sim/v850/Makefile.in
@@ -35,8 +35,6 @@ SIM_EXTRA_CFLAGS = \
 	-I$(srcdir)/../../newlib/libc/sys/sysnecv850
 SIM_EXTRA_CLEAN = clean-extra
 
-INCLUDE = $(sim_main_headers) $(SIM_EXTRA_DEPS) 
-
 NL_TARGET = -DNL_TARGET_v850
 
 ## COMMON_POST_CONFIG_FRAG
-- 
2.26.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 07/10] Remove LIBS from two sim Makefiles
  2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
                   ` (5 preceding siblings ...)
  2021-04-08 20:33 ` [PATCH 06/10] Remove INCLUDE variable from some sim Makefiles Tom Tromey
@ 2021-04-08 20:33 ` Tom Tromey
  2021-04-09  0:27   ` Mike Frysinger
  2021-04-08 20:33 ` [PATCH 08/10] Define autoconf substitution variables early in Make-common.in Tom Tromey
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-08 20:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

A couple of sim Makefiles define LIBS, but don't use it.  This will
cause problems with a later patch, so remove these variables now.

2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (LIBS): Remove

sim/rx/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (LIBS): Remove.
---
 sim/m32c/ChangeLog   | 4 ++++
 sim/m32c/Makefile.in | 2 --
 sim/rx/ChangeLog     | 4 ++++
 sim/rx/Makefile.in   | 2 --
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/sim/m32c/Makefile.in b/sim/m32c/Makefile.in
index 186c9c063d3..05aa75309fa 100644
--- a/sim/m32c/Makefile.in
+++ b/sim/m32c/Makefile.in
@@ -40,8 +40,6 @@ SIM_OBJS = \
 	trace.o \
 	$(ENDLIST)
 
-LIBS = $B/bfd/libbfd.a $B/libiberty/libiberty.a
-
 ## COMMON_POST_CONFIG_FRAG
 
 arch = m32c
diff --git a/sim/rx/Makefile.in b/sim/rx/Makefile.in
index de5bcfc148b..4008aac2619 100644
--- a/sim/rx/Makefile.in
+++ b/sim/rx/Makefile.in
@@ -39,8 +39,6 @@ SIM_OBJS = \
 	err.o \
 	$(ENDLIST)
 
-LIBS = $B/bfd/libbfd.a $B/libiberty/libiberty.a
-
 ## COMMON_POST_CONFIG_FRAG
 
 arch = rx
-- 
2.26.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 08/10] Define autoconf substitution variables early in Make-common.in
  2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
                   ` (6 preceding siblings ...)
  2021-04-08 20:33 ` [PATCH 07/10] Remove LIBS from two " Tom Tromey
@ 2021-04-08 20:33 ` Tom Tromey
  2021-04-09  0:44   ` Mike Frysinger
  2021-04-08 20:33 ` [PATCH 09/10] Use prologue and epilogue Makefile fragments Tom Tromey
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-08 20:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This hoists any autoconf substitution (like "@var@") to a definition
early in Make-common.in, and changes the uses to refer to the
corresponding Makefile variable.  This will make the coming Makefile
split a bit simpler.

2021-04-08  Tom Tromey  <tom@tromey.com>

	* Make-common.in (DEFS, LIBS, INCINTL, zlibdir)
	(@PLUGINS_TRUE@LIBDL, LIBINTL, LIBINTL_DEP, CGENDIR): Define
	early.
	(CONFIG_CFLAGS, CSEARCH, ZLIB, CONFIG_LIBS): Update.
---
 sim/common/ChangeLog      |  7 +++++++
 sim/common/Make-common.in | 21 +++++++++++++--------
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index c3c5748d061..d76b3a681f6 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -104,6 +104,15 @@ DEPMODE = @CCDEPMODE@
 DEPDIR = @DEPDIR@
 depcomp = $(SHELL) $(srcroot)/depcomp
 
+DEFS = @DEFS@
+LIBS = @LIBS@
+INCINTL = @INCINTL@
+zlibdir = @zlibdir@
+@PLUGINS_TRUE@LIBDL = @lt_cv_dlopen_libs@
+LIBINTL = @LIBINTL@
+LIBINTL_DEP = @LIBINTL_DEP@
+CGENDIR = @cgendir@
+
 # Note that these are overridden by GNU make-specific code below if
 # GNU make is used.  The overrides implement dependency tracking.
 COMPILE.pre = $(CC) $(C_DIALECT)
@@ -215,7 +224,7 @@ CGEN_INCLUDE_DEPS = \
 ## COMMON_POST_CONFIG_FRAG
 
 CONFIG_CFLAGS = \
-	@DEFS@ \
+	$(DEFS) \
 	$(SIM_DEFAULT_MODEL) \
 	$(SIM_ALIGNMENT) \
 	$(SIM_BITSIZE) \
@@ -233,20 +242,17 @@ CSEARCH = -I. -I$(srcdir) -I../common -I$(srccom) \
   -I../../include -I$(srcroot)/include \
   -I../../bfd -I$(srcroot)/bfd \
   -I../../opcodes -I$(srcroot)/opcodes \
-  @INCINTL@
+  $(INCINTL)
 ALL_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(CFLAGS)
 BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH)
 
 COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH)
 
-ZLIB = @zlibdir@ -lz
+ZLIB = $(zlibdir) -lz
 LIBIBERTY_LIB = ../../libiberty/libiberty.a
 BFD_LIB = ../../bfd/libbfd.a
-@PLUGINS_TRUE@LIBDL = @lt_cv_dlopen_libs@
 OPCODES_LIB = ../../opcodes/libopcodes.a
-LIBINTL = @LIBINTL@
-LIBINTL_DEP = @LIBINTL_DEP@
-CONFIG_LIBS = @LIBS@ $(ZLIB)
+CONFIG_LIBS = $(LIBS) $(ZLIB)
 LIBDEPS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL_DEP) $(LIBIBERTY_LIB)
 EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL) $(LIBIBERTY_LIB) \
 	$(CONFIG_LIBS) $(SIM_EXTRA_LIBS) $(LIBDL)
@@ -544,7 +550,6 @@ stamp-h: config.in config.status
 
 # CGEN support
 
-CGENDIR = @cgendir@
 CGEN = "`if [ -f ../../guile/libguile/guile ]; then echo ../../guile/libguile/guile; else echo guile ; fi` -l $(CGENDIR)/guile.scm -s"
 CGENFLAGS = -v
 CGEN_CPU_DIR = $(CGENDIR)/cpu
-- 
2.26.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 09/10] Use prologue and epilogue Makefile fragments
  2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
                   ` (7 preceding siblings ...)
  2021-04-08 20:33 ` [PATCH 08/10] Define autoconf substitution variables early in Make-common.in Tom Tromey
@ 2021-04-08 20:33 ` Tom Tromey
  2021-04-08 20:33 ` [PATCH 10/10] Do not check for sys/time.h or sys/times.h Tom Tromey
  2021-04-09  0:26 ` [PATCH 00/10] sim build improvements Mike Frysinger
  10 siblings, 0 replies; 31+ messages in thread
From: Tom Tromey @ 2021-04-08 20:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

I looked at converting the sim Makefiles to use new-style
config.status invocations, and found that this wasn't really possible
due to the unusual way that the sim constructed Makefile.  This was
done via a sequence of several config.status outputs, with the
intermediate results being removed.

This patch changes the sim to use the GNU make "include" feature
instead.  Variable substitutions are done in a prologue, and each
sim's Makefile is created in the most straightforward way.

2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/arm/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/avr/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/bfin/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/bpf/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/common/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Make-common.in: Remove.
	* epilogue.mk: New file, from Make-common.in.
	(prologue.mk): New target.
	(Makefile, config.status, stamp-h): Use new style.
	(.gdbinit): Likewise; uncomment dependencies.
	* prologue.mk.in: New file, from Make-common.in.

sim/cr16/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/cris/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/d10v/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/erc32/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/example-synacor/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/frv/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/ft32/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/h8300/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/iq2000/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/lm32/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/m32c/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/m32r/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/m68hc11/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/mcore/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/microblaze/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/mips/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/mn10300/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/moxie/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/msp430/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/or1k/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/pru/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/riscv/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/rl78/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/rx/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/sh/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.

sim/v850/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in: Include prologue and epilogue.
	* configure: Rebuild.
---
 sim/aarch64/ChangeLog                      |   5 +
 sim/aarch64/Makefile.in                    |   4 +-
 sim/aarch64/configure                      |  20 +-
 sim/arm/ChangeLog                          |   5 +
 sim/arm/Makefile.in                        |   4 +-
 sim/arm/configure                          |  20 +-
 sim/avr/ChangeLog                          |   5 +
 sim/avr/Makefile.in                        |   4 +-
 sim/avr/configure                          |  20 +-
 sim/bfin/ChangeLog                         |   5 +
 sim/bfin/Makefile.in                       |   4 +-
 sim/bfin/configure                         |  20 +-
 sim/bpf/ChangeLog                          |   5 +
 sim/bpf/Makefile.in                        |   4 +-
 sim/bpf/configure                          |  20 +-
 sim/common/ChangeLog                       |   9 +
 sim/common/{Make-common.in => epilogue.mk} | 229 +--------------------
 sim/common/prologue.mk.in                  | 205 ++++++++++++++++++
 sim/cr16/ChangeLog                         |   5 +
 sim/cr16/Makefile.in                       |   4 +-
 sim/cr16/configure                         |  20 +-
 sim/cris/ChangeLog                         |   5 +
 sim/cris/Makefile.in                       |   4 +-
 sim/cris/configure                         |  20 +-
 sim/d10v/ChangeLog                         |   5 +
 sim/d10v/Makefile.in                       |   4 +-
 sim/d10v/configure                         |  20 +-
 sim/erc32/ChangeLog                        |   5 +
 sim/erc32/Makefile.in                      |   4 +-
 sim/erc32/configure                        |  20 +-
 sim/example-synacor/ChangeLog              |   5 +
 sim/example-synacor/Makefile.in            |   4 +-
 sim/example-synacor/configure              |  20 +-
 sim/frv/ChangeLog                          |   5 +
 sim/frv/Makefile.in                        |   4 +-
 sim/frv/configure                          |  20 +-
 sim/ft32/ChangeLog                         |   5 +
 sim/ft32/Makefile.in                       |   5 +-
 sim/ft32/configure                         |  20 +-
 sim/h8300/ChangeLog                        |   5 +
 sim/h8300/Makefile.in                      |   4 +-
 sim/h8300/configure                        |  20 +-
 sim/iq2000/ChangeLog                       |   5 +
 sim/iq2000/Makefile.in                     |   4 +-
 sim/iq2000/configure                       |  20 +-
 sim/lm32/ChangeLog                         |   5 +
 sim/lm32/Makefile.in                       |   4 +-
 sim/lm32/configure                         |  20 +-
 sim/m32c/ChangeLog                         |   5 +
 sim/m32c/Makefile.in                       |   4 +-
 sim/m32c/configure                         |  20 +-
 sim/m32r/ChangeLog                         |   5 +
 sim/m32r/Makefile.in                       |   4 +-
 sim/m32r/configure                         |  20 +-
 sim/m4/sim_ac_output.m4                    |  14 +-
 sim/m68hc11/ChangeLog                      |   5 +
 sim/m68hc11/Makefile.in                    |   4 +-
 sim/m68hc11/configure                      |  20 +-
 sim/mcore/ChangeLog                        |   5 +
 sim/mcore/Makefile.in                      |   4 +-
 sim/mcore/configure                        |  20 +-
 sim/microblaze/ChangeLog                   |   5 +
 sim/microblaze/Makefile.in                 |   4 +-
 sim/microblaze/configure                   |  20 +-
 sim/mips/ChangeLog                         |   5 +
 sim/mips/Makefile.in                       |   4 +-
 sim/mips/configure                         |  20 +-
 sim/mn10300/ChangeLog                      |   5 +
 sim/mn10300/Makefile.in                    |   4 +-
 sim/mn10300/configure                      |  20 +-
 sim/moxie/ChangeLog                        |   5 +
 sim/moxie/Makefile.in                      |   4 +-
 sim/moxie/configure                        |  20 +-
 sim/msp430/ChangeLog                       |   5 +
 sim/msp430/Makefile.in                     |   4 +-
 sim/msp430/configure                       |  20 +-
 sim/or1k/ChangeLog                         |   5 +
 sim/or1k/Makefile.in                       |   4 +-
 sim/or1k/configure                         |  20 +-
 sim/pru/ChangeLog                          |   5 +
 sim/pru/Makefile.in                        |   5 +-
 sim/pru/configure                          |  20 +-
 sim/riscv/ChangeLog                        |   5 +
 sim/riscv/Makefile.in                      |   5 +-
 sim/riscv/configure                        |  20 +-
 sim/rl78/ChangeLog                         |   5 +
 sim/rl78/Makefile.in                       |   4 +-
 sim/rl78/configure                         |  20 +-
 sim/rx/ChangeLog                           |   5 +
 sim/rx/Makefile.in                         |   4 +-
 sim/rx/configure                           |  20 +-
 sim/sh/ChangeLog                           |   5 +
 sim/sh/Makefile.in                         |   4 +-
 sim/sh/configure                           |  20 +-
 sim/v850/ChangeLog                         |   5 +
 sim/v850/Makefile.in                       |   4 +-
 sim/v850/configure                         |  20 +-
 97 files changed, 570 insertions(+), 789 deletions(-)
 rename sim/common/{Make-common.in => epilogue.mk} (67%)
 create mode 100644 sim/common/prologue.mk.in

diff --git a/sim/aarch64/Makefile.in b/sim/aarch64/Makefile.in
index 4f337003738..0207ac8296b 100644
--- a/sim/aarch64/Makefile.in
+++ b/sim/aarch64/Makefile.in
@@ -19,7 +19,7 @@
 ### You should have received a copy of the GNU General Public License
 ### along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_EXTRA_LIBS = -lm
 
@@ -31,5 +31,5 @@ SIM_OBJS = \
 	memory.o \
 	sim-resume.o \
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
diff --git a/sim/aarch64/configure b/sim/aarch64/configure
index 70c5488a2de..f0883930d3d 100755
--- a/sim/aarch64/configure
+++ b/sim/aarch64/configure
@@ -12027,13 +12027,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13021,10 +13019,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14220,15 +14217,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/arm/Makefile.in b/sim/arm/Makefile.in
index 29166952ce1..f88a6764dad 100644
--- a/sim/arm/Makefile.in
+++ b/sim/arm/Makefile.in
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_EXTRA_CFLAGS = -DMODET
 SIM_EXTRA_LIBS = -lm
@@ -27,7 +27,7 @@ SIM_OBJS = \
 	armvirt.o thumbemu.o \
 	armcopro.o maverick.o iwmmxt.o
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 armemu26.o: armemu.c
 	$(COMPILE) $(srcdir)/armemu.c
diff --git a/sim/arm/configure b/sim/arm/configure
index a73ba1597a8..67168b49e5e 100755
--- a/sim/arm/configure
+++ b/sim/arm/configure
@@ -12023,13 +12023,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13017,10 +13015,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14216,15 +14213,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/avr/Makefile.in b/sim/avr/Makefile.in
index 92d0d88e3f0..525e156fb62 100644
--- a/sim/avr/Makefile.in
+++ b/sim/avr/Makefile.in
@@ -14,11 +14,11 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_OBJS = \
 	interp.o \
 	$(SIM_NEW_COMMON_OBJS) \
 	sim-resume.o
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
diff --git a/sim/avr/configure b/sim/avr/configure
index f492aa553b0..9edf4362082 100755
--- a/sim/avr/configure
+++ b/sim/avr/configure
@@ -12023,13 +12023,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13017,10 +13015,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14216,15 +14213,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/bfin/Makefile.in b/sim/bfin/Makefile.in
index a5c16764682..437699392b4 100644
--- a/sim/bfin/Makefile.in
+++ b/sim/bfin/Makefile.in
@@ -18,7 +18,7 @@
 # This selects the bfin newlib/libgloss syscall definitions.
 NL_TARGET = -DNL_TARGET_bfin
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_OBJS = \
 	$(SIM_NEW_COMMON_OBJS) \
@@ -32,7 +32,7 @@ SIM_OBJS = \
 SIM_EXTRA_CFLAGS = @SDL_CFLAGS@
 SIM_EXTRA_LIBS = @SDL_LIBS@ -lm
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 $(srcdir)/linux-fixed-code.h: @MAINTAINER_MODE_TRUE@ $(srcdir)/linux-fixed-code.s Makefile.in
 	$(AS_FOR_TARGET) $(srcdir)/linux-fixed-code.s -o linux-fixed-code.o
diff --git a/sim/bfin/configure b/sim/bfin/configure
index 49f1c8ba9dd..bb5dc6d1840 100755
--- a/sim/bfin/configure
+++ b/sim/bfin/configure
@@ -12498,13 +12498,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13492,10 +13490,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14691,15 +14688,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/bpf/Makefile.in b/sim/bpf/Makefile.in
index b29b3c02dc0..a52a0354a0e 100644
--- a/sim/bpf/Makefile.in
+++ b/sim/bpf/Makefile.in
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 CGEN_STD_OBJS = cgen-run.o cgen-scache.o cgen-trace.o cgen-utils.o
 BPF_GEN_OBJS = arch.o cpu.o \
@@ -40,7 +40,7 @@ SIM_EXTRA_DEPS = \
 
 SIM_EXTRA_CLEAN = bpf-clean
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 # cgen support, enable with --enable-cgen-maint
 CGEN_MAINT = ; @true
diff --git a/sim/bpf/configure b/sim/bpf/configure
index 76524c23c09..4a8109f1bb6 100755
--- a/sim/bpf/configure
+++ b/sim/bpf/configure
@@ -12160,13 +12160,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13154,10 +13152,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14353,15 +14350,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/common/Make-common.in b/sim/common/epilogue.mk
similarity index 67%
rename from sim/common/Make-common.in
rename to sim/common/epilogue.mk
index d76b3a681f6..a3806cfb993 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/epilogue.mk
@@ -15,213 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# This Makefile fragment consists of two separate parts.
-# They are merged into the final Makefile at points denoted by
-# "## COMMON_PRE_CONFIG_FRAG" and "## COMMON_POST_CONFIG_FRAG".
-#
-# The target Makefile should look like:
-#
-#># Copyright blah blah
-#>
-#>## COMMON_PRE_CONFIG_FRAG
-#>
-#># Any overrides necessary for the SIM_FOO config vars.
-#>SIM_FOO = ...
-#>
-#>## COMMON_POST_CONFIG_FRAG
-#>
-#># Rules to build target specific .o's.
-
-## COMMON_PRE_CONFIG_FRAG
-
-VPATH = @srcdir@:$(srccom)
-srcdir = @srcdir@
-srccom = $(srcdir)/../common
-srcroot = $(srcdir)/../..
-srcsim = $(srcdir)/..
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-host_alias = @host_alias@
-target_alias = @target_alias@
-program_transform_name = @program_transform_name@
-bindir = @bindir@
-
-libdir = @libdir@
-tooldir = $(libdir)/$(target_alias)
-
-datadir = @datadir@
-datarootdir = @datarootdir@
-mandir = @mandir@
-man1dir = $(mandir)/man1
-infodir = @infodir@
-includedir = @includedir@
-
-lt_cv_dlopen_libs = @lt_cv_dlopen_libs@
-# This can be referenced by the gettext configuration code.
-top_builddir = ..
-
-EXEEXT = @EXEEXT@
-SHELL = @SHELL@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-
-CC = @CC@
-C_DIALECT = @C_DIALECT@
-CC_FOR_BUILD = @CC_FOR_BUILD@
-CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-CXXFLAGS = @CXXFLAGS@
-LDFLAGS = @LDFLAGS@
-
-SIM_ALIGNMENT = @sim_alignment@
-SIM_BITSIZE = @sim_bitsize@
-SIM_DEFAULT_MODEL = @sim_default_model@
-SIM_ENDIAN = @sim_endian@
-SIM_FLOAT = @sim_float@
-SIM_HW_CFLAGS = @sim_hw_cflags@
-SIM_HW_OBJS = @sim_hw_objs@
-SIM_HW = @sim_hw@
-SIM_INLINE = @sim_inline@
-SIM_RESERVED_BITS = @sim_reserved_bits@
-SIM_SCACHE = @sim_scache@
-WARN_CFLAGS = @WARN_CFLAGS@
-WERROR_CFLAGS = @WERROR_CFLAGS@
-SIM_WARN_CFLAGS = $(WARN_CFLAGS)
-SIM_WERROR_CFLAGS = $(WERROR_CFLAGS)
-
-AR = @AR@
-AR_FLAGS = rc
-RANLIB = @RANLIB@
-MAKEINFO = makeinfo
-
-# Dependency tracking information.
-DEPMODE = @CCDEPMODE@
-DEPDIR = @DEPDIR@
-depcomp = $(SHELL) $(srcroot)/depcomp
-
-DEFS = @DEFS@
-LIBS = @LIBS@
-INCINTL = @INCINTL@
-zlibdir = @zlibdir@
-@PLUGINS_TRUE@LIBDL = @lt_cv_dlopen_libs@
-LIBINTL = @LIBINTL@
-LIBINTL_DEP = @LIBINTL_DEP@
-CGENDIR = @cgendir@
-
-# Note that these are overridden by GNU make-specific code below if
-# GNU make is used.  The overrides implement dependency tracking.
-COMPILE.pre = $(CC) $(C_DIALECT)
-COMPILE.post = -c -o $@
-COMPILE = $(COMPILE.pre) $(ALL_CFLAGS) $(COMPILE.post)
-POSTCOMPILE = @true
-
-# igen leaks memory, and therefore makes AddressSanitizer unhappy.  Disable
-# leak detection while running it.
-IGEN = ASAN_OPTIONS=detect_leaks=0 ../igen/igen
-
-# Each simulator's Makefile.in defines one or more of these variables
-# to override our settings as necessary.  There is no need to define these
-# in the simulator's Makefile.in if one is using the default value.  In fact
-# it's preferable not to.
-
-# List of object files, less common parts.
-SIM_OBJS =
-# List of extra dependencies.
-# Generally this consists of simulator specific files included by sim-main.h.
-SIM_EXTRA_DEPS =
-# List of flags to always pass to $(CC).
-SIM_EXTRA_CFLAGS =
-# List of extra libraries to link with.
-SIM_EXTRA_LIBS =
-# List of main object files for `run'.
-SIM_RUN_OBJS = nrun.o
-# Dependency of `install' to install any extra files.
-SIM_EXTRA_INSTALL =
-# Dependency of `clean' to clean any extra files.
-SIM_EXTRA_CLEAN =
-# Likewise `distclean'
-SIM_EXTRA_DISTCLEAN =
-
-# Every time a new general purpose source file was added every target's
-# Makefile.in needed to be updated to include the file in SIM_OBJS.
-# This doesn't scale.
-# This variable specifies all the generic stuff common to the newer simulators.
-# Things like sim-reason.o can't go here as the cpu may provide its own
-# (though hopefully in time that won't be so).  Things like sim-bits.o can go
-# here.  Some files are used by all simulators (e.g. callback.o).
-# Those files are specified in LIB_OBJS below.
-
-SIM_COMMON_HW_OBJS = \
-	hw-alloc.o \
-	hw-base.o \
-	hw-device.o \
-	hw-events.o \
-	hw-handles.o \
-	hw-instances.o \
-	hw-ports.o \
-	hw-properties.o \
-	hw-tree.o \
-	sim-hw.o \
-
-SIM_NEW_COMMON_OBJS = \
-	sim-arange.o \
-	sim-bits.o \
-	sim-close.o \
-	sim-command.o \
-	sim-config.o \
-	sim-core.o \
-	sim-cpu.o \
-	sim-endian.o \
-	sim-engine.o \
-	sim-events.o \
-	sim-fpu.o \
-	sim-hload.o \
-	sim-hrw.o \
-	sim-io.o \
-	sim-info.o \
-	sim-load.o \
-	sim-memopt.o \
-	sim-model.o \
-	sim-module.o \
-	sim-options.o \
-	sim-profile.o \
-	sim-reason.o \
-	sim-reg.o \
-	sim-signal.o \
-	sim-stop.o \
-	sim-syscall.o \
-	sim-trace.o \
-	sim-utils.o \
-	sim-watch.o \
-	\
-	$(SIM_HW_OBJS) \
-
-# cgen-sim.h and the headers it includes
-CGEN_SIM_DEPS = \
-	$(srccom)/cgen-sim.h \
-	$(srccom)/cgen-defs.h \
-	$(srccom)/cgen-scache.h \
-	$(srccom)/cgen-fpu.h \
-	$(srccom)/cgen-par.h \
-	$(srccom)/cgen-cpu.h \
-	$(srccom)/cgen-trace.h \
-	cpuall.h
-
-# Add this to SIM_EXTRA_DEPS.
-CGEN_INCLUDE_DEPS = \
-	$(CGEN_SIM_DEPS) \
-	$(srccom)/cgen-engine.h \
-	$(srccom)/cgen-types.h \
-	$(srcdir)/../../include/opcode/cgen.h
-
-## End COMMON_PRE_CONFIG_FRAG
-
-## COMMON_POST_CONFIG_FRAG
+# Epilogue fragment.
 
 CONFIG_CFLAGS = \
 	$(DEFS) \
@@ -445,7 +239,7 @@ endif
 
 # FIXME This is one very simple-minded way of generating the file hw-config.h
 hw-config.h: stamp-hw ; @true
-stamp-hw: Makefile.in $(srccom)/Make-common.in config.status Makefile
+stamp-hw: Makefile.in $(srccom)/prologue.mk.in config.status Makefile
 	rm -f tmp-hw.h
 	echo "/* generated by Makefile */" > tmp-hw.h
 	sim_hw="$(SIM_HW)"; \
@@ -517,9 +311,7 @@ mostlyclean clean: $(SIM_EXTRA_CLEAN)
 	rm -f run$(EXEEXT) libsim.a
 	rm -f hw-config.h stamp-hw
 	rm -f gentmap targ-map.c targ-vals.h stamp-tvals
-	if [ ! -f Make-common.in ] ; then \
-		rm -f $(BUILT_SRC_FROM_COMMON) ; \
-	fi
+	rm -f $(BUILT_SRC_FROM_COMMON)
 	rm -f tmp-mloop.hin tmp-mloop.h tmp-mloop.cin tmp-mloop.c
 
 distclean maintainer-clean realclean: clean $(SIM_EXTRA_DISTCLEAN)
@@ -534,18 +326,21 @@ distclean maintainer-clean realclean: clean $(SIM_EXTRA_DISTCLEAN)
 # Dummy target to force execution of dependent targets.
 force:
 
-Makefile: Makefile.in $(srccom)/Make-common.in config.status
-	CONFIG_HEADERS= $(SHELL) ./config.status
+Makefile: Makefile.in config.status
+	$(SHELL) ./config.status $@
+
+prologue.mk: prologue.mk.in config.status
+	$(SHELL) ./config.status $@
 
 config.status: configure
 	$(SHELL) ./config.status --recheck
 
 config.h: stamp-h ; @true
 stamp-h: config.in config.status
-	CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
+	$(SHELL) ./config.status $@
 
-.gdbinit: # config.status $(srccom)/gdbinit.in
-	CONFIG_FILES=$@:../common/gdbinit.in CONFIG_HEADERS= $(SHELL) ./config.status
+.gdbinit: config.status $(srccom)/gdbinit.in
+	$(SHELL) ./config.status $@
 
 
 # CGEN support
@@ -613,5 +408,3 @@ cgen-desc: force
 		$(CGEN) $(CGENDIR) "$(CGENFLAGS)" \
 		$(arch) "$(FLAGS)" $(cpu) "$(isa)" $(mach) "$(SUFFIX)" \
 		$(archfile) ignored $(opcfile)
-
-## End COMMON_POST_CONFIG_FRAG
diff --git a/sim/common/prologue.mk.in b/sim/common/prologue.mk.in
new file mode 100644
index 00000000000..7a62d053164
--- /dev/null
+++ b/sim/common/prologue.mk.in
@@ -0,0 +1,205 @@
+# Makefile fragment for common parts of all simulators.
+# Copyright 1997-2021 Free Software Foundation, Inc.
+# Contributed by Cygnus Support.
+
+# 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/>.
+
+
+# This Makefile fragment holds variable definitions, and is processed
+# by configure to substitute values.
+
+VPATH = @srcdir@:$(srccom)
+srcdir = @srcdir@
+srccom = $(srcdir)/../common
+srcroot = $(srcdir)/../..
+srcsim = $(srcdir)/..
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+host_alias = @host_alias@
+target_alias = @target_alias@
+program_transform_name = @program_transform_name@
+bindir = @bindir@
+
+libdir = @libdir@
+tooldir = $(libdir)/$(target_alias)
+
+datadir = @datadir@
+datarootdir = @datarootdir@
+mandir = @mandir@
+man1dir = $(mandir)/man1
+infodir = @infodir@
+includedir = @includedir@
+
+lt_cv_dlopen_libs = @lt_cv_dlopen_libs@
+# This can be referenced by the gettext configuration code.
+top_builddir = ..
+
+EXEEXT = @EXEEXT@
+SHELL = @SHELL@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+CC = @CC@
+C_DIALECT = @C_DIALECT@
+CC_FOR_BUILD = @CC_FOR_BUILD@
+CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CXXFLAGS = @CXXFLAGS@
+LDFLAGS = @LDFLAGS@
+
+SIM_ALIGNMENT = @sim_alignment@
+SIM_BITSIZE = @sim_bitsize@
+SIM_DEFAULT_MODEL = @sim_default_model@
+SIM_ENDIAN = @sim_endian@
+SIM_FLOAT = @sim_float@
+SIM_HW_CFLAGS = @sim_hw_cflags@
+SIM_HW_OBJS = @sim_hw_objs@
+SIM_HW = @sim_hw@
+SIM_INLINE = @sim_inline@
+SIM_RESERVED_BITS = @sim_reserved_bits@
+SIM_SCACHE = @sim_scache@
+WARN_CFLAGS = @WARN_CFLAGS@
+WERROR_CFLAGS = @WERROR_CFLAGS@
+SIM_WARN_CFLAGS = $(WARN_CFLAGS)
+SIM_WERROR_CFLAGS = $(WERROR_CFLAGS)
+
+AR = @AR@
+AR_FLAGS = rc
+RANLIB = @RANLIB@
+MAKEINFO = makeinfo
+
+# Dependency tracking information.
+DEPMODE = @CCDEPMODE@
+DEPDIR = @DEPDIR@
+depcomp = $(SHELL) $(srcroot)/depcomp
+
+DEFS = @DEFS@
+LIBS = @LIBS@
+INCINTL = @INCINTL@
+zlibdir = @zlibdir@
+@PLUGINS_TRUE@LIBDL = @lt_cv_dlopen_libs@
+LIBINTL = @LIBINTL@
+LIBINTL_DEP = @LIBINTL_DEP@
+CGENDIR = @cgendir@
+
+# Note that these are overridden by GNU make-specific code below if
+# GNU make is used.  The overrides implement dependency tracking.
+COMPILE.pre = $(CC) $(C_DIALECT)
+COMPILE.post = -c -o $@
+COMPILE = $(COMPILE.pre) $(ALL_CFLAGS) $(COMPILE.post)
+POSTCOMPILE = @true
+
+# igen leaks memory, and therefore makes AddressSanitizer unhappy.  Disable
+# leak detection while running it.
+IGEN = ASAN_OPTIONS=detect_leaks=0 ../igen/igen
+
+# Each simulator's Makefile.in defines one or more of these variables
+# to override our settings as necessary.  There is no need to define these
+# in the simulator's Makefile.in if one is using the default value.  In fact
+# it's preferable not to.
+
+# List of object files, less common parts.
+SIM_OBJS =
+# List of extra dependencies.
+# Generally this consists of simulator specific files included by sim-main.h.
+SIM_EXTRA_DEPS =
+# List of flags to always pass to $(CC).
+SIM_EXTRA_CFLAGS =
+# List of extra libraries to link with.
+SIM_EXTRA_LIBS =
+# List of main object files for `run'.
+SIM_RUN_OBJS = nrun.o
+# Dependency of `install' to install any extra files.
+SIM_EXTRA_INSTALL =
+# Dependency of `clean' to clean any extra files.
+SIM_EXTRA_CLEAN =
+# Likewise `distclean'
+SIM_EXTRA_DISTCLEAN =
+
+# Every time a new general purpose source file was added every target's
+# Makefile.in needed to be updated to include the file in SIM_OBJS.
+# This doesn't scale.
+# This variable specifies all the generic stuff common to the newer simulators.
+# Things like sim-reason.o can't go here as the cpu may provide its own
+# (though hopefully in time that won't be so).  Things like sim-bits.o can go
+# here.  Some files are used by all simulators (e.g. callback.o).
+# Those files are specified in LIB_OBJS below.
+
+SIM_COMMON_HW_OBJS = \
+	hw-alloc.o \
+	hw-base.o \
+	hw-device.o \
+	hw-events.o \
+	hw-handles.o \
+	hw-instances.o \
+	hw-ports.o \
+	hw-properties.o \
+	hw-tree.o \
+	sim-hw.o \
+
+SIM_NEW_COMMON_OBJS = \
+	sim-arange.o \
+	sim-bits.o \
+	sim-close.o \
+	sim-command.o \
+	sim-config.o \
+	sim-core.o \
+	sim-cpu.o \
+	sim-endian.o \
+	sim-engine.o \
+	sim-events.o \
+	sim-fpu.o \
+	sim-hload.o \
+	sim-hrw.o \
+	sim-io.o \
+	sim-info.o \
+	sim-load.o \
+	sim-memopt.o \
+	sim-model.o \
+	sim-module.o \
+	sim-options.o \
+	sim-profile.o \
+	sim-reason.o \
+	sim-reg.o \
+	sim-signal.o \
+	sim-stop.o \
+	sim-syscall.o \
+	sim-trace.o \
+	sim-utils.o \
+	sim-watch.o \
+	\
+	$(SIM_HW_OBJS) \
+
+# cgen-sim.h and the headers it includes
+CGEN_SIM_DEPS = \
+	$(srccom)/cgen-sim.h \
+	$(srccom)/cgen-defs.h \
+	$(srccom)/cgen-scache.h \
+	$(srccom)/cgen-fpu.h \
+	$(srccom)/cgen-par.h \
+	$(srccom)/cgen-cpu.h \
+	$(srccom)/cgen-trace.h \
+	cpuall.h
+
+# Add this to SIM_EXTRA_DEPS.
+CGEN_INCLUDE_DEPS = \
+	$(CGEN_SIM_DEPS) \
+	$(srccom)/cgen-engine.h \
+	$(srccom)/cgen-types.h \
+	$(srcdir)/../../include/opcode/cgen.h
diff --git a/sim/cr16/Makefile.in b/sim/cr16/Makefile.in
index 8cfe3ea3b26..965a4808bf8 100644
--- a/sim/cr16/Makefile.in
+++ b/sim/cr16/Makefile.in
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_OBJS = \
 	$(SIM_NEW_COMMON_OBJS) \
@@ -33,7 +33,7 @@ INCLUDE = cr16_sim.h $(srcroot)/include/gdb/callback.h targ-vals.h \
 # This selects the cr16 newlib/libgloss syscall definitions.
 NL_TARGET = -DNL_TARGET_cr16
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 simops.h: gencode
 	./gencode -h >$@
diff --git a/sim/cr16/configure b/sim/cr16/configure
index 793aff7353d..4fd0a66d9bd 100755
--- a/sim/cr16/configure
+++ b/sim/cr16/configure
@@ -12020,13 +12020,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13014,10 +13012,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14213,15 +14210,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/cris/Makefile.in b/sim/cris/Makefile.in
index 5879cffe80b..2372cc43d00 100644
--- a/sim/cris/Makefile.in
+++ b/sim/cris/Makefile.in
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 CRISV10F_OBJS = crisv10f.o cpuv10.o decodev10.o modelv10.o mloopv10f.o
 CRISV32F_OBJS = crisv32f.o cpuv32.o decodev32.o modelv32.o mloopv32f.o
@@ -43,7 +43,7 @@ SIM_EXTRA_CLEAN = cris-clean
 # This selects the cris newlib/libgloss syscall definitions.
 NL_TARGET = -DNL_TARGET_cris
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 arch = cris
 
diff --git a/sim/cris/configure b/sim/cris/configure
index 56740dabd5d..2fc847262ab 100755
--- a/sim/cris/configure
+++ b/sim/cris/configure
@@ -12226,13 +12226,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13220,10 +13218,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14419,15 +14416,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/d10v/Makefile.in b/sim/d10v/Makefile.in
index 13b902dec5d..00e438de64e 100644
--- a/sim/d10v/Makefile.in
+++ b/sim/d10v/Makefile.in
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_OBJS = \
 	interp.o \
@@ -34,7 +34,7 @@ INCLUDE = d10v_sim.h $(srcroot)/include/gdb/callback.h targ-vals.h endian.c \
 # This selects the d10v newlib/libgloss syscall definitions.
 NL_TARGET = -DNL_TARGET_d10v
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 simops.h: gencode
 	./gencode -h >$@
diff --git a/sim/d10v/configure b/sim/d10v/configure
index 84f33c45134..678560066bd 100755
--- a/sim/d10v/configure
+++ b/sim/d10v/configure
@@ -12020,13 +12020,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13014,10 +13012,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14213,15 +14210,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/erc32/Makefile.in b/sim/erc32/Makefile.in
index 0006922904b..4c95c8acea3 100644
--- a/sim/erc32/Makefile.in
+++ b/sim/erc32/Makefile.in
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 TERMCAP_LIB = @TERMCAP@
 READLINE_LIB = @READLINE@
@@ -32,7 +32,7 @@ SIM_EXTRA_CLEAN = clean-sis
 # behaviour of UART interrupt routines ...
 SIM_EXTRA_CFLAGS = -DFAST_UART -I$(srcroot)
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 # `sis' doesn't need interf.o.
 SIS_OFILES = exec.o erc32.o func.o help.o float.o
diff --git a/sim/erc32/configure b/sim/erc32/configure
index 8729505a5f1..585f20a9e7b 100755
--- a/sim/erc32/configure
+++ b/sim/erc32/configure
@@ -12061,13 +12061,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13055,10 +13053,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14254,15 +14251,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/example-synacor/Makefile.in b/sim/example-synacor/Makefile.in
index edd77ac801e..370ce958133 100644
--- a/sim/example-synacor/Makefile.in
+++ b/sim/example-synacor/Makefile.in
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_OBJS = \
 	$(SIM_NEW_COMMON_OBJS) \
@@ -23,4 +23,4 @@ SIM_OBJS = \
 	interp.o \
 	sim-main.o
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
diff --git a/sim/example-synacor/configure b/sim/example-synacor/configure
index 8e8bdcdbb2d..ed8d85186b1 100755
--- a/sim/example-synacor/configure
+++ b/sim/example-synacor/configure
@@ -12023,13 +12023,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13017,10 +13015,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14216,15 +14213,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/frv/Makefile.in b/sim/frv/Makefile.in
index 0d40a568fdd..e49af930f6d 100644
--- a/sim/frv/Makefile.in
+++ b/sim/frv/Makefile.in
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 FRV_OBJS = frv.o cpu.o decode.o sem.o model.o mloop.o cgen-par.o
 
@@ -43,7 +43,7 @@ SIM_EXTRA_CLEAN = frv-clean
 # This selects the frv newlib/libgloss syscall definitions.
 NL_TARGET = -DNL_TARGET_frv
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 arch = frv
 
diff --git a/sim/frv/configure b/sim/frv/configure
index b55e7ead7cc..e832ca58eb0 100755
--- a/sim/frv/configure
+++ b/sim/frv/configure
@@ -12231,13 +12231,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13225,10 +13223,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14424,15 +14421,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/ft32/Makefile.in b/sim/ft32/Makefile.in
index 0a90c0fe1dd..74895fe4d44 100644
--- a/sim/ft32/Makefile.in
+++ b/sim/ft32/Makefile.in
@@ -15,12 +15,11 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
-
+include prologue.mk
 
 SIM_OBJS = \
 	$(SIM_NEW_COMMON_OBJS) \
 	interp.o	\
 	sim-resume.o
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
diff --git a/sim/ft32/configure b/sim/ft32/configure
index 5dc69fd8d73..ecabbc0d389 100755
--- a/sim/ft32/configure
+++ b/sim/ft32/configure
@@ -12023,13 +12023,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13017,10 +13015,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14216,15 +14213,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/h8300/Makefile.in b/sim/h8300/Makefile.in
index 451c584cd6f..8cd718098d1 100644
--- a/sim/h8300/Makefile.in
+++ b/sim/h8300/Makefile.in
@@ -15,10 +15,10 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_OBJS = compile.o \
 	$(SIM_NEW_COMMON_OBJS) \
 	sim-resume.o
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
diff --git a/sim/h8300/configure b/sim/h8300/configure
index 0d022c6a801..03cac86a569 100755
--- a/sim/h8300/configure
+++ b/sim/h8300/configure
@@ -12033,13 +12033,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13027,10 +13025,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14226,15 +14223,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/iq2000/Makefile.in b/sim/iq2000/Makefile.in
index 18d0715ec59..000082a24e2 100644
--- a/sim/iq2000/Makefile.in
+++ b/sim/iq2000/Makefile.in
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 IQ2000_OBJS = iq2000.o cpu.o decode.o sem.o model.o mloop.o
 
@@ -37,7 +37,7 @@ ALL_CPU_CFLAGS = -DHAVE_CPU_IQ2000BF -DHAVE_CPU_IQ10BF
 
 SIM_EXTRA_CLEAN = iq2000-clean
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 arch = iq2000
 
diff --git a/sim/iq2000/configure b/sim/iq2000/configure
index 2207210db52..a99f4a584b3 100755
--- a/sim/iq2000/configure
+++ b/sim/iq2000/configure
@@ -12210,13 +12210,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13204,10 +13202,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14403,15 +14400,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/lm32/Makefile.in b/sim/lm32/Makefile.in
index 834c41150a1..dcb7f901b85 100644
--- a/sim/lm32/Makefile.in
+++ b/sim/lm32/Makefile.in
@@ -1,7 +1,7 @@
 # Makefile for Lattice Mico32 simulator.
 # Contributed by Jon Beniston <jon@beniston.com>
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 # List of object files, less common parts.
 SIM_OBJS = \
@@ -24,7 +24,7 @@ SIM_EXTRA_CLEAN = lm32-clean
 # This selects the lm32 newlib/libgloss syscall definitions.
 NL_TARGET = -DNL_TARGET_lm32
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 arch = lm32 
 
diff --git a/sim/lm32/configure b/sim/lm32/configure
index 08f0eba9836..5c2a85fed18 100755
--- a/sim/lm32/configure
+++ b/sim/lm32/configure
@@ -12209,13 +12209,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13203,10 +13201,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14402,15 +14399,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/m32c/Makefile.in b/sim/m32c/Makefile.in
index 05aa75309fa..89fefd5e159 100644
--- a/sim/m32c/Makefile.in
+++ b/sim/m32c/Makefile.in
@@ -18,7 +18,7 @@
 ### You should have received a copy of the GNU General Public License
 ### along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_EXTRA_CFLAGS = -Wall -DTIMER_A
 
@@ -40,7 +40,7 @@ SIM_OBJS = \
 	trace.o \
 	$(ENDLIST)
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 arch = m32c
 
diff --git a/sim/m32c/configure b/sim/m32c/configure
index 349101584e0..23c0f44eff3 100755
--- a/sim/m32c/configure
+++ b/sim/m32c/configure
@@ -11936,13 +11936,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -12930,10 +12928,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14129,15 +14126,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/m32r/Makefile.in b/sim/m32r/Makefile.in
index 9b24995860d..6fa8b9a6cb6 100644
--- a/sim/m32r/Makefile.in
+++ b/sim/m32r/Makefile.in
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 M32R_OBJS = m32r.o cpu.o decode.o sem.o model.o mloop.o
 M32RX_OBJS = m32rx.o cpux.o decodex.o modelx.o mloopx.o
@@ -46,7 +46,7 @@ SIM_EXTRA_CLEAN = m32r-clean
 # This selects the m32r newlib/libgloss syscall definitions.
 NL_TARGET = -DNL_TARGET_m32r
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 arch = m32r
 
diff --git a/sim/m32r/configure b/sim/m32r/configure
index 60a0d8eab38..16c98a30eab 100755
--- a/sim/m32r/configure
+++ b/sim/m32r/configure
@@ -12225,13 +12225,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13219,10 +13217,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14418,15 +14415,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/m4/sim_ac_output.m4 b/sim/m4/sim_ac_output.m4
index 9ec566d8acd..5585a8597d5 100644
--- a/sim/m4/sim_ac_output.m4
+++ b/sim/m4/sim_ac_output.m4
@@ -29,19 +29,9 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 AC_SUBST(cgen_breaks)
-AC_CONFIG_FILES(Makefile.sim:Makefile.in)
-AC_CONFIG_FILES(Make-common.sim:../common/Make-common.in)
+AC_CONFIG_FILES(prologue.mk:../common/prologue.mk.in)
 AC_CONFIG_FILES(.gdbinit:../common/gdbinit.in)
-AC_CONFIG_COMMANDS([Makefile],
-[echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
-])
+AC_CONFIG_FILES([Makefile])
 AC_CONFIG_COMMANDS([stamp-h], [echo > stamp-h])
 
 dnl These are unfortunate.  They are conditionally called by other sim macros
diff --git a/sim/m68hc11/Makefile.in b/sim/m68hc11/Makefile.in
index 8a044914ed6..5f857c49ed3 100644
--- a/sim/m68hc11/Makefile.in
+++ b/sim/m68hc11/Makefile.in
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 M68HC11_OBJS = interp.o m68hc11int.o m68hc12int.o \
 		emulos.o interrupts.o m68hc11_sim.o
@@ -37,7 +37,7 @@ SIM_EXTRA_CFLAGS = -DWITH_TARGET_WORD_BITSIZE=32 \
 SIM_EXTRA_CLEAN = clean-extra
 
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 m68hc11int.c: gencode
 	./gencode -m6811 > $@
diff --git a/sim/m68hc11/configure b/sim/m68hc11/configure
index 398dd283617..6dfe9307c3e 100755
--- a/sim/m68hc11/configure
+++ b/sim/m68hc11/configure
@@ -12130,13 +12130,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13124,10 +13122,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14323,15 +14320,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/mcore/Makefile.in b/sim/mcore/Makefile.in
index 45cf634d06a..d2f9d5058d0 100644
--- a/sim/mcore/Makefile.in
+++ b/sim/mcore/Makefile.in
@@ -18,11 +18,11 @@
 # This selects the bfin newlib/libgloss syscall definitions.
 NL_TARGET = -DNL_TARGET_mcore
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_OBJS = \
 	interp.o \
 	$(SIM_NEW_COMMON_OBJS) \
 	sim-resume.o
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
diff --git a/sim/mcore/configure b/sim/mcore/configure
index 84f33c45134..678560066bd 100755
--- a/sim/mcore/configure
+++ b/sim/mcore/configure
@@ -12020,13 +12020,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13014,10 +13012,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14213,15 +14210,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/microblaze/Makefile.in b/sim/microblaze/Makefile.in
index 8f625839723..4183e3155df 100644
--- a/sim/microblaze/Makefile.in
+++ b/sim/microblaze/Makefile.in
@@ -15,11 +15,11 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_OBJS = \
 	interp.o \
 	$(SIM_NEW_COMMON_OBJS) \
 	sim-resume.o
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
diff --git a/sim/microblaze/configure b/sim/microblaze/configure
index a73ba1597a8..67168b49e5e 100755
--- a/sim/microblaze/configure
+++ b/sim/microblaze/configure
@@ -12023,13 +12023,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13017,10 +13015,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14216,15 +14213,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index c150224041f..4ef7fb016b2 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -3,7 +3,7 @@
 
 SHELL = @SHELL@
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 srcdir=@srcdir@
 srcroot=$(srcdir)/../../
@@ -84,7 +84,7 @@ all: $(SIM_@sim_gen@_ALL)
 SIM_EXTRA_LIBS = $(MIPS_EXTRA_LIBS)
 
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 IGEN_TRACE= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all
 IGEN_INSN=$(srcdir)/mips.igen
diff --git a/sim/mips/configure b/sim/mips/configure
index 92d41ece133..c92e174e610 100755
--- a/sim/mips/configure
+++ b/sim/mips/configure
@@ -12949,13 +12949,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13943,10 +13941,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -15142,15 +15139,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/mn10300/Makefile.in b/sim/mn10300/Makefile.in
index 4b715cb46d6..eac566fd326 100644
--- a/sim/mn10300/Makefile.in
+++ b/sim/mn10300/Makefile.in
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 MN10300_OBJS = \
 	itable.o semantics.o idecode.o icache.o engine.o irun.o support.o \
@@ -35,7 +35,7 @@ NL_TARGET = -DNL_TARGET_mn10300
 # List of extra flags to always pass to $(CC).
 SIM_EXTRA_CFLAGS = -DPOLL_QUIT_INTERVAL=0x20
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 BUILT_SRC_FROM_IGEN = \
 	icache.h \
diff --git a/sim/mn10300/configure b/sim/mn10300/configure
index b5a2b6a712a..25b06e4c859 100755
--- a/sim/mn10300/configure
+++ b/sim/mn10300/configure
@@ -12236,13 +12236,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13230,10 +13228,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14429,15 +14426,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/moxie/Makefile.in b/sim/moxie/Makefile.in
index ee513867290..7b53ffc9f04 100644
--- a/sim/moxie/Makefile.in
+++ b/sim/moxie/Makefile.in
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 dtbdir = @datadir@/gdb/dtb
 
@@ -28,7 +28,7 @@ SIM_EXTRA_LIBS = -lm -lz
 SIM_EXTRA_INSTALL = install-dtb
 SIM_EXTRA_CFLAGS = -DDTB="\"$(dtbdir)/moxie-gdb.dtb\""
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 all: moxie-gdb.dtb
 
diff --git a/sim/moxie/configure b/sim/moxie/configure
index 6bf47d4d8a4..fddee7f12ef 100755
--- a/sim/moxie/configure
+++ b/sim/moxie/configure
@@ -12117,13 +12117,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13111,10 +13109,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14310,15 +14307,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/msp430/Makefile.in b/sim/msp430/Makefile.in
index 113f28d3c90..45b7cb94401 100644
--- a/sim/msp430/Makefile.in
+++ b/sim/msp430/Makefile.in
@@ -16,7 +16,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 # These variables are given default values in COMMON_PRE_CONFIG_FRAG.
 # We override the ones we need to here.
@@ -44,7 +44,7 @@ SIM_EXTRA_CLEAN =
 # This selects the MSP430 newlib/libgloss syscall definitions.
 NL_TARGET = -DNL_TARGET_msp430
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 # Rules need to build $(SIM_OBJS), plus whatever else the target wants.
 
diff --git a/sim/msp430/configure b/sim/msp430/configure
index 14abf9a6ef9..5d4ab8a2fc3 100755
--- a/sim/msp430/configure
+++ b/sim/msp430/configure
@@ -12036,13 +12036,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13030,10 +13028,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14229,15 +14226,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in
index 649486fd4e1..c5ca8e9d385 100644
--- a/sim/or1k/Makefile.in
+++ b/sim/or1k/Makefile.in
@@ -16,7 +16,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 OR1K_OBJS = \
 	or1k.o \
@@ -55,7 +55,7 @@ SIM_EXTRA_LIBS = -lm
 
 SIM_EXTRA_CLEAN = or1k-clean
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 arch = or1k
 
diff --git a/sim/or1k/configure b/sim/or1k/configure
index d65e7140e3d..4b4895d413d 100755
--- a/sim/or1k/configure
+++ b/sim/or1k/configure
@@ -12182,13 +12182,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13176,10 +13174,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14375,15 +14372,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/pru/Makefile.in b/sim/pru/Makefile.in
index 7dd79b4bba6..af173e2dd13 100644
--- a/sim/pru/Makefile.in
+++ b/sim/pru/Makefile.in
@@ -17,7 +17,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_OBJS = \
 	$(SIM_NEW_COMMON_OBJS) \
@@ -26,4 +26,5 @@ SIM_OBJS = \
 
 NL_TARGET = -DNL_TARGET_pru
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
+
diff --git a/sim/pru/configure b/sim/pru/configure
index f492aa553b0..9edf4362082 100755
--- a/sim/pru/configure
+++ b/sim/pru/configure
@@ -12023,13 +12023,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13017,10 +13015,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14216,15 +14213,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/riscv/Makefile.in b/sim/riscv/Makefile.in
index 17cb288eba3..ffc1ed95f23 100644
--- a/sim/riscv/Makefile.in
+++ b/sim/riscv/Makefile.in
@@ -18,7 +18,7 @@
 # This selects the newlib/libgloss syscall definitions.
 NL_TARGET = -DNL_TARGET_riscv
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_OBJS = \
 	$(SIM_NEW_COMMON_OBJS) \
@@ -27,4 +27,5 @@ SIM_OBJS = \
 	machs.o \
 	sim-main.o
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
+
diff --git a/sim/riscv/configure b/sim/riscv/configure
index 4b4fc6b8db2..ad35e6347e4 100755
--- a/sim/riscv/configure
+++ b/sim/riscv/configure
@@ -12139,13 +12139,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13133,10 +13131,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14332,15 +14329,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/rl78/Makefile.in b/sim/rl78/Makefile.in
index 675f87be9b9..3c3e20b8bc0 100644
--- a/sim/rl78/Makefile.in
+++ b/sim/rl78/Makefile.in
@@ -18,7 +18,7 @@
 ### You should have received a copy of the GNU General Public License
 ### along with the GNU simulators; if not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_EXTRA_CFLAGS = -Wall
 
@@ -33,7 +33,7 @@ SIM_OBJS = \
 	gdb-if.o \
 	trace.o
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 arch = rl78
 
diff --git a/sim/rl78/configure b/sim/rl78/configure
index e00d20404f3..4ba20b2da8f 100755
--- a/sim/rl78/configure
+++ b/sim/rl78/configure
@@ -11934,13 +11934,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -12928,10 +12926,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14127,15 +14124,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/rx/Makefile.in b/sim/rx/Makefile.in
index 4008aac2619..a8a60375d64 100644
--- a/sim/rx/Makefile.in
+++ b/sim/rx/Makefile.in
@@ -18,7 +18,7 @@
 ### You should have received a copy of the GNU General Public License
 ### along with the GNU simulators; if not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_EXTRA_CFLAGS = -Wall
 
@@ -39,6 +39,6 @@ SIM_OBJS = \
 	err.o \
 	$(ENDLIST)
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 arch = rx
diff --git a/sim/rx/configure b/sim/rx/configure
index 4ad5c706464..b2c1b61046b 100755
--- a/sim/rx/configure
+++ b/sim/rx/configure
@@ -11979,13 +11979,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -12973,10 +12971,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14172,15 +14169,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/sh/Makefile.in b/sim/sh/Makefile.in
index 3910c4f5614..6ac952a7138 100644
--- a/sim/sh/Makefile.in
+++ b/sim/sh/Makefile.in
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_OBJS = \
 	interp.o \
@@ -25,7 +25,7 @@ SIM_EXTRA_LIBS = -lm
 SIM_EXTRA_CLEAN = sh-clean
 SIM_EXTRA_DEPS = table.c code.c ppi.c
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 code.c: gencode
 	./gencode -x >code.c
diff --git a/sim/sh/configure b/sim/sh/configure
index 84f33c45134..678560066bd 100755
--- a/sim/sh/configure
+++ b/sim/sh/configure
@@ -12020,13 +12020,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13014,10 +13012,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14213,15 +14210,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
diff --git a/sim/v850/Makefile.in b/sim/v850/Makefile.in
index 3e1b4054174..24fc3c5b5bd 100644
--- a/sim/v850/Makefile.in
+++ b/sim/v850/Makefile.in
@@ -17,7 +17,7 @@
 
 SHELL = @SHELL@
 
-## COMMON_PRE_CONFIG_FRAG
+include prologue.mk
 
 SIM_OBJS = \
 	$(SIM_NEW_COMMON_OBJS) \
@@ -37,7 +37,7 @@ SIM_EXTRA_CLEAN = clean-extra
 
 NL_TARGET = -DNL_TARGET_v850
 
-## COMMON_POST_CONFIG_FRAG
+include $(srccom)/epilogue.mk
 
 BUILT_SRC_FROM_IGEN = \
 	icache.h \
diff --git a/sim/v850/configure b/sim/v850/configure
index 9176b7ff64c..8663d3d6a76 100755
--- a/sim/v850/configure
+++ b/sim/v850/configure
@@ -12129,13 +12129,11 @@ if grep CGEN_MAINT $srcdir/Makefile.in >/dev/null; then
 cgen_breaks="break cgen_rtx_error";
 fi
 
-ac_config_files="$ac_config_files Makefile.sim:Makefile.in"
-
-ac_config_files="$ac_config_files Make-common.sim:../common/Make-common.in"
+ac_config_files="$ac_config_files prologue.mk:../common/prologue.mk.in"
 
 ac_config_files="$ac_config_files .gdbinit:../common/gdbinit.in"
 
-ac_config_commands="$ac_config_commands Makefile"
+ac_config_files="$ac_config_files Makefile"
 
 ac_config_commands="$ac_config_commands stamp-h"
 
@@ -13123,10 +13121,9 @@ do
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;;
     "depdir") CONFIG_COMMANDS="$CONFIG_COMMANDS depdir" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
-    "Makefile.sim") CONFIG_FILES="$CONFIG_FILES Makefile.sim:Makefile.in" ;;
-    "Make-common.sim") CONFIG_FILES="$CONFIG_FILES Make-common.sim:../common/Make-common.in" ;;
+    "prologue.mk") CONFIG_FILES="$CONFIG_FILES prologue.mk:../common/prologue.mk.in" ;;
     ".gdbinit") CONFIG_FILES="$CONFIG_FILES .gdbinit:../common/gdbinit.in" ;;
-    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -14322,15 +14319,6 @@ _LT_EOF
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
 
- ;;
-    "Makefile":C) echo "Merging Makefile.sim+Make-common.sim into Makefile ..."
- rm -f Makesim1.tmp Makesim2.tmp Makefile
- sed -n -e '/^## COMMON_PRE_/,/^## End COMMON_PRE_/ p' <Make-common.sim >Makesim1.tmp
- sed -n -e '/^## COMMON_POST_/,/^## End COMMON_POST_/ p' <Make-common.sim >Makesim2.tmp
- sed -e '/^## COMMON_PRE_/ r Makesim1.tmp' \
-	-e '/^## COMMON_POST_/ r Makesim2.tmp' \
-	<Makefile.sim >Makefile
- rm -f Makefile.sim Make-common.sim Makesim1.tmp Makesim2.tmp
  ;;
     "stamp-h":C) echo > stamp-h ;;
 
-- 
2.26.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 10/10] Do not check for sys/time.h or sys/times.h
  2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
                   ` (8 preceding siblings ...)
  2021-04-08 20:33 ` [PATCH 09/10] Use prologue and epilogue Makefile fragments Tom Tromey
@ 2021-04-08 20:33 ` Tom Tromey
  2021-04-09  0:35   ` Mike Frysinger
  2021-04-09  0:26 ` [PATCH 00/10] sim build improvements Mike Frysinger
  10 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-08 20:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This updates the sim so that it unconditionally uses sys/time.h.  This
is in agreement with existing code, and a recent change to BFD.

I also think that sys/times.h is never needed by the sim, so this
patch removes the check and the one spot that was conditionally
including it.

This also consolidates the remaining calls to AC_CHECK_HEADERS.  This
saves some space in the generated configure scripts.

2021-04-08  Tom Tromey  <tom@tromey.com>

	* m4/sim_ac_common.m4 (SIM_AC_COMMON): Don't check for sys/time.h
	or sys/times.h.  Consolidate calls to AC_CHECK_HEADERS.

sim/aarch64/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/arm/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/avr/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/bfin/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/bpf/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/common/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* sim-utils.c: Update includes.

sim/cr16/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* simops.c: Update includes.
	* configure, config.in: Rebuild.

sim/cris/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* rvdummy.c: Update includes.
	* dv-rv.c: Update includes.
	* configure, config.in: Rebuild.

sim/d10v/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/erc32/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/example-synacor/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/frv/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/ft32/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/h8300/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/iq2000/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/lm32/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/m32c/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/m32r/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/m68hc11/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/mcore/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/microblaze/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/mips/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/mn10300/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/moxie/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/msp430/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/or1k/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/ppc/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* mon.c: Update includes.
	* emul_unix.c: Update includes.
	(do_unix_gettimeofday): Update condition.
	* configure, config.in: Rebuild.

sim/pru/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/riscv/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/rl78/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/rx/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.

sim/sh/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* interp.c: Update includes.
	* configure, config.in: Rebuild.

sim/v850/ChangeLog
2021-04-08  Tom Tromey  <tom@tromey.com>

	* configure, config.in: Rebuild.
---
 sim/ChangeLog                 |  5 ++++
 sim/aarch64/ChangeLog         |  4 ++++
 sim/aarch64/config.in         |  6 -----
 sim/aarch64/configure         | 44 +++--------------------------------
 sim/arm/ChangeLog             |  4 ++++
 sim/arm/config.in             |  6 -----
 sim/arm/configure             | 44 +++--------------------------------
 sim/avr/ChangeLog             |  4 ++++
 sim/avr/config.in             |  6 -----
 sim/avr/configure             | 44 +++--------------------------------
 sim/bfin/ChangeLog            |  4 ++++
 sim/bfin/config.in            |  6 -----
 sim/bfin/configure            | 44 +++--------------------------------
 sim/bpf/ChangeLog             |  4 ++++
 sim/bpf/config.in             |  6 -----
 sim/bpf/configure             | 44 +++--------------------------------
 sim/common/ChangeLog          |  4 ++++
 sim/common/sim-utils.c        |  2 --
 sim/cr16/ChangeLog            |  5 ++++
 sim/cr16/config.in            |  6 -----
 sim/cr16/configure            | 44 +++--------------------------------
 sim/cr16/simops.c             |  2 --
 sim/cris/ChangeLog            |  6 +++++
 sim/cris/config.in            |  6 -----
 sim/cris/configure            | 44 +++--------------------------------
 sim/cris/dv-rv.c              |  2 --
 sim/cris/rvdummy.c            |  2 --
 sim/d10v/ChangeLog            |  4 ++++
 sim/d10v/config.in            |  6 -----
 sim/d10v/configure            | 44 +++--------------------------------
 sim/erc32/ChangeLog           |  4 ++++
 sim/erc32/config.in           |  6 -----
 sim/erc32/configure           | 44 +++--------------------------------
 sim/example-synacor/ChangeLog |  4 ++++
 sim/example-synacor/config.in |  6 -----
 sim/example-synacor/configure | 44 +++--------------------------------
 sim/frv/ChangeLog             |  4 ++++
 sim/frv/config.in             |  6 -----
 sim/frv/configure             | 44 +++--------------------------------
 sim/ft32/ChangeLog            |  4 ++++
 sim/ft32/config.in            |  6 -----
 sim/ft32/configure            | 44 +++--------------------------------
 sim/h8300/ChangeLog           |  4 ++++
 sim/h8300/config.in           |  6 -----
 sim/h8300/configure           | 44 +++--------------------------------
 sim/iq2000/ChangeLog          |  4 ++++
 sim/iq2000/config.in          |  6 -----
 sim/iq2000/configure          | 44 +++--------------------------------
 sim/lm32/ChangeLog            |  4 ++++
 sim/lm32/config.in            |  6 -----
 sim/lm32/configure            | 44 +++--------------------------------
 sim/m32c/ChangeLog            |  4 ++++
 sim/m32c/config.in            |  6 -----
 sim/m32c/configure            | 44 +++--------------------------------
 sim/m32r/ChangeLog            |  4 ++++
 sim/m32r/config.in            |  6 -----
 sim/m32r/configure            | 44 +++--------------------------------
 sim/m4/sim_ac_common.m4       |  8 +++----
 sim/m68hc11/ChangeLog         |  4 ++++
 sim/m68hc11/config.in         |  6 -----
 sim/m68hc11/configure         | 44 +++--------------------------------
 sim/mcore/ChangeLog           |  4 ++++
 sim/mcore/config.in           |  6 -----
 sim/mcore/configure           | 44 +++--------------------------------
 sim/microblaze/ChangeLog      |  4 ++++
 sim/microblaze/config.in      |  6 -----
 sim/microblaze/configure      | 44 +++--------------------------------
 sim/mips/ChangeLog            |  4 ++++
 sim/mips/config.in            |  6 -----
 sim/mips/configure            | 44 +++--------------------------------
 sim/mn10300/ChangeLog         |  4 ++++
 sim/mn10300/config.in         |  6 -----
 sim/mn10300/configure         | 44 +++--------------------------------
 sim/moxie/ChangeLog           |  4 ++++
 sim/moxie/config.in           |  6 -----
 sim/moxie/configure           | 44 +++--------------------------------
 sim/msp430/ChangeLog          |  4 ++++
 sim/msp430/config.in          |  6 -----
 sim/msp430/configure          | 44 +++--------------------------------
 sim/or1k/ChangeLog            |  4 ++++
 sim/or1k/config.in            |  6 -----
 sim/or1k/configure            | 44 +++--------------------------------
 sim/ppc/ChangeLog             |  7 ++++++
 sim/ppc/emul_unix.c           |  4 +---
 sim/ppc/mon.c                 |  6 -----
 sim/pru/ChangeLog             |  4 ++++
 sim/pru/config.in             |  6 -----
 sim/pru/configure             | 44 +++--------------------------------
 sim/riscv/ChangeLog           |  4 ++++
 sim/riscv/config.in           |  6 -----
 sim/riscv/configure           | 44 +++--------------------------------
 sim/rl78/ChangeLog            |  4 ++++
 sim/rl78/config.in            |  6 -----
 sim/rl78/configure            | 44 +++--------------------------------
 sim/rx/ChangeLog              |  4 ++++
 sim/rx/config.in              |  6 -----
 sim/rx/configure              | 44 +++--------------------------------
 sim/sh/ChangeLog              |  5 ++++
 sim/sh/config.in              |  6 -----
 sim/sh/configure              | 44 +++--------------------------------
 sim/sh/interp.c               |  2 --
 sim/v850/ChangeLog            |  4 ++++
 sim/v850/config.in            |  6 -----
 sim/v850/configure            | 44 +++--------------------------------
 104 files changed, 242 insertions(+), 1480 deletions(-)

diff --git a/sim/aarch64/config.in b/sim/aarch64/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/aarch64/config.in
+++ b/sim/aarch64/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/aarch64/configure b/sim/aarch64/configure
index f0883930d3d..b5210d94573 100755
--- a/sim/aarch64/configure
+++ b/sim/aarch64/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/arm/config.in b/sim/arm/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/arm/config.in
+++ b/sim/arm/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/arm/configure b/sim/arm/configure
index 67168b49e5e..5c53b072d4d 100755
--- a/sim/arm/configure
+++ b/sim/arm/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/avr/config.in b/sim/avr/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/avr/config.in
+++ b/sim/avr/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/avr/configure b/sim/avr/configure
index 9edf4362082..d22a8bdd86e 100755
--- a/sim/avr/configure
+++ b/sim/avr/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/bfin/config.in b/sim/bfin/config.in
index cc4a677d16a..5ccb707f762 100644
--- a/sim/bfin/config.in
+++ b/sim/bfin/config.in
@@ -160,12 +160,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/bfin/configure b/sim/bfin/configure
index bb5dc6d1840..20a27e5f42c 100755
--- a/sim/bfin/configure
+++ b/sim/bfin/configure
@@ -7219,45 +7219,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11194,7 +11156,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11197 "configure"
+#line 11159 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11300,7 +11262,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11303 "configure"
+#line 11265 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/bpf/config.in b/sim/bpf/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/bpf/config.in
+++ b/sim/bpf/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/bpf/configure b/sim/bpf/configure
index 4a8109f1bb6..44e2851203d 100755
--- a/sim/bpf/configure
+++ b/sim/bpf/configure
@@ -7209,45 +7209,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11184,7 +11146,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11187 "configure"
+#line 11149 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11290,7 +11252,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11293 "configure"
+#line 11255 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c
index 69949aa1520..86ab059744c 100644
--- a/sim/common/sim-utils.c
+++ b/sim/common/sim-utils.c
@@ -22,9 +22,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <stdlib.h>
 #include <time.h>
-#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h> /* needed by sys/resource.h */
-#endif
 
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
diff --git a/sim/cr16/config.in b/sim/cr16/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/cr16/config.in
+++ b/sim/cr16/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/cr16/configure b/sim/cr16/configure
index 4fd0a66d9bd..d9626079ee8 100755
--- a/sim/cr16/configure
+++ b/sim/cr16/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/cr16/simops.c b/sim/cr16/simops.c
index f52376237e9..ca96dd07588 100644
--- a/sim/cr16/simops.c
+++ b/sim/cr16/simops.c
@@ -29,9 +29,7 @@
 #endif
 #include <string.h>
 #include <time.h>
-#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
 
 #include "sim-main.h"
 #include "simops.h"
diff --git a/sim/cris/config.in b/sim/cris/config.in
index aa4d64950e9..2e48a348f13 100644
--- a/sim/cris/config.in
+++ b/sim/cris/config.in
@@ -130,12 +130,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/cris/configure b/sim/cris/configure
index 2fc847262ab..2bcbf1651a6 100755
--- a/sim/cris/configure
+++ b/sim/cris/configure
@@ -7210,45 +7210,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11185,7 +11147,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11188 "configure"
+#line 11150 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11291,7 +11253,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11294 "configure"
+#line 11256 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/cris/dv-rv.c b/sim/cris/dv-rv.c
index 612eff4e931..cef164b0983 100644
--- a/sim/cris/dv-rv.c
+++ b/sim/cris/dv-rv.c
@@ -35,9 +35,7 @@
 #include <sys/types.h>
 #endif
 
-#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
 
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
diff --git a/sim/cris/rvdummy.c b/sim/cris/rvdummy.c
index f147ea9e59b..788f8edb504 100644
--- a/sim/cris/rvdummy.c
+++ b/sim/cris/rvdummy.c
@@ -47,9 +47,7 @@ main (int argc, char *argv[])
 #include <sys/types.h>
 #endif
 
-#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
 
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
diff --git a/sim/d10v/config.in b/sim/d10v/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/d10v/config.in
+++ b/sim/d10v/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/d10v/configure b/sim/d10v/configure
index 678560066bd..4ead4f13db9 100755
--- a/sim/d10v/configure
+++ b/sim/d10v/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/erc32/config.in b/sim/erc32/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/erc32/config.in
+++ b/sim/erc32/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/erc32/configure b/sim/erc32/configure
index 585f20a9e7b..d90e18fd7f4 100755
--- a/sim/erc32/configure
+++ b/sim/erc32/configure
@@ -7191,45 +7191,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11166,7 +11128,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11169 "configure"
+#line 11131 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11272,7 +11234,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11275 "configure"
+#line 11237 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/example-synacor/config.in b/sim/example-synacor/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/example-synacor/config.in
+++ b/sim/example-synacor/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/example-synacor/configure b/sim/example-synacor/configure
index ed8d85186b1..e279683763b 100755
--- a/sim/example-synacor/configure
+++ b/sim/example-synacor/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/frv/config.in b/sim/frv/config.in
index c60f7d8649d..8d37b72597d 100644
--- a/sim/frv/config.in
+++ b/sim/frv/config.in
@@ -121,12 +121,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/frv/configure b/sim/frv/configure
index e832ca58eb0..e8775a0255c 100755
--- a/sim/frv/configure
+++ b/sim/frv/configure
@@ -7213,45 +7213,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11188,7 +11150,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11191 "configure"
+#line 11153 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11294,7 +11256,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11297 "configure"
+#line 11259 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/ft32/config.in b/sim/ft32/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/ft32/config.in
+++ b/sim/ft32/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/ft32/configure b/sim/ft32/configure
index ecabbc0d389..b801fdca3cb 100755
--- a/sim/ft32/configure
+++ b/sim/ft32/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/h8300/config.in b/sim/h8300/config.in
index 81502266895..fbed42af1ed 100644
--- a/sim/h8300/config.in
+++ b/sim/h8300/config.in
@@ -118,12 +118,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/h8300/configure b/sim/h8300/configure
index 03cac86a569..a0a68bf1b7e 100755
--- a/sim/h8300/configure
+++ b/sim/h8300/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/iq2000/config.in b/sim/iq2000/config.in
index c60f7d8649d..8d37b72597d 100644
--- a/sim/iq2000/config.in
+++ b/sim/iq2000/config.in
@@ -121,12 +121,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/iq2000/configure b/sim/iq2000/configure
index a99f4a584b3..e5e7526965c 100755
--- a/sim/iq2000/configure
+++ b/sim/iq2000/configure
@@ -7210,45 +7210,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11185,7 +11147,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11188 "configure"
+#line 11150 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11291,7 +11253,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11294 "configure"
+#line 11256 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/lm32/config.in b/sim/lm32/config.in
index c60f7d8649d..8d37b72597d 100644
--- a/sim/lm32/config.in
+++ b/sim/lm32/config.in
@@ -121,12 +121,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/lm32/configure b/sim/lm32/configure
index 5c2a85fed18..bd306fe9594 100755
--- a/sim/lm32/configure
+++ b/sim/lm32/configure
@@ -7210,45 +7210,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11185,7 +11147,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11188 "configure"
+#line 11150 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11291,7 +11253,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11294 "configure"
+#line 11256 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/m32c/config.in b/sim/m32c/config.in
index cae76607786..aaa80a5fa2e 100644
--- a/sim/m32c/config.in
+++ b/sim/m32c/config.in
@@ -127,12 +127,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/m32c/configure b/sim/m32c/configure
index 23c0f44eff3..5c2545e17d5 100755
--- a/sim/m32c/configure
+++ b/sim/m32c/configure
@@ -7189,45 +7189,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11164,7 +11126,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11167 "configure"
+#line 11129 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11270,7 +11232,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11273 "configure"
+#line 11235 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/m32r/config.in b/sim/m32r/config.in
index c60f7d8649d..8d37b72597d 100644
--- a/sim/m32r/config.in
+++ b/sim/m32r/config.in
@@ -121,12 +121,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/m32r/configure b/sim/m32r/configure
index 16c98a30eab..5ba99bc8d28 100755
--- a/sim/m32r/configure
+++ b/sim/m32r/configure
@@ -7212,45 +7212,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11187,7 +11149,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11190 "configure"
+#line 11152 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11293,7 +11255,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11296 "configure"
+#line 11258 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/m4/sim_ac_common.m4 b/sim/m4/sim_ac_common.m4
index 31964bb7165..18c34269eef 100644
--- a/sim/m4/sim_ac_common.m4
+++ b/sim/m4/sim_ac_common.m4
@@ -42,10 +42,10 @@ ZW_GNU_GETTEXT_SISTER_DIR(../../intl)
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-AC_CHECK_HEADERS(unistd.h)
-AC_CHECK_HEADERS(sys/time.h sys/times.h sys/resource.h sys/mman.h)
-AC_CHECK_HEADERS(fcntl.h fpu_control.h)
-AC_CHECK_HEADERS(dlfcn.h sys/stat.h)
+AC_CHECK_HEADERS([unistd.h dnl
+                  sys/resource.h sys/mman.h dnl
+                  fcntl.h fpu_control.h dnl
+                  dlfcn.h sys/stat.h])
 AC_CHECK_FUNCS(getrusage time sigaction __setfpucw)
 AC_CHECK_FUNCS(mmap munmap lstat truncate ftruncate posix_fallocate)
 AC_CHECK_MEMBERS([[struct stat.st_dev], [struct stat.st_ino],
diff --git a/sim/m68hc11/config.in b/sim/m68hc11/config.in
index c60f7d8649d..8d37b72597d 100644
--- a/sim/m68hc11/config.in
+++ b/sim/m68hc11/config.in
@@ -121,12 +121,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/m68hc11/configure b/sim/m68hc11/configure
index 6dfe9307c3e..ccafc3d9ac4 100755
--- a/sim/m68hc11/configure
+++ b/sim/m68hc11/configure
@@ -7199,45 +7199,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11174,7 +11136,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11177 "configure"
+#line 11139 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11280,7 +11242,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11283 "configure"
+#line 11245 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/mcore/config.in b/sim/mcore/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/mcore/config.in
+++ b/sim/mcore/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/mcore/configure b/sim/mcore/configure
index 678560066bd..4ead4f13db9 100755
--- a/sim/mcore/configure
+++ b/sim/mcore/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/microblaze/config.in b/sim/microblaze/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/microblaze/config.in
+++ b/sim/microblaze/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/microblaze/configure b/sim/microblaze/configure
index 67168b49e5e..5c53b072d4d 100755
--- a/sim/microblaze/configure
+++ b/sim/microblaze/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/mips/config.in b/sim/mips/config.in
index 09537fe1ca7..3f13deee8f3 100644
--- a/sim/mips/config.in
+++ b/sim/mips/config.in
@@ -130,12 +130,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/mips/configure b/sim/mips/configure
index c92e174e610..50bdf58d038 100755
--- a/sim/mips/configure
+++ b/sim/mips/configure
@@ -7229,45 +7229,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11204,7 +11166,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11207 "configure"
+#line 11169 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11310,7 +11272,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11313 "configure"
+#line 11275 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/mn10300/config.in b/sim/mn10300/config.in
index c9fb022ca3e..8249d7cbd87 100644
--- a/sim/mn10300/config.in
+++ b/sim/mn10300/config.in
@@ -136,12 +136,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/mn10300/configure b/sim/mn10300/configure
index 25b06e4c859..dfb5821b075 100755
--- a/sim/mn10300/configure
+++ b/sim/mn10300/configure
@@ -7205,45 +7205,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11180,7 +11142,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11183 "configure"
+#line 11145 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11286,7 +11248,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11289 "configure"
+#line 11251 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/moxie/config.in b/sim/moxie/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/moxie/config.in
+++ b/sim/moxie/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/moxie/configure b/sim/moxie/configure
index fddee7f12ef..cad5379cced 100755
--- a/sim/moxie/configure
+++ b/sim/moxie/configure
@@ -7197,45 +7197,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11172,7 +11134,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11175 "configure"
+#line 11137 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11278,7 +11240,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11281 "configure"
+#line 11243 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/msp430/config.in b/sim/msp430/config.in
index e4894c4c510..1bfb7d907d1 100644
--- a/sim/msp430/config.in
+++ b/sim/msp430/config.in
@@ -118,12 +118,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/msp430/configure b/sim/msp430/configure
index 5d4ab8a2fc3..717651655bb 100755
--- a/sim/msp430/configure
+++ b/sim/msp430/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/or1k/config.in b/sim/or1k/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/or1k/config.in
+++ b/sim/or1k/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/or1k/configure b/sim/or1k/configure
index 4b4895d413d..1559b49ee21 100755
--- a/sim/or1k/configure
+++ b/sim/or1k/configure
@@ -7209,45 +7209,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11184,7 +11146,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11187 "configure"
+#line 11149 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11290,7 +11252,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11293 "configure"
+#line 11255 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/ppc/emul_unix.c b/sim/ppc/emul_unix.c
index 92c3c1ededf..fc569d2e1a8 100644
--- a/sim/ppc/emul_unix.c
+++ b/sim/ppc/emul_unix.c
@@ -53,9 +53,7 @@
 #include <sys/param.h>
 #endif
 
-#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
 
 #ifndef HAVE_TERMIOS_STRUCTURE
 #undef HAVE_SYS_TERMIOS_H
@@ -819,7 +817,7 @@ do_unix_time(os_emul_data *emul,
 }
 #endif
 
-#if !defined(HAVE_GETTIMEOFDAY) || !defined(HAVE_SYS_TIME_H)
+#if !defined(HAVE_GETTIMEOFDAY)
 #define do_unix_gettimeofday 0
 #else
 static void
diff --git a/sim/ppc/mon.c b/sim/ppc/mon.c
index 452cd19c3d9..966f86c040e 100644
--- a/sim/ppc/mon.c
+++ b/sim/ppc/mon.c
@@ -35,13 +35,7 @@
 #include <sys/types.h>
 #endif
 #include <time.h>
-#ifdef HAVE_SYS_TIMES_H
-#include <sys/times.h>
-#endif
-
-#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
 
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
diff --git a/sim/pru/config.in b/sim/pru/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/pru/config.in
+++ b/sim/pru/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/pru/configure b/sim/pru/configure
index 9edf4362082..d22a8bdd86e 100755
--- a/sim/pru/configure
+++ b/sim/pru/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/riscv/config.in b/sim/riscv/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/riscv/config.in
+++ b/sim/riscv/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/riscv/configure b/sim/riscv/configure
index ad35e6347e4..2296d81c7f3 100755
--- a/sim/riscv/configure
+++ b/sim/riscv/configure
@@ -7201,45 +7201,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11176,7 +11138,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11179 "configure"
+#line 11141 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11282,7 +11244,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11285 "configure"
+#line 11247 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/rl78/config.in b/sim/rl78/config.in
index e4894c4c510..1bfb7d907d1 100644
--- a/sim/rl78/config.in
+++ b/sim/rl78/config.in
@@ -118,12 +118,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/rl78/configure b/sim/rl78/configure
index 4ba20b2da8f..c1aa0351822 100755
--- a/sim/rl78/configure
+++ b/sim/rl78/configure
@@ -7189,45 +7189,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11164,7 +11126,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11167 "configure"
+#line 11129 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11270,7 +11232,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11273 "configure"
+#line 11235 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/rx/config.in b/sim/rx/config.in
index 97caf8d0532..ed9ee408e3f 100644
--- a/sim/rx/config.in
+++ b/sim/rx/config.in
@@ -124,12 +124,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/rx/configure b/sim/rx/configure
index b2c1b61046b..208a2f0db96 100755
--- a/sim/rx/configure
+++ b/sim/rx/configure
@@ -7194,45 +7194,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11169,7 +11131,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11172 "configure"
+#line 11134 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11275,7 +11237,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11278 "configure"
+#line 11240 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/sh/config.in b/sim/sh/config.in
index cb5ea1b01c9..2416b7f038c 100644
--- a/sim/sh/config.in
+++ b/sim/sh/config.in
@@ -115,12 +115,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/sh/configure b/sim/sh/configure
index 678560066bd..4ead4f13db9 100755
--- a/sim/sh/configure
+++ b/sim/sh/configure
@@ -7196,45 +7196,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11171,7 +11133,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11174 "configure"
+#line 11136 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11277,7 +11239,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11280 "configure"
+#line 11242 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index 872bfe28893..a856ed6aa57 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -43,9 +43,7 @@
 #include <sys/stat.h>
 #endif
 #include <time.h>
-#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
-#endif
 #ifndef _WIN32
 #include <utime.h>
 #include <sys/wait.h>
diff --git a/sim/v850/config.in b/sim/v850/config.in
index 830d22ea322..1eb9e297ca9 100644
--- a/sim/v850/config.in
+++ b/sim/v850/config.in
@@ -130,12 +130,6 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/times.h> header file. */
-#undef HAVE_SYS_TIMES_H
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#undef HAVE_SYS_TIME_H
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
diff --git a/sim/v850/configure b/sim/v850/configure
index 8663d3d6a76..79939e3ce2c 100755
--- a/sim/v850/configure
+++ b/sim/v850/configure
@@ -7202,45 +7202,7 @@ fi
 
 # Check for common headers.
 # NB: You can assume C11 headers exist.
-for ac_header in unistd.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default"
-if test "x$ac_cv_header_unistd_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNISTD_H 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in sys/time.h sys/times.h sys/resource.h sys/mman.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in fcntl.h fpu_control.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-for ac_header in dlfcn.h sys/stat.h
+for ac_header in unistd.h                   sys/resource.h sys/mman.h                   fcntl.h fpu_control.h                   dlfcn.h sys/stat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -11177,7 +11139,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11180 "configure"
+#line 11142 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11283,7 +11245,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11286 "configure"
+#line 11248 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
-- 
2.26.2


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 01/10] Make mostlyclean an alias for clean
  2021-04-08 20:33 ` [PATCH 01/10] Make mostlyclean an alias for clean Tom Tromey
@ 2021-04-09  0:25   ` Mike Frysinger
  0 siblings, 0 replies; 31+ messages in thread
From: Mike Frysinger @ 2021-04-09  0:25 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08 Apr 2021 14:33, Tom Tromey wrote:
> I found out by accident that "mostlyclean" in a sim subdir removes all
> the configure artifacts.  The usual rule is:
> 
> * If the maintainer built it, maintainer-clean should remove it;
> * If configure built it, distclean should remove it;
> * If make built it, "clean" should remove it;
> * If there is a handy subset of "clean" that is "easy" to rebuild,
>   "mostlyclean" should remove it; otherwise mostlyclean should be an
>   alias for clean
> 
> This patch makes mostlyclean an alias for clean.

lgtm, thanks
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 02/10] Introduce stamp file for hw-config.h
  2021-04-08 20:33 ` [PATCH 02/10] Introduce stamp file for hw-config.h Tom Tromey
@ 2021-04-09  0:25   ` Mike Frysinger
  0 siblings, 0 replies; 31+ messages in thread
From: Mike Frysinger @ 2021-04-09  0:25 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08 Apr 2021 14:33, Tom Tromey wrote:
> This adds a stamp file for hw-config.h, to avoid unnecessary rebuilds.
> It also arranges to remove hw-config.h in "mostlyclean", because the
> file is created by "make".

lgtm, thanks
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 03/10] Add stamp files for generated files in sim/ppc
  2021-04-08 20:33 ` [PATCH 03/10] Add stamp files for generated files in sim/ppc Tom Tromey
@ 2021-04-09  0:25   ` Mike Frysinger
  0 siblings, 0 replies; 31+ messages in thread
From: Mike Frysinger @ 2021-04-09  0:25 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08 Apr 2021 14:33, Tom Tromey wrote:
> This changes the sim/ppc Makefile to use the stamp file idiom for a
> couple of generated files, avoiding extra rebuilds.

lgtm, thanks
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/10] sim build improvements
  2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
                   ` (9 preceding siblings ...)
  2021-04-08 20:33 ` [PATCH 10/10] Do not check for sys/time.h or sys/times.h Tom Tromey
@ 2021-04-09  0:26 ` Mike Frysinger
  2021-04-09 17:14   ` Tom Tromey
  10 siblings, 1 reply; 31+ messages in thread
From: Mike Frysinger @ 2021-04-09  0:26 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08 Apr 2021 14:33, Tom Tromey wrote:
> I ran "make distclean" in a sim subdirectory and broke my build tree.
> So, I looked into this failure, and then I found a number of other
> build issues that could be fixed.  This series is the result.
> 
> If you apply this, and once this lands, you'll have to do a clean
> build.

05/10 is missing ?
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 06/10] Remove INCLUDE variable from some sim Makefiles
  2021-04-08 20:33 ` [PATCH 06/10] Remove INCLUDE variable from some sim Makefiles Tom Tromey
@ 2021-04-09  0:27   ` Mike Frysinger
  0 siblings, 0 replies; 31+ messages in thread
From: Mike Frysinger @ 2021-04-09  0:27 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08 Apr 2021 14:33, Tom Tromey wrote:
> Some Makefiles in sim define INCLUDE but don't use it.  This removes
> these instances.

lgtm, thanks
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 07/10] Remove LIBS from two sim Makefiles
  2021-04-08 20:33 ` [PATCH 07/10] Remove LIBS from two " Tom Tromey
@ 2021-04-09  0:27   ` Mike Frysinger
  0 siblings, 0 replies; 31+ messages in thread
From: Mike Frysinger @ 2021-04-09  0:27 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08 Apr 2021 14:33, Tom Tromey wrote:
> A couple of sim Makefiles define LIBS, but don't use it.  This will
> cause problems with a later patch, so remove these variables now.

lgtm, thanks
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 04/10] Require GNU make
  2021-04-08 20:33 ` [PATCH 04/10] Require GNU make Tom Tromey
@ 2021-04-09  0:31   ` Mike Frysinger
  2021-04-09 17:18     ` Tom Tromey
  0 siblings, 1 reply; 31+ messages in thread
From: Mike Frysinger @ 2021-04-09  0:31 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08 Apr 2021 14:33, Tom Tromey wrote:
> GDB has required GNU make for quite some time, and this patch applies
> this approach to the sim as well.  Requiring GNU make means that
> automatic dependency tracking can be simple and reliable, and it also
> makes other refactorings simpler.

i've just been looking at moving these to automake and not worrying about
the quality of the existing Makefiles.  although i'm not ready just yet to
move these ports over.

that said, this will all get deleted eventually anyways, so if you want to
merge this, go for it.
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 10/10] Do not check for sys/time.h or sys/times.h
  2021-04-08 20:33 ` [PATCH 10/10] Do not check for sys/time.h or sys/times.h Tom Tromey
@ 2021-04-09  0:35   ` Mike Frysinger
  2021-04-09 17:18     ` Tom Tromey
  0 siblings, 1 reply; 31+ messages in thread
From: Mike Frysinger @ 2021-04-09  0:35 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08 Apr 2021 14:33, Tom Tromey wrote:
> --- a/sim/m4/sim_ac_common.m4
> +++ b/sim/m4/sim_ac_common.m4
>
> +AC_CHECK_HEADERS([unistd.h dnl
> +                  sys/resource.h sys/mman.h dnl
> +                  fcntl.h fpu_control.h dnl
> +                  dlfcn.h sys/stat.h])

is this a standard pattern ?  in other projects i tend to write:
AC_CHECK_HEADERS(m4_flatten([
  ...headers...
])

no need for the inline dnl's.

should also sort the headers while you're here i guess.

otherwise patch looks fine.
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 08/10] Define autoconf substitution variables early in Make-common.in
  2021-04-08 20:33 ` [PATCH 08/10] Define autoconf substitution variables early in Make-common.in Tom Tromey
@ 2021-04-09  0:44   ` Mike Frysinger
  0 siblings, 0 replies; 31+ messages in thread
From: Mike Frysinger @ 2021-04-09  0:44 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08 Apr 2021 14:33, Tom Tromey wrote:
> This hoists any autoconf substitution (like "@var@") to a definition
> early in Make-common.in, and changes the uses to refer to the
> corresponding Makefile variable.  This will make the coming Makefile
> split a bit simpler.

*shrug* looks fine
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/10] sim build improvements
  2021-04-09  0:26 ` [PATCH 00/10] sim build improvements Mike Frysinger
@ 2021-04-09 17:14   ` Tom Tromey
  2021-04-09 22:27     ` Mike Frysinger
  0 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-09 17:14 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

Mike> 05/10 is missing ?

It came through at least to the archives:

https://sourceware.org/pipermail/gdb-patches/2021-April/177613.html

This one requires a couple of minor tweaks that I found when doing some
more builds with different -j values.

Tom

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 04/10] Require GNU make
  2021-04-09  0:31   ` Mike Frysinger
@ 2021-04-09 17:18     ` Tom Tromey
  2021-04-09 22:45       ` Mike Frysinger
  0 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-09 17:18 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

Mike> i've just been looking at moving these to automake and not worrying about
Mike> the quality of the existing Makefiles.  although i'm not ready just yet to
Mike> move these ports over.

You may have difficulty with this because automake doesn't handle the
build/host distinction very well.  Like, there's no canned way AFAIK to
say that a given executable should be built for one or the other.

I tend to think it would be simpler to just reimplement the bits you
need.  Once you can rely on GNU make this kind of thing is pretty easy,
and less opaque than automake.

However, don't let me stand in your way.  And, I'm definitely in favor
of removing all the subdir configure scripts.

Tom

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 10/10] Do not check for sys/time.h or sys/times.h
  2021-04-09  0:35   ` Mike Frysinger
@ 2021-04-09 17:18     ` Tom Tromey
  0 siblings, 0 replies; 31+ messages in thread
From: Tom Tromey @ 2021-04-09 17:18 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

>>>>> "Mike" == Mike Frysinger <vapier@gentoo.org> writes:

Mike> On 08 Apr 2021 14:33, Tom Tromey wrote:
>> --- a/sim/m4/sim_ac_common.m4
>> +++ b/sim/m4/sim_ac_common.m4
>> 
>> +AC_CHECK_HEADERS([unistd.h dnl
>> +                  sys/resource.h sys/mman.h dnl
>> +                  fcntl.h fpu_control.h dnl
>> +                  dlfcn.h sys/stat.h])

Mike> is this a standard pattern ?

I didn't invent it but I don't really know I guess.

Mike>  in other projects i tend to write:
Mike> AC_CHECK_HEADERS(m4_flatten([
Mike>   ...headers...
Mike> ])

Mike> no need for the inline dnl's.

I can do that.  I didn't know about m4_flatten.

Mike> should also sort the headers while you're here i guess.

Will do.

Tom

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/10] sim build improvements
  2021-04-09 17:14   ` Tom Tromey
@ 2021-04-09 22:27     ` Mike Frysinger
  0 siblings, 0 replies; 31+ messages in thread
From: Mike Frysinger @ 2021-04-09 22:27 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 09 Apr 2021 11:14, Tom Tromey wrote:
> Mike> 05/10 is missing ?
> 
> It came through at least to the archives:
> 
> https://sourceware.org/pipermail/gdb-patches/2021-April/177613.html

ugh, thanks, stupid spam filter
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 04/10] Require GNU make
  2021-04-09 17:18     ` Tom Tromey
@ 2021-04-09 22:45       ` Mike Frysinger
  2021-04-21 23:14         ` Tom Tromey
  0 siblings, 1 reply; 31+ messages in thread
From: Mike Frysinger @ 2021-04-09 22:45 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 09 Apr 2021 11:18, Tom Tromey wrote:
> Mike> i've just been looking at moving these to automake and not worrying about
> Mike> the quality of the existing Makefiles.  although i'm not ready just yet to
> Mike> move these ports over.
> 
> You may have difficulty with this because automake doesn't handle the
> build/host distinction very well.  Like, there's no canned way AFAIK to
> say that a given executable should be built for one or the other.
> 
> I tend to think it would be simpler to just reimplement the bits you
> need.  Once you can rely on GNU make this kind of thing is pretty easy,
> and less opaque than automake.
> 
> However, don't let me stand in your way.  And, I'm definitely in favor
> of removing all the subdir configure scripts.

you're not wrong, but i don't think it's any worse than plain make.  i'm
not plain make would be better either.  we're using non-recursive make :).

check out igen/local.mk and the testsuite/ ones too.
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 05/10] Remove and modernize dependencies in sim
  2021-04-08 20:33 ` [PATCH 05/10] Remove and modernize dependencies in sim Tom Tromey
@ 2021-04-11 17:50   ` Mike Frysinger
  2021-04-22 14:15     ` Tom Tromey
  0 siblings, 1 reply; 31+ messages in thread
From: Mike Frysinger @ 2021-04-11 17:50 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 08 Apr 2021 14:33, Tom Tromey wrote:
> Some spots in the sim build used manual dependencies, and some spots
> did a compilation by hand but did not use the automatic dependency
> tracking code.  This patch fixes these spots.
> 
> I didn't touch ppc, because it doesn't use the common Makefile code.
> I also didn't touch objects that are for the build machine, because
> automatic dependencies don't work for those.

lgtm, thanks
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 04/10] Require GNU make
  2021-04-09 22:45       ` Mike Frysinger
@ 2021-04-21 23:14         ` Tom Tromey
  2021-04-22  3:17           ` Mike Frysinger
  0 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-21 23:14 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

>>>>> "Mike" == Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org> writes:

Mike> you're not wrong, but i don't think it's any worse than plain make.  i'm
Mike> not plain make would be better either.  we're using non-recursive make :).

Yeah, a non-recursive build would definitely be better.  Given that this
is the goal, I'm thinking I may drop some of this series.  I guess I
would keep patch #1-#7 (some are a different direction from Automake,
but improve things in an updateable way in the meantime), drop #8 and #9
(which split up Make-common.in, probably just making things harder), and
keep #10 (remove some configure checks).

Let me know if that sounds OK to you.

Tom

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 04/10] Require GNU make
  2021-04-21 23:14         ` Tom Tromey
@ 2021-04-22  3:17           ` Mike Frysinger
  2021-04-22 14:14             ` Tom Tromey
  0 siblings, 1 reply; 31+ messages in thread
From: Mike Frysinger @ 2021-04-22  3:17 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 21 Apr 2021 17:14, Tom Tromey wrote:
> >>>>> "Mike" == Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Mike> you're not wrong, but i don't think it's any worse than plain make.  i'm
> Mike> not plain make would be better either.  we're using non-recursive make :).
> 
> Yeah, a non-recursive build would definitely be better.  Given that this
> is the goal, I'm thinking I may drop some of this series.  I guess I
> would keep patch #1-#7 (some are a different direction from Automake,
> but improve things in an updateable way in the meantime), drop #8 and #9
> (which split up Make-common.in, probably just making things harder), and
> keep #10 (remove some configure checks).
> 
> Let me know if that sounds OK to you.

sure, sgtm.  i'm not anti-iterating on the current common/Make-common.in stuff
if you want, i'm just trying to minimize my own contributions in that space
until i can nuke it entirely :).
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 04/10] Require GNU make
  2021-04-22  3:17           ` Mike Frysinger
@ 2021-04-22 14:14             ` Tom Tromey
  0 siblings, 0 replies; 31+ messages in thread
From: Tom Tromey @ 2021-04-22 14:14 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

Mike> sure, sgtm.  i'm not anti-iterating on the current common/Make-common.in stuff
Mike> if you want, i'm just trying to minimize my own contributions in that space
Mike> until i can nuke it entirely :).

Yeah, understood.  I just thought those two patches would make the
future transition a bit harder, instead of easier.

I did update one patch to fix some dependency issues.  This will also be
useful for the Automake transition, because it shows what BUILT_SOURCES
will need to be.  I'll send this as a follow-up elsewhere in the thread.

Tom

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 05/10] Remove and modernize dependencies in sim
  2021-04-11 17:50   ` Mike Frysinger
@ 2021-04-22 14:15     ` Tom Tromey
  2021-04-23  0:44       ` Mike Frysinger
  0 siblings, 1 reply; 31+ messages in thread
From: Tom Tromey @ 2021-04-22 14:15 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

>>>>> "Mike" == Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org> writes:

Mike> On 08 Apr 2021 14:33, Tom Tromey wrote:
>> Some spots in the sim build used manual dependencies, and some spots
>> did a compilation by hand but did not use the automatic dependency
>> tracking code.  This patch fixes these spots.
>> 
>> I didn't touch ppc, because it doesn't use the common Makefile code.
>> I also didn't touch objects that are for the build machine, because
>> automatic dependencies don't work for those.

Mike> lgtm, thanks

This one needed some updates to ensure that built headers are in fact
built before objects that use them.

I think it's straightforward, but sending FAOD.

thanks,
Tom

commit 0c0458672cc4c97473126484d73b4e567d86eb66
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Apr 22 07:27:43 2021 -0600

    Remove and modernize dependencies in sim
    
    Some spots in the sim build used manual dependencies, and some spots
    did a compilation by hand but did not use the automatic dependency
    tracking code.  This patch fixes these spots.
    
    I didn't touch ppc, because it doesn't use the common Makefile code.
    I also didn't touch objects that are for the build machine, because
    automatic dependencies don't work for those.
    
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (armemu26.o, armemu32.o): Use COMPILE and
            POSTCOMPILE.
    
    sim/bpf/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (arch.o, cpu.o, sim-if.o, traps.o): Remove.
            (mloop-le.o, mloop-be.o, decode-le.o, decode-be.o, sim-le.o)
            (sim-be.o): Use COMPILE and POSTCOMPILE.
            (SIM_EXTRA_DEPS): Add eng-le.h, eng-be.h.
    
    sim/cr16/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (SIM_EXTRA_DEPS): New variable.
            (simops.o): Remove.
    
    sim/cris/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (sim-if.o, dv-cris.o, dv-rv.o, arch.o, traps.o)
            (devices.o, crisv10f.o, mloopv10f.o, cpuv10.o, decodev10.o)
            (modelv10.o, crisv32f.o, mloopv32f.o, cpuv32.o, decodev32.o)
            (modelv32.o): Remove.
            (SIM_EXTRA_DEPS): Add engv10.h.
    
    sim/d10v/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (SIM_EXTRA_DEPS): New variable.
            (simops.o): Remove.
    
    sim/frv/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (arch.o, devices.o, frv.o, traps.o, pipeline.o)
            (interrupts.o, memory.o, cache.o, options.o, reset.o)
            (registers.o, profile.o, profile-fr400.o, profile-fr450.o)
            (profile-fr500.o, profile-fr550.o, sim-if.o, mloop.o, cpu.o)
            (decode.o, sem.o, model.o): Remove.
            (SIM_EXTRA_DEPS): Add eng.h.
    
    sim/iq2000/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (sim-if.o): Remove.
            (arch.o): Use COMPILE and POSTCOMPILE.
            (devices.o, iq2000.o, mloop.o, cpu.o, decode.o, sem.o, model.o):
            Remove.
            (SIM_EXTRA_DEPS): Add eng.h.
    
    sim/lm32/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (arch.o, traps.o, sim-if.o, lm32.o, mloop.o)
            (cpu.o, decode.o, sem.o, model.o): Remove.
            (SIM_EXTRA_DEPS): Add eng.h.
    
    sim/m32r/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (sim-if.o, arch.o, traps.o, traps-linux.o)
            (devices.o, m32r.o, mloop.o, cpu.o, decode.o, sem.o, model.o)
            (m32rx.o, mloopx.o, cpux.o, decodex.o, semx.o, modelx.o)
            (m32r2.o, mloop2.o, cpu2.o, decode2.o, sem2.o, model2.o): Remove.
            (SIM_EXTRA_DEPS): Add eng.h, engx.h, eng2.h.
    
    sim/m68hc11/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (interp.o): Remove.
    
    sim/mips/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (interp.o, m16run.o, micromipsrun.o, multi-run.o):
            Remove.
            (SIM_EXTRA_DEPS): New variable.
    
    sim/mn10300/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (interp.o): Remove.
            (idecode.o op_utils.o semantics.o): Remove.
    
    sim/or1k/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (mloop.o, arch.o, cpu.o, decode.o, sem.o)
            (sem-switch.o, model.o): Remove.
    
    sim/rl78/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (err.o, fpu.o, gdb-if.o, load.o, main.o, mem.o)
            (reg.o, rl78.o): Remove.
    
    sim/rx/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (err.o, fpu.o, gdb-if.o, load.o, main.o, mem.o)
            (misc.o, reg.o, rx.o, syscalls.o, trace.o): Remove.
    
    sim/sh/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (SIM_EXTRA_DEPS): New variable.
            (interp.o): Remove.
    
    sim/v850/ChangeLog
    2021-04-22  Tom Tromey  <tom@tromey.com>
    
            * Makefile.in (interp.o, simops.o, semantics.o): Remove.

diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog
index 35953e4678a..a607c356b67 100644
--- a/sim/arm/ChangeLog
+++ b/sim/arm/ChangeLog
@@ -1,3 +1,8 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (armemu26.o, armemu32.o): Use COMPILE and
+	POSTCOMPILE.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/arm/Makefile.in b/sim/arm/Makefile.in
index ff8beb5ce34..29166952ce1 100644
--- a/sim/arm/Makefile.in
+++ b/sim/arm/Makefile.in
@@ -29,8 +29,10 @@ SIM_OBJS = \
 
 ## COMMON_POST_CONFIG_FRAG
 
-armemu26.o: armemu.c armdefs.h armemu.h
-	$(CC) -c $(srcdir)/armemu.c -o armemu26.o $(ALL_CFLAGS)
+armemu26.o: armemu.c
+	$(COMPILE) $(srcdir)/armemu.c
+	$(POSTCOMPILE)
 
-armemu32.o: armemu.c armdefs.h armemu.h
-	$(CC) -c $(srcdir)/armemu.c -o armemu32.o -DMODE32 $(ALL_CFLAGS)
+armemu32.o: armemu.c
+	$(COMPILE) -DMODE32 $(srcdir)/armemu.c
+	$(POSTCOMPILE)
diff --git a/sim/bpf/ChangeLog b/sim/bpf/ChangeLog
index 0509ae55c85..47fb5a796bd 100644
--- a/sim/bpf/ChangeLog
+++ b/sim/bpf/ChangeLog
@@ -1,3 +1,10 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (arch.o, cpu.o, sim-if.o, traps.o): Remove.
+	(mloop-le.o, mloop-be.o, decode-le.o, decode-be.o, sim-le.o)
+	(sim-be.o): Use COMPILE and POSTCOMPILE.
+	(SIM_EXTRA_DEPS): Add eng-le.h, eng-be.h.
+
 2021-04-21  Mike Frysinger  <vapier@gentoo.org>
 
 	* aclocal.m4: Regenerate.
diff --git a/sim/bpf/Makefile.in b/sim/bpf/Makefile.in
index 8052a900713..abc89fec390 100644
--- a/sim/bpf/Makefile.in
+++ b/sim/bpf/Makefile.in
@@ -35,6 +35,7 @@ SIM_EXTRA_DEPS = \
 	$(CGEN_INCLUDE_DEPS) \
 	arch.h \
 	bpf-sim.h \
+	eng-le.h eng-be.h \
 	$(srcdir)/../../opcodes/bpf-desc.h \
 	$(srcdir)/../../opcodes/bpf-opc.h
 
@@ -60,33 +61,26 @@ BPF_INCLUDE_DEPS = \
 
 # Dependencies for binaries from CGEN generated source
 
-arch.o: arch.c $(SIM_MAIN_DEPS)
-cpu.o: cpu.c $(BPF_INCLUDE_DEPS)
-decode-le.o: decode-le.c $(BPF_INCLUDE_DEPS)
-decode-be.o: decode-be.c $(BPF_INCLUDE_DEPS)
-
-sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h eng.h
-	$(COMPILE) $<
+mloop-le.o: mloop-le.c
+	$(COMPILE) -DWANT_ISA_EBPFLE mloop-le.c
 	$(POSTCOMPILE)
-
-traps.o: traps.c $(SIM_MAIN_DEPS) eng.h
-	$(COMPILE) $<
+mloop-be.o: mloop-be.c
+	$(COMPILE) -DWANT_ISA_EBPFBE mloop-be.c
 	$(POSTCOMPILE)
 
-mloop-le.o: mloop-le.c $(BPF_INCLUDE_DEPS)
-	$(CC) -c mloop-le.c $(ALL_CFLAGS) -DWANT_ISA_EBPFLE
-mloop-be.o: mloop-be.c $(BPF_INCLUDE_DEPS)
-	$(CC) -c mloop-be.c $(ALL_CFLAGS) -DWANT_ISA_EBPFBE
-
-decode-le.o: decode-le.c $(BPF_INCLUDE_DEPS)
-	$(CC) -c $(srcdir)/decode-le.c $(ALL_CFLAGS) -DWANT_ISA_EBPFLE
+decode-le.o: decode-le.c
+	$(COMPILE) -DWANT_ISA_EBPFLE $(srcdir)/decode-le.c
+	$(POSTCOMPILE)
 decode-be.o: decode-be.c $(BPF_INCLUDE_DEPS)
-	$(CC) -c $(srcdir)/decode-be.c $(ALL_CFLAGS) -DWANT_ISA_EBPFBE
+	$(COMPILE) -DWANT_ISA_EBPFBE $(srcdir)/decode-be.c
+	$(POSTCOMPILE)
 
-sem-le.o: sem-le.c $(BPF_INCLUDE_DEPS)
-	$(CC) -c $(srcdir)/sem-le.c $(ALL_CFLAGS) -DWANT_ISA_EBPFLE
-sem-be.o: sem-be.c $(BPF_INCLUDE_DEPS)
-	$(CC) -c $(srcdir)/sem-be.c $(ALL_CFLAGS) -DWANT_ISA_EBPFBE
+sem-le.o: sem-le.c
+	$(COMPILE) -DWANT_ISA_EBPFLE $(srcdir)/sem-le.c
+	$(POSTCOMPILE)
+sem-be.o: sem-be.c
+	$(COMPILE) -DWANT_ISA_EBPFBE $(srcdir)/sem-be.c
+	$(POSTCOMPILE)
 
 arch = bpf
 
diff --git a/sim/cr16/ChangeLog b/sim/cr16/ChangeLog
index 42c3d4c5ba7..0fe6add6780 100644
--- a/sim/cr16/ChangeLog
+++ b/sim/cr16/ChangeLog
@@ -1,3 +1,8 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (SIM_EXTRA_DEPS): New variable.
+	(simops.o): Remove.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/cr16/Makefile.in b/sim/cr16/Makefile.in
index 7be0537985b..8cfe3ea3b26 100644
--- a/sim/cr16/Makefile.in
+++ b/sim/cr16/Makefile.in
@@ -25,6 +25,8 @@ SIM_OBJS = \
 	simops.o
 SIM_EXTRA_CLEAN = clean-extra
 
+SIM_EXTRA_DEPS = simops.h
+
 INCLUDE = cr16_sim.h $(srcroot)/include/gdb/callback.h targ-vals.h \
 	$(srcroot)/include/gdb/sim-cr16.h
 
@@ -33,8 +35,6 @@ NL_TARGET = -DNL_TARGET_cr16
 
 ## COMMON_POST_CONFIG_FRAG
 
-simops.o: simops.h
-
 simops.h: gencode
 	./gencode -h >$@
 
diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog
index 62981606e53..bcebb8f5fec 100644
--- a/sim/cris/ChangeLog
+++ b/sim/cris/ChangeLog
@@ -1,3 +1,11 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (sim-if.o, dv-cris.o, dv-rv.o, arch.o, traps.o)
+	(devices.o, crisv10f.o, mloopv10f.o, cpuv10.o, decodev10.o)
+	(modelv10.o, crisv32f.o, mloopv32f.o, cpuv32.o, decodev32.o)
+	(modelv32.o): Remove.
+	(SIM_EXTRA_DEPS): Add engv10.h.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/cris/Makefile.in b/sim/cris/Makefile.in
index f932db28a79..87c1efe4682 100644
--- a/sim/cris/Makefile.in
+++ b/sim/cris/Makefile.in
@@ -36,7 +36,7 @@ SIM_OBJS = \
 # FIXME: $(srccom)/cgen-ops.h should be in CGEN_INCLUDE_DEPS.
 SIM_EXTRA_DEPS = \
 	$(CGEN_INCLUDE_DEPS) $(srccom)/cgen-ops.h \
-	arch.h cpuall.h cris-sim.h cris-desc.h
+	arch.h cpuall.h cris-sim.h cris-desc.h engv10.h
 
 SIM_EXTRA_CLEAN = cris-clean
 
@@ -47,19 +47,6 @@ NL_TARGET = -DNL_TARGET_cris
 
 arch = cris
 
-sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(sim-core_h) $(sim-options_h)
-
-# Needs CPU-specific knowledge.
-dv-cris.o: dv-cris.c $(SIM_MAIN_DEPS) $(sim-core_h)
-
-# This is the same rule as dv-core.o etc.
-dv-rv.o: dv-rv.c $(hw_main_headers) $(sim_main_headers)
-
-arch.o: arch.c $(SIM_MAIN_DEPS)
-
-traps.o: traps.c targ-vals.h $(SIM_MAIN_DEPS) $(sim-options_h)
-devices.o: devices.c $(SIM_MAIN_DEPS)
-
 # rvdummy is just used for testing.  It does nothing if
 # --enable-sim-hardware isn't active.
 
@@ -78,8 +65,6 @@ CRISV10F_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpuv10.h decodev10.h engv10.h
 
-crisv10f.o: crisv10f.c cris-tmpl.c $(CRISV10F_INCLUDE_DEPS)
-
 # FIXME: What is mono and what does "Use of `mono' is wip" mean (other
 # than the apparent; some "mono" feature is work in progress)?
 mloopv10f.c engv10.h: stamp-v10fmloop
@@ -90,11 +75,6 @@ stamp-v10fmloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
 	$(SHELL) $(srcroot)/move-if-change eng.hin engv10.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloopv10f.c
 	touch stamp-v10fmloop
-mloopv10f.o: mloopv10f.c semcrisv10f-switch.c $(CRISV10F_INCLUDE_DEPS)
-
-cpuv10.o: cpuv10.c $(CRISV10F_INCLUDE_DEPS)
-decodev10.o: decodev10.c $(CRISV10F_INCLUDE_DEPS)
-modelv10.o: modelv10.c $(CRISV10F_INCLUDE_DEPS)
 
 # CRISV32 objs
 
@@ -102,8 +82,6 @@ CRISV32F_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpuv32.h decodev32.h engv32.h
 
-crisv32f.o: crisv32f.c cris-tmpl.c $(CRISV32F_INCLUDE_DEPS)
-
 # FIXME: What is mono and what does "Use of `mono' is wip" mean (other
 # than the apparent; some "mono" feature is work in progress)?
 mloopv32f.c engv32.h: stamp-v32fmloop
@@ -116,11 +94,6 @@ stamp-v32fmloop: stamp-v10fmloop $(srcdir)/../common/genmloop.sh mloop.in Makefi
 	$(SHELL) $(srcroot)/move-if-change eng.hin engv32.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloopv32f.c
 	touch stamp-v32fmloop
-mloopv32f.o: mloopv32f.c semcrisv32f-switch.c $(CRISV32F_INCLUDE_DEPS)
-
-cpuv32.o: cpuv32.c $(CRISV32F_INCLUDE_DEPS)
-decodev32.o: decodev32.c $(CRISV32F_INCLUDE_DEPS)
-modelv32.o: modelv32.c $(CRISV32F_INCLUDE_DEPS)
 
 cris-clean:
 	for v in 10 32; do \
diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog
index cfd54ba015b..1860b6b3a8f 100644
--- a/sim/d10v/ChangeLog
+++ b/sim/d10v/ChangeLog
@@ -1,3 +1,8 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (SIM_EXTRA_DEPS): New variable.
+	(simops.o): Remove.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/d10v/Makefile.in b/sim/d10v/Makefile.in
index c2907fc5879..13b902dec5d 100644
--- a/sim/d10v/Makefile.in
+++ b/sim/d10v/Makefile.in
@@ -26,6 +26,8 @@ SIM_OBJS = \
 	endian.o
 SIM_EXTRA_CLEAN = clean-extra
 
+SIM_EXTRA_DEPS = simops.h
+
 INCLUDE = d10v_sim.h $(srcroot)/include/gdb/callback.h targ-vals.h endian.c \
 	$(srcroot)/include/gdb/sim-d10v.h
 
@@ -34,8 +36,6 @@ NL_TARGET = -DNL_TARGET_d10v
 
 ## COMMON_POST_CONFIG_FRAG
 
-simops.o: simops.h
-
 simops.h: gencode
 	./gencode -h >$@
 
diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog
index 3be7befe7db..1e1a1b1b73b 100644
--- a/sim/frv/ChangeLog
+++ b/sim/frv/ChangeLog
@@ -1,3 +1,12 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (arch.o, devices.o, frv.o, traps.o, pipeline.o)
+	(interrupts.o, memory.o, cache.o, options.o, reset.o)
+	(registers.o, profile.o, profile-fr400.o, profile-fr450.o)
+	(profile-fr500.o, profile-fr550.o, sim-if.o, mloop.o, cpu.o)
+	(decode.o, sem.o, model.o): Remove.
+	(SIM_EXTRA_DEPS): Add eng.h.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/frv/Makefile.in b/sim/frv/Makefile.in
index 63d18df31b6..87599614020 100644
--- a/sim/frv/Makefile.in
+++ b/sim/frv/Makefile.in
@@ -33,7 +33,7 @@ SIM_OBJS = \
 SIM_EXTRA_DEPS = \
 	$(CGEN_INCLUDE_DEPS) \
 	arch.h cpuall.h frv-sim.h $(srcdir)/../../opcodes/frv-desc.h cache.h \
-	registers.h profile.h \
+	registers.h profile.h eng.h \
 	$(sim-options_h)
 
 SIM_EXTRA_CFLAGS = @sim_trapdump@
@@ -47,10 +47,6 @@ NL_TARGET = -DNL_TARGET_frv
 
 arch = frv
 
-arch.o: arch.c $(SIM_MAIN_DEPS)
-
-devices.o: devices.c $(SIM_MAIN_DEPS)
-
 # FRV objs
 
 FRVBF_INCLUDE_DEPS = \
@@ -58,23 +54,6 @@ FRVBF_INCLUDE_DEPS = \
 	$(SIM_EXTRA_DEPS) \
 	cpu.h decode.h eng.h
 
-frv.o: frv.c $(FRVBF_INCLUDE_DEPS)
-traps.o: traps.c $(FRVBF_INCLUDE_DEPS)
-pipeline.o: pipeline.c $(FRVBF_INCLUDE_DEPS)
-interrupts.o: interrupts.c $(FRVBF_INCLUDE_DEPS)
-memory.o: memory.c $(FRVBF_INCLUDE_DEPS)
-cache.o: cache.c $(FRVBF_INCLUDE_DEPS)
-options.o: options.c $(FRVBF_INCLUDE_DEPS)
-reset.o: reset.c $(FRVBF_INCLUDE_DEPS)
-registers.o: registers.c $(FRVBF_INCLUDE_DEPS)
-profile.o: profile.c profile-fr400.h profile-fr500.h profile-fr550.h $(FRVBF_INCLUDE_DEPS)
-profile-fr400.o: profile-fr400.c profile-fr400.h $(FRVBF_INCLUDE_DEPS)
-profile-fr450.o: profile-fr450.c $(FRVBF_INCLUDE_DEPS)
-profile-fr500.o: profile-fr500.c profile-fr500.h $(FRVBF_INCLUDE_DEPS)
-profile-fr550.o: profile-fr550.c profile-fr550.h $(FRVBF_INCLUDE_DEPS)
-sim-if.o: sim-if.c $(FRVBF_INCLUDE_DEPS) $(srcdir)/../common/sim-core.h eng.h
-
-
 # FIXME: Use of `mono' is wip.
 mloop.c eng.h: stamp-mloop
 stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
@@ -84,12 +63,6 @@ stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
 	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
 	touch stamp-mloop
-mloop.o: mloop.c $(FRVBF_INCLUDE_DEPS)
-
-cpu.o: cpu.c $(FRVBF_INCLUDE_DEPS)
-decode.o: decode.c $(FRVBF_INCLUDE_DEPS)
-sem.o: sem.c $(FRVBF_INCLUDE_DEPS)
-model.o: model.c $(FRVBF_INCLUDE_DEPS)
 
 frv-clean:
 	rm -f mloop.c eng.h stamp-mloop
diff --git a/sim/iq2000/ChangeLog b/sim/iq2000/ChangeLog
index 06f2201f382..0327bf7d2d0 100644
--- a/sim/iq2000/ChangeLog
+++ b/sim/iq2000/ChangeLog
@@ -1,3 +1,11 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (sim-if.o): Remove.
+	(arch.o): Use COMPILE and POSTCOMPILE.
+	(devices.o, iq2000.o, mloop.o, cpu.o, decode.o, sem.o, model.o):
+	Remove.
+	(SIM_EXTRA_DEPS): Add eng.h.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/iq2000/Makefile.in b/sim/iq2000/Makefile.in
index baf49dd3330..6047033b305 100644
--- a/sim/iq2000/Makefile.in
+++ b/sim/iq2000/Makefile.in
@@ -32,7 +32,7 @@ SIM_OBJS = \
 # Extra headers included by sim-main.h.
 SIM_EXTRA_DEPS = \
 	$(CGEN_INCLUDE_DEPS) \
-	arch.h cpuall.h $(srcdir)/../../opcodes/iq2000-desc.h
+	arch.h cpuall.h $(srcdir)/../../opcodes/iq2000-desc.h eng.h
 
 SIM_EXTRA_CFLAGS =
 
@@ -44,12 +44,9 @@ SIM_EXTRA_CLEAN = iq2000-clean
 
 arch = iq2000
 
-sim-if.o: $(srcdir)/sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h
-
-arch.o: arch.c $(SIM_MAIN_DEPS)
-	$(CC) -c $(srcdir)/arch.c $(ALL_CFLAGS) -UHAVE_CPU_IQ10BF
-
-devices.o: $(srcdir)/devices.c $(SIM_MAIN_DEPS)
+arch.o: arch.c
+	$(COMPILE) -UHAVE_CPU_IQ10BF $(srcdir)/arch.c
+	$(POSTCOMPILE)
 
 # IQ2000 objs
 
@@ -57,8 +54,6 @@ IQ2000BF_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpu.h decode.h eng.h
 
-iq2000.o: $(srcdir)/iq2000.c $(IQ2000BF_INCLUDE_DEPS)
-
 # FIXME: Use of `mono' is wip.
 mloop.c eng.h: stamp-mloop
 stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
@@ -68,12 +63,6 @@ stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
 	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
 	touch stamp-mloop
-mloop.o: mloop.c $(srcdir)/sem-switch.c $(IQ2000BF_INCLUDE_DEPS)
-
-cpu.o: $(srcdir)/cpu.c $(IQ2000BF_INCLUDE_DEPS)
-decode.o: $(srcdir)/decode.c $(IQ2000BF_INCLUDE_DEPS)
-sem.o: $(srcdir)/sem.c $(IQ2000BF_INCLUDE_DEPS)
-model.o: $(srcdir)/model.c $(IQ2000BF_INCLUDE_DEPS)
 
 iq2000-clean:
 	rm -f mloop.c eng.h stamp-mloop
diff --git a/sim/lm32/ChangeLog b/sim/lm32/ChangeLog
index 7f2f8bc4b17..a9d59f84054 100644
--- a/sim/lm32/ChangeLog
+++ b/sim/lm32/ChangeLog
@@ -1,3 +1,9 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (arch.o, traps.o, sim-if.o, lm32.o, mloop.o)
+	(cpu.o, decode.o, sem.o, model.o): Remove.
+	(SIM_EXTRA_DEPS): Add eng.h.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/lm32/Makefile.in b/sim/lm32/Makefile.in
index 633ffec8fd8..51e6269d27c 100644
--- a/sim/lm32/Makefile.in
+++ b/sim/lm32/Makefile.in
@@ -14,7 +14,8 @@ SIM_OBJS = \
 
 # List of extra dependencies.
 # Generally this consists of simulator specific files included by sim-main.h.
-SIM_EXTRA_DEPS = $(CGEN_INCLUDE_DEPS) $(srcdir)/../../opcodes/lm32-desc.h
+SIM_EXTRA_DEPS = $(CGEN_INCLUDE_DEPS) $(srcdir)/../../opcodes/lm32-desc.h \
+	eng.h
 
 # List of flags to always pass to $(CC).
 #SIM_EXTRA_CFLAGS =
@@ -28,18 +29,10 @@ NL_TARGET = -DNL_TARGET_lm32
 
 arch = lm32 
 
-arch.o: arch.c $(SIM_MAIN_DEPS)
-
-traps.o: traps.c targ-vals.h $(SIM_MAIN_DEPS)
-
-sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h
-
 LM32BF_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpu.h decode.h eng.h
 
-lm32.o: lm32.c $(LM32BF_INCLUDE_DEPS)
-
 # FIXME: Use of `mono' is wip.
 mloop.c eng.h: stamp-mloop
 stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
@@ -49,12 +42,6 @@ stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
 	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
 	touch stamp-mloop
-mloop.o: mloop.c sem-switch.c 
-
-cpu.o: cpu.c $(LM32BF_INCLUDE_DEPS)
-decode.o: decode.c $(LM32BF_INCLUDE_DEPS)
-sem.o: sem.c $(LM32BF_INCLUDE_DEPS)
-model.o: model.c $(LM32BF_INCLUDE_DEPS)
 
 lm32-clean:
 	rm -f mloop.c eng.h stamp-mloop
diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog
index a9d71db241a..50a462778df 100644
--- a/sim/m32r/ChangeLog
+++ b/sim/m32r/ChangeLog
@@ -1,3 +1,11 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (sim-if.o, arch.o, traps.o, traps-linux.o)
+	(devices.o, m32r.o, mloop.o, cpu.o, decode.o, sem.o, model.o)
+	(m32rx.o, mloopx.o, cpux.o, decodex.o, semx.o, modelx.o)
+	(m32r2.o, mloop2.o, cpu2.o, decode2.o, sem2.o, model2.o): Remove.
+	(SIM_EXTRA_DEPS): Add eng.h, engx.h, eng2.h.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/m32r/Makefile.in b/sim/m32r/Makefile.in
index 4111c2e17d2..fe470f6fc26 100644
--- a/sim/m32r/Makefile.in
+++ b/sim/m32r/Makefile.in
@@ -37,7 +37,8 @@ SIM_OBJS = \
 # Extra headers included by sim-main.h.
 SIM_EXTRA_DEPS = \
 	$(CGEN_INCLUDE_DEPS) \
-	arch.h cpuall.h m32r-sim.h $(srcdir)/../../opcodes/m32r-desc.h
+	arch.h cpuall.h m32r-sim.h $(srcdir)/../../opcodes/m32r-desc.h \
+	eng.h engx.h eng2.h
 
 SIM_EXTRA_CFLAGS = @sim_extra_cflags@
 
@@ -50,22 +51,12 @@ NL_TARGET = -DNL_TARGET_m32r
 
 arch = m32r
 
-sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h
-
-arch.o: arch.c $(SIM_MAIN_DEPS)
-
-traps.o: traps.c targ-vals.h $(SIM_MAIN_DEPS)
-traps-linux.o: traps.c syscall.h targ-vals.h $(SIM_MAIN_DEPS)
-devices.o: devices.c $(SIM_MAIN_DEPS)
-
 # M32R objs
 
 M32RBF_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpu.h decode.h eng.h
 
-m32r.o: m32r.c $(M32RBF_INCLUDE_DEPS)
-
 # FIXME: Use of `mono' is wip.
 mloop.c eng.h: stamp-mloop ; @true
 stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
@@ -75,12 +66,6 @@ stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
 	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
 	touch stamp-mloop
-mloop.o: mloop.c sem-switch.c $(M32RBF_INCLUDE_DEPS)
-
-cpu.o: cpu.c $(M32RBF_INCLUDE_DEPS)
-decode.o: decode.c $(M32RBF_INCLUDE_DEPS)
-sem.o: sem.c $(M32RBF_INCLUDE_DEPS)
-model.o: model.c $(M32RBF_INCLUDE_DEPS)
 
 # M32RX objs
 
@@ -88,8 +73,6 @@ M32RXF_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpux.h decodex.h engx.h
 
-m32rx.o: m32rx.c $(M32RXF_INCLUDE_DEPS)
-
 # FIXME: Use of `mono' is wip.
 mloopx.c engx.h: stamp-xmloop ; @true
 stamp-xmloop: $(srcdir)/../common/genmloop.sh mloopx.in Makefile
@@ -100,12 +83,6 @@ stamp-xmloop: $(srcdir)/../common/genmloop.sh mloopx.in Makefile
 	$(SHELL) $(srcroot)/move-if-change engx.hin engx.h
 	$(SHELL) $(srcroot)/move-if-change mloopx.cin mloopx.c
 	touch stamp-xmloop
-mloopx.o: mloopx.c semx-switch.c $(M32RXF_INCLUDE_DEPS)
-
-cpux.o: cpux.c $(M32RXF_INCLUDE_DEPS)
-decodex.o: decodex.c $(M32RXF_INCLUDE_DEPS)
-semx.o: semx.c $(M32RXF_INCLUDE_DEPS)
-modelx.o: modelx.c $(M32RXF_INCLUDE_DEPS)
 
 # M32R2 objs
 
@@ -113,8 +90,6 @@ M32R2F_INCLUDE_DEPS = \
 	$(CGEN_MAIN_CPU_DEPS) \
 	cpu2.h decode2.h eng2.h
 
-m32r2.o: m32r2.c $(M32R2F_INCLUDE_DEPS)
-
 # FIXME: Use of `mono' is wip.
 mloop2.c eng2.h: stamp-2mloop ; @true
 stamp-2mloop: $(srcdir)/../common/genmloop.sh mloop2.in Makefile
@@ -126,12 +101,6 @@ stamp-2mloop: $(srcdir)/../common/genmloop.sh mloop2.in Makefile
 	$(SHELL) $(srcroot)/move-if-change mloop2.cin mloop2.c
 	touch stamp-2mloop
 
-mloop2.o: mloop2.c $(srcdir)/sem2-switch.c $(M32R2F_INCLUDE_DEPS)
-cpu2.o: cpu2.c $(M32R2F_INCLUDE_DEPS)
-decode2.o: decode2.c $(M32R2F_INCLUDE_DEPS)
-sem2.o: sem2.c $(M32R2F_INCLUDE_DEPS)
-model2.o: model2.c $(M32R2F_INCLUDE_DEPS)
-
 m32r-clean:
 	rm -f mloop.c eng.h stamp-mloop
 	rm -f mloopx.c engx.h stamp-xmloop
diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index d3a99225079..9f666da5de1 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,3 +1,7 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (interp.o): Remove.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/m68hc11/Makefile.in b/sim/m68hc11/Makefile.in
index 9e2248fc638..9ebcf65c629 100644
--- a/sim/m68hc11/Makefile.in
+++ b/sim/m68hc11/Makefile.in
@@ -54,7 +54,5 @@ gencode.o: gencode.c
 gencode: gencode.o
 	$(LINK_FOR_BUILD) $^
 
-interp.o: interp.c $(INCLUDE)
-
 clean-extra:
 	rm -f gencode m68hc11int.c
diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog
index 0ef753ed924..eced42e1e51 100644
--- a/sim/mips/ChangeLog
+++ b/sim/mips/ChangeLog
@@ -1,3 +1,9 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (interp.o, m16run.o, micromipsrun.o, multi-run.o):
+	Remove.
+	(SIM_EXTRA_DEPS): New variable.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/mips/Makefile.in b/sim/mips/Makefile.in
index 00906451c4c..aa66bb3777f 100644
--- a/sim/mips/Makefile.in
+++ b/sim/mips/Makefile.in
@@ -83,17 +83,10 @@ all: $(SIM_@sim_gen@_ALL)
 
 SIM_EXTRA_LIBS = $(MIPS_EXTRA_LIBS)
 
+SIM_EXTRA_DEPS = itable.h
 
-## COMMON_POST_CONFIG_FRAG
-
-interp.o: $(srcdir)/interp.c config.h sim-main.h itable.h
-
-m16run.o: sim-main.h m16_idecode.h m32_idecode.h m16run.c $(SIM_EXTRA_DEPS)
 
-micromipsrun.o: sim-main.h micromips16_idecode.h micromips32_idecode.h \
-		micromips_m32_idecode.h micromipsrun.c $(SIM_EXTRA_DEPS)
-
-multi-run.o: multi-include.h tmp-mach-multi
+## COMMON_POST_CONFIG_FRAG
 
 IGEN_TRACE= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries # -G trace-all
 IGEN_INSN=$(srcdir)/mips.igen
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog
index f257a37383f..8daf6fd19c8 100644
--- a/sim/mn10300/ChangeLog
+++ b/sim/mn10300/ChangeLog
@@ -1,3 +1,8 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (interp.o): Remove.
+	(idecode.o op_utils.o semantics.o): Remove.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/mn10300/Makefile.in b/sim/mn10300/Makefile.in
index 120958fce6d..07ef9d973f6 100644
--- a/sim/mn10300/Makefile.in
+++ b/sim/mn10300/Makefile.in
@@ -39,8 +39,6 @@ SIM_EXTRA_CFLAGS = -DPOLL_QUIT_INTERVAL=0x20
 
 ## COMMON_POST_CONFIG_FRAG
 
-idecode.o op_utils.o semantics.o: targ-vals.h
-
 BUILT_SRC_FROM_IGEN = \
 	icache.h \
 	icache.c \
@@ -110,5 +108,3 @@ tmp-igen: $(IGEN_INSN) $(IGEN_INSN_INC) $(IGEN_DC) ../igen/igen
 	$(SHELL) $(srcdir)/../../move-if-change tmp-engine.c engine.c
 	$(SHELL) $(srcdir)/../../move-if-change tmp-irun.c irun.c
 	touch tmp-igen
-
-interp.o: interp.c $(INCLUDE)
diff --git a/sim/or1k/ChangeLog b/sim/or1k/ChangeLog
index c2fe690c492..910281f3d56 100644
--- a/sim/or1k/ChangeLog
+++ b/sim/or1k/ChangeLog
@@ -1,3 +1,8 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (mloop.o, arch.o, cpu.o, decode.o, sem.o)
+	(sem-switch.o, model.o): Remove.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/or1k/Makefile.in b/sim/or1k/Makefile.in
index 24625603cb0..649486fd4e1 100644
--- a/sim/or1k/Makefile.in
+++ b/sim/or1k/Makefile.in
@@ -75,16 +75,9 @@ stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
 	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
 	$(SHELL) $(srcroot)/move-if-change mloop.cin mloop.c
 	touch stamp-mloop
-mloop.o: mloop.c sem-switch.c $(OR1K32BF_INCLUDE_DEPS)
 or1k.o: or1k.c $(OR1K32BF_INCLUDE_DEPS)
 	$(COMPILE) $<
 	$(POSTCOMPILE)
-arch.o: arch.c $(SIM_MAIN_DEPS)
-cpu.o: cpu.c $(OR1K32BF_INCLUDE_DEPS)
-decode.o: decode.c $(OR1K32BF_INCLUDE_DEPS)
-sem.o: sem.c $(OR1K32BF_INCLUDE_DEPS)
-sem-switch.o: sem-switch.c $(OR1K32BF_INCLUDE_DEPS)
-model.o: model.c $(OR1K32BF_INCLUDE_DEPS)
 
 sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(srcdir)/../common/sim-core.h eng.h
 	$(COMPILE) $<
diff --git a/sim/rl78/ChangeLog b/sim/rl78/ChangeLog
index 58b7c45c47b..975f3df62c1 100644
--- a/sim/rl78/ChangeLog
+++ b/sim/rl78/ChangeLog
@@ -1,3 +1,8 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (err.o, fpu.o, gdb-if.o, load.o, main.o, mem.o)
+	(reg.o, rl78.o): Remove.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog
index 5a527fbf906..1434f15d2fc 100644
--- a/sim/rx/ChangeLog
+++ b/sim/rx/ChangeLog
@@ -1,3 +1,8 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (err.o, fpu.o, gdb-if.o, load.o, main.o, mem.o)
+	(misc.o, reg.o, rx.o, syscalls.o, trace.o): Remove.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/rx/Makefile.in b/sim/rx/Makefile.in
index 3c6094caf2e..45b956c1d2e 100644
--- a/sim/rx/Makefile.in
+++ b/sim/rx/Makefile.in
@@ -47,19 +47,3 @@ LIBS = $B/bfd/libbfd.a $B/libiberty/libiberty.a
 ## COMMON_POST_CONFIG_FRAG
 
 arch = rx
-
-err.o : err.h
-fpu.o : cpu.h fpu.h
-gdb-if.o : cpu.h mem.h load.h syscalls.h err.h \
-           $(srcdir)/../../include/gdb/callback.h \
-	   $(srcdir)/../../include/gdb/remote-sim.h \
-	   $(srcdir)/../../include/gdb/signals.h \
-	   $(srcdir)/../../include/gdb/sim-rx.h
-load.o : ../../bfd/bfd.h cpu.h mem.h
-main.o : ../../bfd/bfd.h cpu.h mem.h misc.h load.h trace.h err.h
-mem.o : mem.h cpu.h syscalls.h misc.h err.h
-misc.o : cpu.h misc.h
-reg.o : cpu.h trace.h
-rx.o : $(srcdir)/../../include/opcode/rx.h cpu.h mem.h syscalls.h fpu.h
-syscalls.o : $(srcdir)/../../include/gdb/callback.h cpu.h mem.h syscalls.h
-trace.o : ../../bfd/bfd.h $(srcdir)/../../include/dis-asm.h cpu.h mem.h load.h
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog
index f223819dcd5..209d8e8a4f9 100644
--- a/sim/sh/ChangeLog
+++ b/sim/sh/ChangeLog
@@ -1,3 +1,8 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (SIM_EXTRA_DEPS): New variable.
+	(interp.o): Remove.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/sh/Makefile.in b/sim/sh/Makefile.in
index e92b7843dab..84d417287d1 100644
--- a/sim/sh/Makefile.in
+++ b/sim/sh/Makefile.in
@@ -26,11 +26,10 @@ SIM_OBJS = \
 	table.o
 SIM_EXTRA_LIBS = -lm
 SIM_EXTRA_CLEAN = sh-clean
+SIM_EXTRA_DEPS = table.c code.c ppi.c
 
 ## COMMON_POST_CONFIG_FRAG
 
-interp.o: interp.c code.c table.c ppi.c $(srcroot)/include/gdb/sim-sh.h
-
 code.c: gencode
 	./gencode -x >code.c
 #	indent code.c
diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog
index c1214e73c48..ed9616e1a97 100644
--- a/sim/v850/ChangeLog
+++ b/sim/v850/ChangeLog
@@ -1,3 +1,7 @@
+2021-04-22  Tom Tromey  <tom@tromey.com>
+
+	* Makefile.in (interp.o, simops.o, semantics.o): Remove.
+
 2021-04-22  Tom Tromey  <tom@tromey.com>
 
 	* configure: Rebuild.
diff --git a/sim/v850/Makefile.in b/sim/v850/Makefile.in
index 250129c549f..1f9d8c55c37 100644
--- a/sim/v850/Makefile.in
+++ b/sim/v850/Makefile.in
@@ -110,7 +110,3 @@ tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen
 
 clean-extra: clean-igen
 	rm -f table.c simops.h gencode
-
-interp.o: interp.c $(INCLUDE)
-simops.o: simops.c simops.h $(INCLUDE) targ-vals.h
-semantics.o: $(INCLUDE)

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 05/10] Remove and modernize dependencies in sim
  2021-04-22 14:15     ` Tom Tromey
@ 2021-04-23  0:44       ` Mike Frysinger
  0 siblings, 0 replies; 31+ messages in thread
From: Mike Frysinger @ 2021-04-23  0:44 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 22 Apr 2021 08:15, Tom Tromey wrote:
> >>>>> "Mike" == Mike Frysinger via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Mike> On 08 Apr 2021 14:33, Tom Tromey wrote:
> >> Some spots in the sim build used manual dependencies, and some spots
> >> did a compilation by hand but did not use the automatic dependency
> >> tracking code.  This patch fixes these spots.
> >> 
> >> I didn't touch ppc, because it doesn't use the common Makefile code.
> >> I also didn't touch objects that are for the build machine, because
> >> automatic dependencies don't work for those.
> 
> Mike> lgtm, thanks
> 
> This one needed some updates to ensure that built headers are in fact
> built before objects that use them.
> 
> I think it's straightforward, but sending FAOD.

seems fine, thanks
-mike

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2021-04-23  0:44 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 20:33 [PATCH 00/10] sim build improvements Tom Tromey
2021-04-08 20:33 ` [PATCH 01/10] Make mostlyclean an alias for clean Tom Tromey
2021-04-09  0:25   ` Mike Frysinger
2021-04-08 20:33 ` [PATCH 02/10] Introduce stamp file for hw-config.h Tom Tromey
2021-04-09  0:25   ` Mike Frysinger
2021-04-08 20:33 ` [PATCH 03/10] Add stamp files for generated files in sim/ppc Tom Tromey
2021-04-09  0:25   ` Mike Frysinger
2021-04-08 20:33 ` [PATCH 04/10] Require GNU make Tom Tromey
2021-04-09  0:31   ` Mike Frysinger
2021-04-09 17:18     ` Tom Tromey
2021-04-09 22:45       ` Mike Frysinger
2021-04-21 23:14         ` Tom Tromey
2021-04-22  3:17           ` Mike Frysinger
2021-04-22 14:14             ` Tom Tromey
2021-04-08 20:33 ` [PATCH 05/10] Remove and modernize dependencies in sim Tom Tromey
2021-04-11 17:50   ` Mike Frysinger
2021-04-22 14:15     ` Tom Tromey
2021-04-23  0:44       ` Mike Frysinger
2021-04-08 20:33 ` [PATCH 06/10] Remove INCLUDE variable from some sim Makefiles Tom Tromey
2021-04-09  0:27   ` Mike Frysinger
2021-04-08 20:33 ` [PATCH 07/10] Remove LIBS from two " Tom Tromey
2021-04-09  0:27   ` Mike Frysinger
2021-04-08 20:33 ` [PATCH 08/10] Define autoconf substitution variables early in Make-common.in Tom Tromey
2021-04-09  0:44   ` Mike Frysinger
2021-04-08 20:33 ` [PATCH 09/10] Use prologue and epilogue Makefile fragments Tom Tromey
2021-04-08 20:33 ` [PATCH 10/10] Do not check for sys/time.h or sys/times.h Tom Tromey
2021-04-09  0:35   ` Mike Frysinger
2021-04-09 17:18     ` Tom Tromey
2021-04-09  0:26 ` [PATCH 00/10] sim build improvements Mike Frysinger
2021-04-09 17:14   ` Tom Tromey
2021-04-09 22:27     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).