diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-02-21 22:15:03 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-02-28 03:14:59 -0500 |
commit | c25ea03dd6a04f33e1d6f089a0d93658a863235b (patch) | |
tree | e1704bc9d43267db4786014a94ddfefe9a4b51b1 /sim/m4 | |
parent | a3e2cc64a6ff8e4f10a9263155a409b736e0e9b8 (diff) | |
download | gdb-c25ea03dd6a04f33e1d6f089a0d93658a863235b.zip gdb-c25ea03dd6a04f33e1d6f089a0d93658a863235b.tar.gz gdb-c25ea03dd6a04f33e1d6f089a0d93658a863235b.tar.bz2 |
sim: set up build-time compiler settings
Some sim dirs were already setting up CFLAGS_FOR_BUILD in inconsistent
ways. Move it to a common place for reuse.
Diffstat (limited to 'sim/m4')
-rw-r--r-- | sim/m4/sim_ac_common.m4 | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sim/m4/sim_ac_common.m4 b/sim/m4/sim_ac_common.m4 index 0f3052a..f67c7f8 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) |