[3/3] sim: unify bfd library dependency testing logic

Message ID 20210618142754.21722-3-vapier@gentoo.org
State New
Headers show
Series
  • [1/3] sim: unify various library testing logic
Related show

Commit Message

Rustam Kovhaev via Gdb-patches June 18, 2021, 2:27 p.m.
Move these options up to the common dir so we only test & export
them once across all ports.
---
 sim/Makefile.in                |   99 +-
 sim/aarch64/aclocal.m4         |    7 -
 sim/aarch64/configure          | 8567 ++-----------------------------
 sim/aclocal.m4                 |    7 +
 sim/arch-subdir.mk.in          |    2 +
 sim/arm/aclocal.m4             |    7 -
 sim/arm/configure              | 8567 ++-----------------------------
 sim/avr/aclocal.m4             |    7 -
 sim/avr/configure              | 8567 ++-----------------------------
 sim/bfin/aclocal.m4            |    7 -
 sim/bfin/configure             | 8611 ++-----------------------------
 sim/bpf/aclocal.m4             |    7 -
 sim/bpf/configure              | 8567 ++-----------------------------
 sim/common/Make-common.in      |    3 +-
 sim/config.h.in                |    7 +
 sim/configure                  | 8630 ++++++++++++++++++++++++++++++--
 sim/cr16/aclocal.m4            |    7 -
 sim/cr16/configure             | 8567 ++-----------------------------
 sim/cris/aclocal.m4            |    7 -
 sim/cris/configure             | 8567 ++-----------------------------
 sim/d10v/aclocal.m4            |    7 -
 sim/d10v/configure             | 8567 ++-----------------------------
 sim/erc32/aclocal.m4           |    7 -
 sim/erc32/configure            | 8611 ++-----------------------------
 sim/example-synacor/aclocal.m4 |    7 -
 sim/example-synacor/configure  | 8567 ++-----------------------------
 sim/frv/aclocal.m4             |    7 -
 sim/frv/configure              | 8567 ++-----------------------------
 sim/ft32/aclocal.m4            |    7 -
 sim/ft32/configure             | 8567 ++-----------------------------
 sim/h8300/aclocal.m4           |    7 -
 sim/h8300/configure            | 8567 ++-----------------------------
 sim/iq2000/aclocal.m4          |    7 -
 sim/iq2000/configure           | 8567 ++-----------------------------
 sim/lm32/aclocal.m4            |    7 -
 sim/lm32/configure             | 8567 ++-----------------------------
 sim/m32c/aclocal.m4            |    7 -
 sim/m32c/configure             | 8567 ++-----------------------------
 sim/m32r/aclocal.m4            |    7 -
 sim/m32r/configure             | 8567 ++-----------------------------
 sim/m4/sim_ac_common.m4        |   10 -
 sim/m4/sim_ac_platform.m4      |   10 +
 sim/m68hc11/aclocal.m4         |    7 -
 sim/m68hc11/configure          | 8567 ++-----------------------------
 sim/mcore/aclocal.m4           |    7 -
 sim/mcore/configure            | 8567 ++-----------------------------
 sim/microblaze/aclocal.m4      |    7 -
 sim/microblaze/configure       | 8567 ++-----------------------------
 sim/mips/aclocal.m4            |    7 -
 sim/mips/configure             | 8561 ++-----------------------------
 sim/mn10300/aclocal.m4         |    7 -
 sim/mn10300/configure          | 8567 ++-----------------------------
 sim/moxie/aclocal.m4           |    7 -
 sim/moxie/configure            | 8567 ++-----------------------------
 sim/msp430/aclocal.m4          |    7 -
 sim/msp430/configure           | 8567 ++-----------------------------
 sim/or1k/aclocal.m4            |    7 -
 sim/or1k/configure             | 8567 ++-----------------------------
 sim/pru/aclocal.m4             |    7 -
 sim/pru/configure              | 8567 ++-----------------------------
 sim/riscv/aclocal.m4           |    7 -
 sim/riscv/configure            | 8567 ++-----------------------------
 sim/rl78/aclocal.m4            |    7 -
 sim/rl78/configure             | 8567 ++-----------------------------
 sim/rx/aclocal.m4              |    7 -
 sim/rx/configure               | 8567 ++-----------------------------
 sim/sh/aclocal.m4              |    7 -
 sim/sh/configure               | 8567 ++-----------------------------
 sim/v850/aclocal.m4            |    7 -
 sim/v850/configure             | 8567 ++-----------------------------
 70 files changed, 21967 insertions(+), 252677 deletions(-)

-- 
2.31.1

Patch

diff --git a/sim/arch-subdir.mk.in b/sim/arch-subdir.mk.in
index bc51fcaf9778..c6d0884cd19f 100644
--- a/sim/arch-subdir.mk.in
+++ b/sim/arch-subdir.mk.in
@@ -17,6 +17,8 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+zlibdir = @zlibdir@
+@PLUGINS_TRUE@LIBDL = @lt_cv_dlopen_libs@
 COMMON_LIBS = @LIBS@
 WARN_CFLAGS = @WARN_CFLAGS@
 WERROR_CFLAGS = @WERROR_CFLAGS@
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 245da2a0438f..f817f99d748d 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -242,10 +242,9 @@  BUILD_CFLAGS = $(CFLAGS_FOR_BUILD) $(CSEARCH)
 
 COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) $(SIM_EXTRA_CFLAGS)
 
-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@
diff --git a/sim/m4/sim_ac_common.m4 b/sim/m4/sim_ac_common.m4
index f44e43695703..b04d1c69150f 100644
--- a/sim/m4/sim_ac_common.m4
+++ b/sim/m4/sim_ac_common.m4
@@ -32,16 +32,6 @@  dnl to see if there are intl libraries we should link against.
 ALL_LINGUAS=
 ZW_GNU_GETTEXT_SISTER_DIR(../../intl)
 
-# BFD conditionally uses zlib, so we must link it in if libbfd does, by
-# using the same condition.
-AM_ZLIB
-
-# BFD uses libdl when when plugins enabled.
-AC_PLUGINS
-AM_CONDITIONAL(PLUGINS, test "$plugins" = yes)
-LT_INIT([dlopen])
-AC_SUBST(lt_cv_dlopen_libs)
-
 dnl We don't use automake, but we still want to support
 dnl --enable-maintainer-mode.
 AM_MAINTAINER_MODE
diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4
index d2e1d360b4f5..87ebe6a9c2e3 100644
--- a/sim/m4/sim_ac_platform.m4
+++ b/sim/m4/sim_ac_platform.m4
@@ -142,6 +142,16 @@  AC_TYPE_SIGNAL
 AC_TYPE_SIZE_T
 AC_TYPE_UID_T
 
+dnl BFD conditionally uses zlib, so we must link it in if libbfd does, by
+dnl using the same condition.
+AM_ZLIB
+
+dnl BFD uses libdl when when plugins enabled.
+AC_PLUGINS
+AM_CONDITIONAL(PLUGINS, test "$plugins" = yes)
+LT_INIT([dlopen])
+AC_SUBST(lt_cv_dlopen_libs)
+
 dnl Libraries.
 AC_CHECK_LIB(socket, bind)
 AC_CHECK_LIB(nsl, gethostbyname)