From patchwork Tue Jan 2 05:36:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 83106 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3D4C63858281 for ; Tue, 2 Jan 2024 06:38:10 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id D55723858412 for ; Tue, 2 Jan 2024 06:36:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D55723858412 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D55723858412 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704177415; cv=none; b=DD82Ny9e+x1xMAvMagfMhXH3X7vKpPqpkpjEk9ik+JpuD/D3UnHrsvSzNcxFo1Yd/Q6oeDM1bY0b5cyrXMbKEyNuadOHDbpEON6hCMfSVg8/0OPLn7J+7o6xZHECaunGBLfosphPYkKB6qfVaILc/UqQvt2LWh3Mmz+gCI7xqbY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704177415; c=relaxed/simple; bh=Enib8Gc9nyPwAEXSPOsmBa9TWHa6caxd0hQLpgfgiGE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=WQHJ8ks3EglbhgBxEJxnE4Neys+02oJ59mCUJN39DKGKGu3xe1DGsEWIjU9+ALxjb7pfRfOWfKxBvdTPgiKddzv18heI0gg86pCzANskjlP4L/YFd9EmffsgrEkJNdMf/0mTXA/tpSedOuIORdWmubkJ23dHo2o7TVqfB3982V0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 9A94C3408DD; Tue, 2 Jan 2024 06:36:52 +0000 (UTC) From: Mike Frysinger 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 Message-ID: <20240102053639.28290-6-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240102053639.28290-1-vapier@gentoo.org> References: <20240102053639.28290-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.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 +#include ], [ + 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 +#include +]) + 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 +#include ], [ + 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 +#include +]) + 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 -#include ], [ - 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 -#include -]) - 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 -#include ], [ - 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 -#include -]) - 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)