public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH/submitted 06/10] sim: ppc: move termios probes to top-level
Date: Tue,  2 Jan 2024 00:36:34 -0500	[thread overview]
Message-ID: <20240102053639.28290-6-vapier@gentoo.org> (raw)
In-Reply-To: <20240102053639.28290-1-vapier@gentoo.org>

This is the last compile-time logic in the ppc subdir.
---
 sim/config.h.in           |  12 +++
 sim/configure             | 138 ++++++++++++++++++++++++++-
 sim/m4/sim_ac_platform.m4 |  69 ++++++++++++++
 sim/ppc/config.in         |  12 ---
 sim/ppc/configure         | 192 --------------------------------------
 sim/ppc/configure.ac      |  69 --------------
 6 files changed, 217 insertions(+), 275 deletions(-)

diff --git a/sim/m4/sim_ac_platform.m4 b/sim/m4/sim_ac_platform.m4
index 6f3e48f63dd2..f523f03518bb 100644
--- a/sim/m4/sim_ac_platform.m4
+++ b/sim/m4/sim_ac_platform.m4
@@ -213,6 +213,75 @@ AS_IF([test x"$sim_cv_sysv_shm" = x"yes"], [dnl
   AC_DEFINE(HAVE_SYSV_SHM, 1, [Define if System V shared memory is supported])
 ])
 
+dnl Figure out what type of termio/termios support there is
+AC_CACHE_CHECK([for struct termios],
+  [sim_cv_termios_struct],
+  [AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/termios.h>], [
+  static struct termios x;
+  x.c_iflag = 0;
+  x.c_oflag = 0;
+  x.c_cflag = 0;
+  x.c_lflag = 0;
+  x.c_cc[NCCS] = 0;
+], [sim_cv_termios_struct="yes"], [sim_cv_termios_struct="no"])])
+if test $sim_cv_termios_struct = yes; then
+  AC_DEFINE([HAVE_TERMIOS_STRUCTURE], 1, [Define if struct termios exists.])
+fi
+
+if test "$sim_cv_termios_struct" = "yes"; then
+  AC_CACHE_VAL([sim_cv_termios_cline])
+  AC_CHECK_MEMBER(
+    [struct termios.c_line],
+    [sim_cv_termios_cline="yes"],
+    [sim_cv_termios_cline="no"], [
+#include <sys/types.h>
+#include <sys/termios.h>
+])
+  if test $sim_cv_termios_cline = yes; then
+    AC_DEFINE([HAVE_TERMIOS_CLINE], 1, [Define if struct termios has c_line.])
+  fi
+else
+  sim_cv_termios_cline=no
+fi
+
+if test "$sim_cv_termios_struct" != "yes"; then
+  AC_CACHE_CHECK([for struct termio],
+    [sim_cv_termio_struct],
+    [AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/termio.h>], [
+  static struct termio x;
+  x.c_iflag = 0;
+  x.c_oflag = 0;
+  x.c_cflag = 0;
+  x.c_lflag = 0;
+  x.c_cc[NCC] = 0;
+], [sim_cv_termio_struct="yes"], [sim_cv_termio_struct="no"])])
+  if test $sim_cv_termio_struct = yes; then
+    AC_DEFINE([HAVE_TERMIO_STRUCTURE], 1, [Define if struct termio exists.])
+  fi
+else
+  sim_cv_termio_struct=no
+fi
+
+if test "$sim_cv_termio_struct" = "yes"; then
+  AC_CACHE_VAL([sim_cv_termio_cline])
+  AC_CHECK_MEMBER(
+    [struct termio.c_line],
+    [sim_cv_termio_cline="yes"],
+    [sim_cv_termio_cline="no"], [
+#include <sys/types.h>
+#include <sys/termio.h>
+])
+  if test $sim_cv_termio_cline = yes; then
+    AC_DEFINE([HAVE_TERMIO_CLINE], 1, [Define if struct termio has c_line.])
+  fi
+else
+  sim_cv_termio_cline=no
+fi
+
 dnl Types used by common code
 AC_TYPE_GETGROUPS
 AC_TYPE_MODE_T
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 7b4b998e9487..b19be90ec33b 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -288,75 +288,6 @@ fi],[sim_xor_endian=""])dnl
 AC_CONFIG_HEADER(config.h:config.in)
 
 
