aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2024-01-01 23:42:45 -0500
committerMike Frysinger <vapier@gentoo.org>2024-01-02 00:32:48 -0500
commit0168f1aedf7e797bb6cca302ea4f683e38850bb6 (patch)
tree7ab752f1d3db62e24025c4f58c4f875366fb9935 /sim
parent1a9f6039fb28ce17f9481af482f8af1fdb4cf3e6 (diff)
downloadgdb-0168f1aedf7e797bb6cca302ea4f683e38850bb6.zip
gdb-0168f1aedf7e797bb6cca302ea4f683e38850bb6.tar.gz
gdb-0168f1aedf7e797bb6cca302ea4f683e38850bb6.tar.bz2
sim: ppc: switch to AC_CACHE_CHECK
This macro replaces the AC_MSG_CHECKING+AC_CACHE_VAL+AC_MSG_RESULT which reduces the boilerplate in here a little bit.
Diffstat (limited to 'sim')
-rwxr-xr-xsim/ppc/configure66
-rw-r--r--sim/ppc/configure.ac60
2 files changed, 65 insertions, 61 deletions
diff --git a/sim/ppc/configure b/sim/ppc/configure
index 0e3c918..b64e4c4 100755
--- a/sim/ppc/configure
+++ b/sim/ppc/configure
@@ -3220,46 +3220,48 @@ ac_config_headers="$ac_config_headers config.h:config.in"
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct termios" >&5
$as_echo_n "checking for struct termios... " >&6; }
-
-if ${ac_cv_termios_struct+:} false; then :
+if ${sim_cv_termios_struct+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+
#include <sys/types.h>
#include <sys/termios.h>
int
main ()
{
-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;
+
+ 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;
+
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_termios_struct=yes
+ sim_cv_termios_struct="yes"
else
- ac_cv_termios_struct=no
+ sim_cv_termios_struct="no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_termios_struct" >&5
-$as_echo "$ac_cv_termios_struct" >&6; }
-if test $ac_cv_termios_struct = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sim_cv_termios_struct" >&5
+$as_echo "$sim_cv_termios_struct" >&6; }
+if test $sim_cv_termios_struct = yes; then
$as_echo "#define HAVE_TERMIOS_STRUCTURE 1" >>confdefs.h
fi
-if test "$ac_cv_termios_struct" = "yes"; then
+if test "$sim_cv_termios_struct" = "yes"; then
if ${sim_cv_termios_cline+:} false; then :
$as_echo_n "(cached) " >&6
fi
@@ -3284,49 +3286,51 @@ else
sim_cv_termios_cline=no
fi
-if test "$ac_cv_termios_struct" != "yes"; then
+if test "$sim_cv_termios_struct" != "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct termio" >&5
$as_echo_n "checking for struct termio... " >&6; }
- if ${ac_cv_termio_struct+:} false; then :
+if ${sim_cv_termio_struct+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+
#include <sys/types.h>
#include <sys/termio.h>
int
main ()
{
-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;
+
+ 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;
+
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_termio_struct=yes
+ sim_cv_termio_struct="yes"
else
- ac_cv_termio_struct=no
+ sim_cv_termio_struct="no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_termio_struct" >&5
-$as_echo "$ac_cv_termio_struct" >&6; }
- if test $ac_cv_termio_struct = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $sim_cv_termio_struct" >&5
+$as_echo "$sim_cv_termio_struct" >&6; }
+ if test $sim_cv_termio_struct = yes; then
$as_echo "#define HAVE_TERMIO_STRUCTURE 1" >>confdefs.h
fi
else
- ac_cv_termio_struct=no
+ sim_cv_termio_struct=no
fi
-if test "$ac_cv_termio_struct" = "yes"; then
+if test "$sim_cv_termio_struct" = "yes"; then
if ${sim_cv_termio_cline+:} false; then :
$as_echo_n "(cached) " >&6
fi
diff --git a/sim/ppc/configure.ac b/sim/ppc/configure.ac
index 8810ff2..7b4b998 100644
--- a/sim/ppc/configure.ac
+++ b/sim/ppc/configure.ac
@@ -289,23 +289,23 @@ AC_CONFIG_HEADER(config.h:config.in)
dnl Figure out what type of termio/termios support there is
-AC_MSG_CHECKING(for struct termios)
-AC_CACHE_VAL(ac_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;],
-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
+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 "$ac_cv_termios_struct" = "yes"; then
+if test "$sim_cv_termios_struct" = "yes"; then
AC_CACHE_VAL([sim_cv_termios_cline])
AC_CHECK_MEMBER(
[struct termios.c_line],
@@ -321,27 +321,27 @@ else
sim_cv_termios_cline=no
fi
-if test "$ac_cv_termios_struct" != "yes"; then
- AC_MSG_CHECKING(for struct termio)
- AC_CACHE_VAL(ac_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;],
-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
+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
- ac_cv_termio_struct=no
+ sim_cv_termio_struct=no
fi
-if test "$ac_cv_termio_struct" = "yes"; then
+if test "$sim_cv_termio_struct" = "yes"; then
AC_CACHE_VAL([sim_cv_termio_cline])
AC_CHECK_MEMBER(
[struct termio.c_line],