public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: set up build-time compiler settings
@ 2021-02-22  4:44 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-02-22  4:44 UTC (permalink / raw)
  To: gdb-patches

Some sim dirs were already setting up CFLAGS_FOR_BUILD in inconsistent
ways.  Move it to a common place for reuse.
---
 sim/m4/sim_ac_common.m4 | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/sim/m4/sim_ac_common.m4 b/sim/m4/sim_ac_common.m4
index 0f3052abec37..f67c7f8be937 100644
--- a/sim/m4/sim_ac_common.m4
+++ b/sim/m4/sim_ac_common.m4
@@ -30,15 +30,16 @@ AC_C_BIGENDIAN
 AC_ARG_PROGRAM
 AC_PROG_INSTALL
 
-# Put a plausible default for CC_FOR_BUILD in Makefile.
-if test -z "$CC_FOR_BUILD"; then
-  if test "x$cross_compiling" = "xno"; then
-    CC_FOR_BUILD='$(CC)'
-  else
-    CC_FOR_BUILD=gcc
-  fi
+dnl Setup toolchain settings for build-time tools..
+if test "x$cross_compiling" = "xno"; then
+  : "${CC_FOR_BUILD:=\$(CC)}"
+  : "${CFLAGS_FOR_BUILD:=\$(CFLAGS)}"
+else
+  : "${CC_FOR_BUILD:=gcc}"
+  : "${CFLAGS_FOR_BUILD:=-g -O}"
 fi
 AC_SUBST(CC_FOR_BUILD)
+AC_SUBST(CFLAGS_FOR_BUILD)
 
 AC_SUBST(CFLAGS)
 AC_CHECK_TOOL(AR, ar)
-- 
2.30.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-22  4:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22  4:44 [PATCH] sim: set up build-time compiler settings 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).