[08/10] Define autoconf substitution variables early in Make-common.in

Message ID 20210408203312.2938165-9-tom@tromey.com
State New
Headers show
Series
  • sim build improvements
Related show

Commit Message

Tom Tromey April 8, 2021, 8:33 p.m.
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(-)

-- 
2.26.2

Comments

Mike Frysinger via Gdb-patches April 9, 2021, 12:44 a.m. | #1
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

Patch

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