[PATCH 2/3] sim: unify toolchain dependency logic

Mike Frysinger vapier@gentoo.org
Sat Jun 19 05:09:35 GMT 2021


The common dir is already probing this info since it's using automake,
so pass it down to the subdirs so they don't have to probe it at all.
---
 sim/aarch64/aclocal.m4         |    2 -
 sim/aarch64/configure          | 1108 +---------------
 sim/arch-subdir.mk.in          |    3 +
 sim/arm/aclocal.m4             |    2 -
 sim/arm/configure              | 1108 +---------------
 sim/avr/aclocal.m4             |    2 -
 sim/avr/configure              | 1108 +---------------
 sim/bfin/aclocal.m4            |    2 -
 sim/bfin/configure             | 2161 ++++++++++++++------------------
 sim/bpf/aclocal.m4             |    2 -
 sim/bpf/configure              | 1108 +---------------
 sim/common/Make-common.in      |    2 -
 sim/configure                  |  348 +++--
 sim/configure.ac               |   13 +-
 sim/cr16/aclocal.m4            |    2 -
 sim/cr16/configure             | 1108 +---------------
 sim/cris/aclocal.m4            |    2 -
 sim/cris/configure             | 1108 +---------------
 sim/d10v/aclocal.m4            |    2 -
 sim/d10v/configure             | 1108 +---------------
 sim/erc32/aclocal.m4           |    2 -
 sim/erc32/configure            |  527 ++------
 sim/example-synacor/aclocal.m4 |    2 -
 sim/example-synacor/configure  | 1108 +---------------
 sim/frv/aclocal.m4             |    2 -
 sim/frv/configure              | 1108 +---------------
 sim/ft32/aclocal.m4            |    2 -
 sim/ft32/configure             | 1108 +---------------
 sim/h8300/aclocal.m4           |    2 -
 sim/h8300/configure            | 1108 +---------------
 sim/iq2000/aclocal.m4          |    2 -
 sim/iq2000/configure           | 1108 +---------------
 sim/lm32/aclocal.m4            |    2 -
 sim/lm32/configure             | 1108 +---------------
 sim/m32c/aclocal.m4            |    2 -
 sim/m32c/configure             | 1108 +---------------
 sim/m32r/aclocal.m4            |    2 -
 sim/m32r/configure             | 1108 +---------------
 sim/m4/sim_ac_common.m4        |    6 -
 sim/m68hc11/aclocal.m4         |    2 -
 sim/m68hc11/configure          | 1108 +---------------
 sim/mcore/aclocal.m4           |    2 -
 sim/mcore/configure            | 1108 +---------------
 sim/microblaze/aclocal.m4      |    2 -
 sim/microblaze/configure       | 1108 +---------------
 sim/mips/aclocal.m4            |    2 -
 sim/mips/configure             | 1108 +---------------
 sim/mn10300/aclocal.m4         |    2 -
 sim/mn10300/configure          | 1108 +---------------
 sim/moxie/aclocal.m4           |    2 -
 sim/moxie/configure            | 1108 +---------------
 sim/msp430/aclocal.m4          |    2 -
 sim/msp430/configure           | 1108 +---------------
 sim/or1k/aclocal.m4            |    2 -
 sim/or1k/configure             | 1108 +---------------
 sim/pru/aclocal.m4             |    2 -
 sim/pru/configure              | 1108 +---------------
 sim/riscv/aclocal.m4           |    2 -
 sim/riscv/configure            | 1108 +---------------
 sim/rl78/aclocal.m4            |    2 -
 sim/rl78/configure             | 1108 +---------------
 sim/rx/aclocal.m4              |    2 -
 sim/rx/configure               | 1108 +---------------
 sim/sh/aclocal.m4              |    2 -
 sim/sh/configure               | 1108 +---------------
 sim/v850/aclocal.m4            |    2 -
 sim/v850/configure             | 1108 +---------------
 67 files changed, 1386 insertions(+), 33868 deletions(-)

diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
index 7a4250a4e5db..167d39bf8e2f 100644
--- a/sim/arch-subdir.mk.in
+++ b/sim/arch-subdir.mk.in
@@ -40,6 +40,9 @@ AR = @AR@
 AR_FLAGS = rc
 RANLIB = @RANLIB@
 
+DEPMODE = @CCDEPMODE@
+DEPDIR = @DEPDIR@
+
 zlibdir = @zlibdir@
 @PLUGINS_TRUE@LIBDL = @lt_cv_dlopen_libs@
 COMMON_LIBS = @LIBS@
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 64c01940a7ff..4b430b806af2 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -82,8 +82,6 @@ SIM_WARN_CFLAGS = $(WARN_CFLAGS)
 SIM_WERROR_CFLAGS = $(WERROR_CFLAGS)
 
 # Dependency tracking information.
-DEPMODE = @CCDEPMODE@
-DEPDIR = @DEPDIR@
 depcomp = $(SHELL) $(srcroot)/depcomp
 
 # Note that these are overridden by GNU make-specific code below if
diff --git a/sim/configure.ac b/sim/configure.ac
index 8e9190040d4c..33c7aca60f5a 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -48,13 +48,20 @@ dnl used when installing files to see if they need to be suffixed.
 SIM_PRIMARY_TARGET=
 AC_SUBST(SIM_PRIMARY_TARGET)
 
-m4_define([SIM_TARGET], [
+m4_define([SIM_BUILD_TARGET], [dnl
+  AC_CONFIG_SUBDIRS($1)
+  dnl Create the depdirs for ports until we can convert them to automake.
+  AC_CONFIG_COMMANDS([depdir-$1],
+		     [$SHELL $ac_aux_dir/mkinstalldirs $1/$DEPDIR],
+		     [ac_aux_dir=$ac_aux_dir DEPDIR=$DEPDIR])
+])
+m4_define([SIM_TARGET], [dnl
   case "${targ}" in
     all|$1)
       if test "${targ}" = "${target}"; then
         SIM_PRIMARY_TARGET=$2
       fi
-      AC_CONFIG_SUBDIRS($2)
+      SIM_BUILD_TARGET($2)
       $3
       ;;
   esac
@@ -102,7 +109,7 @@ if test "${enable_sim}" != no; then
   done
 
   if test "x${enable_example_sims}" = xyes; then
-    AC_CONFIG_SUBDIRS(example-synacor)
+    SIM_BUILD_TARGET([example-synacor])
   fi
 fi
 AM_CONDITIONAL([SIM_ENABLE_IGEN], [test "$sim_igen" = "yes"])
diff --git a/sim/m4/sim_ac_common.m4 b/sim/m4/sim_ac_common.m4
index b9a5595ac20e..1dff64ef9e69 100644
--- a/sim/m4/sim_ac_common.m4
+++ b/sim/m4/sim_ac_common.m4
@@ -21,12 +21,6 @@ dnl
 dnl See README-HACKING for more details.
 AC_DEFUN([SIM_AC_COMMON],
 [dnl
-# Dependency checking.
-AC_REQUIRE([AC_PROG_CC])
-AC_REQUIRE([AC_PROG_INSTALL])
-ZW_CREATE_DEPDIR
-ZW_PROG_COMPILER_DEPENDENCIES([CC])
-
 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=
-- 
2.31.1



More information about the Gdb-patches mailing list