-dnl Figure out what type of termio/termios support there is
-AC_CACHE_CHECK([for struct termios],
-  [sim_cv_termios_struct],
-  [AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/termios.h>], [
-  static struct termios x;
-  x.c_iflag = 0;
-  x.c_oflag = 0;
-  x.c_cflag = 0;
-  x.c_lflag = 0;
-  x.c_cc[NCCS] = 0;
-], [sim_cv_termios_struct="yes"], [sim_cv_termios_struct="no"])])
-if test $sim_cv_termios_struct = yes; then
-  AC_DEFINE([HAVE_TERMIOS_STRUCTURE], 1, [Define if struct termios exists.])
-fi
-
-if test "$sim_cv_termios_struct" = "yes"; then
-  AC_CACHE_VAL([sim_cv_termios_cline])
-  AC_CHECK_MEMBER(
-    [struct termios.c_line],
-    [sim_cv_termios_cline="yes"],
-    [sim_cv_termios_cline="no"], [
-#include <sys/types.h>
-#include <sys/termios.h>
-])
-  if test $sim_cv_termios_cline = yes; then
-    AC_DEFINE([HAVE_TERMIOS_CLINE], 1, [Define if struct termios has c_line.])
-  fi
-else
-  sim_cv_termios_cline=no
-fi
-
-if test "$sim_cv_termios_struct" != "yes"; then
-  AC_CACHE_CHECK([for struct termio],
-    [sim_cv_termio_struct],
-    [AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/termio.h>], [
-  static struct termio x;
-  x.c_iflag = 0;
-  x.c_oflag = 0;
-  x.c_cflag = 0;
-  x.c_lflag = 0;
-  x.c_cc[NCC] = 0;
-], [sim_cv_termio_struct="yes"], [sim_cv_termio_struct="no"])])
-  if test $sim_cv_termio_struct = yes; then
-    AC_DEFINE([HAVE_TERMIO_STRUCTURE], 1, [Define if struct termio exists.])
-  fi
-else
-  sim_cv_termio_struct=no
-fi
-
-if test "$sim_cv_termio_struct" = "yes"; then
-  AC_CACHE_VAL([sim_cv_termio_cline])
-  AC_CHECK_MEMBER(
-    [struct termio.c_line],
-    [sim_cv_termio_cline="yes"],
-    [sim_cv_termio_cline="no"], [
-#include <sys/types.h>
-#include <sys/termio.h>
-])
-  if test $sim_cv_termio_cline = yes; then
-    AC_DEFINE([HAVE_TERMIO_CLINE], 1, [Define if struct termio has c_line.])
-  fi
-else
-  sim_cv_termio_cline=no
-fi
-
 AC_SUBST(sim_line_nr)
 AC_SUBST(sim_opcode)
 AC_SUBST(sim_switch)
-- 
2.43.0


  parent reply	other threads:[~2024-01-02  6:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02  5:36 [PATCH/submitted 01/10] sim: ppc: move long long test " Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 02/10] sim: ppc: move struct statfs " Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 03/10] sim: ppc: move termio defines to config.h Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 04/10] sim: ppc: switch struct member checks to AC_CHECK_MEMBER Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 05/10] sim: ppc: switch to AC_CACHE_CHECK Mike Frysinger
2024-01-02  5:36 ` Mike Frysinger [this message]
2024-01-02  5:36 ` [PATCH/submitted 07/10] sim: ppc: stop including headers from gdb/ Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 08/10] sim: ppc: drop custom config.h header Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 09/10] sim: ppc: drop configure compiler checks Mike Frysinger
2024-01-02  5:36 ` [PATCH/submitted 10/10] sim: ppc: move defines.h generation to the top-level Mike Frysinger
2024-01-09 14:33 ` [PATCH/submitted 01/10] sim: ppc: move long long test to top-level Tom Tromey
2024-01-09 17:50   ` Mike Frysinger
2024-01-09 19:05     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240102053639.28290-6-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).