[PATCH/submitted,03/10] sim: ppc: move termio defines to config.h

Message ID 20240102053639.28290-3-vapier@gentoo.org
State New
Headers
Series [PATCH/submitted,01/10] sim: ppc: move long long test to top-level |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply

Commit Message

Mike Frysinger Jan. 2, 2024, 5:36 a.m. UTC
  Move the defines from explicit -D options to config.h defines to simplify
the build and make it easier to move to the top-level configure.
---
 sim/ppc/Makefile.in  |  2 --
 sim/ppc/config.in    | 12 ++++++++++++
 sim/ppc/configure    | 19 ++++++++++++-------
 sim/ppc/configure.ac | 10 ++++------
 4 files changed, 28 insertions(+), 15 deletions(-)
  

Patch

diff --git a/sim/ppc/Makefile.in b/sim/ppc/Makefile.in
index 26a1e7cfd28e..8eaad7424c44 100644
--- a/sim/ppc/Makefile.in
+++ b/sim/ppc/Makefile.in
@@ -68,7 +68,6 @@  TIMEBASE_CFLAGS = @sim_timebase@
 FLOAT_CFLAGS = @sim_float@
 MONITOR_CFLAGS = @sim_monitor@
 MODEL_CFLAGS = @sim_model@ @sim_default_model@ @sim_model_issue@
-TERMIO_CFLAGS = @sim_termio@
 SWITCH_CFLAGS = @sim_switch@
 CONFIG_CFLAGS = \
   $(SMP_CFLAGS) \
@@ -78,7 +77,6 @@  CONFIG_CFLAGS = \
   $(FLOAT_CFLAGS) \
   $(MONITOR_CFLAGS) \
   $(MODEL_CFLAGS) \
-  $(TERMIO_CFLAGS) \
   $(SWITCH_CFLAGS)
 SIM_FPU_CFLAGS = -DHAVE_COMMON_FPU -I../common -I${srcdir}/../common
 
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 13db9fc4791e..e8354791a711 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -289,7 +289,6 @@  AC_CONFIG_HEADER(config.h:config.in)
 
 
 dnl Figure out what type of termio/termios support there is
-sim_termio=""
 AC_MSG_CHECKING(for struct termios)
 AC_CACHE_VAL(ac_cv_termios_struct,
 [AC_TRY_COMPILE([#include <sys/types.h>
@@ -303,7 +302,7 @@  AC_CACHE_VAL(ac_cv_termios_struct,
 ac_cv_termios_struct=yes, ac_cv_termios_struct=no)])
 AC_MSG_RESULT($ac_cv_termios_struct)
 if test $ac_cv_termios_struct = yes; then
-  sim_termio="$sim_termio -DHAVE_TERMIOS_STRUCTURE"
+  AC_DEFINE([HAVE_TERMIOS_STRUCTURE], 1, [Define if struct termios exists.])
 fi
 
 if test "$ac_cv_termios_struct" = "yes"; then
@@ -316,7 +315,7 @@  if test "$ac_cv_termios_struct" = "yes"; then
 
   AC_MSG_RESULT($ac_cv_termios_cline)
   if test $ac_cv_termios_cline = yes; then
-    sim_termio="$sim_termio -DHAVE_TERMIOS_CLINE"
+    AC_DEFINE([HAVE_TERMIOS_CLINE], 1, [Define if struct termios has c_line.])
   fi
 else
   ac_cv_termios_cline=no
@@ -336,7 +335,7 @@  if test "$ac_cv_termios_struct" != "yes"; then
 ac_cv_termio_struct=yes, ac_cv_termio_struct=no)])
   AC_MSG_RESULT($ac_cv_termio_struct)
   if test $ac_cv_termio_struct = yes; then
-    sim_termio="$sim_termio -DHAVE_TERMIO_STRUCTURE"
+    AC_DEFINE([HAVE_TERMIO_STRUCTURE], 1, [Define if struct termio exists.])
   fi
 else
   ac_cv_termio_struct=no
@@ -352,7 +351,7 @@  if test "$ac_cv_termio_struct" = "yes"; then
 
   AC_MSG_RESULT($ac_cv_termio_cline)
   if test $ac_cv_termio_cline = yes; then
-    sim_termio="$sim_termio -DHAVE_TERMIO_CLINE"
+    AC_DEFINE([HAVE_TERMIO_CLINE], 1, [Define if struct termio has c_line.])
   fi
 else
   ac_cv_termio_cline=no
@@ -378,7 +377,6 @@  AC_SUBST(sim_monitor)
 AC_SUBST(sim_model)
 AC_SUBST(sim_default_model)
 AC_SUBST(sim_model_issue)
-AC_SUBST(sim_termio)
 
 AC_OUTPUT(Makefile,
 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])