sim: ppc: move termios probes to top-level

This is the last compile-time logic in the ppc subdir.
This commit is contained in:
Mike Frysinger
2024-01-01 23:57:12 -05:00
parent 0168f1aedf
commit 6bf212a8ac
6 changed files with 217 additions and 275 deletions

View File

@@ -353,9 +353,21 @@
/* Define to 1 if you have the `tcsetpgrp' function. */
#undef HAVE_TCSETPGRP
/* Define if struct termios has c_line. */
#undef HAVE_TERMIOS_CLINE
/* Define to 1 if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
/* Define if struct termios exists. */
#undef HAVE_TERMIOS_STRUCTURE
/* Define if struct termio has c_line. */
#undef HAVE_TERMIO_CLINE
/* Define if struct termio exists. */
#undef HAVE_TERMIO_STRUCTURE
/* Define to 1 if you have the `time' function. */
#undef HAVE_TIME

138
sim/configure vendored
View File

@@ -8810,6 +8810,140 @@ $as_echo "#define HAVE_SYSV_SHM 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct termios" >&5
$as_echo_n "checking for struct termios... " >&6; }
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;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
sim_cv_termios_struct="yes"
else
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: $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 "$sim_cv_termios_struct" = "yes"; then
if ${sim_cv_termios_cline+:} false; then :
$as_echo_n "(cached) " >&6
fi
ac_fn_c_check_member "$LINENO" "struct termios" "c_line" "ac_cv_member_struct_termios_c_line" "
#include <sys/types.h>
#include <sys/termios.h>
"
if test "x$ac_cv_member_struct_termios_c_line" = xyes; then :
sim_cv_termios_cline="yes"
else
sim_cv_termios_cline="no"
fi
if test $sim_cv_termios_cline = yes; then
$as_echo "#define HAVE_TERMIOS_CLINE 1" >>confdefs.h
fi
else
sim_cv_termios_cline=no
fi
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 ${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;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
sim_cv_termio_struct="yes"
else
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: $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
sim_cv_termio_struct=no
fi
if test "$sim_cv_termio_struct" = "yes"; then
if ${sim_cv_termio_cline+:} false; then :
$as_echo_n "(cached) " >&6
fi
ac_fn_c_check_member "$LINENO" "struct termio" "c_line" "ac_cv_member_struct_termio_c_line" "
#include <sys/types.h>
#include <sys/termio.h>
"
if test "x$ac_cv_member_struct_termio_c_line" = xyes; then :
sim_cv_termio_cline="yes"
else
sim_cv_termio_cline="no"
fi
if test $sim_cv_termio_cline = yes; then
$as_echo "#define HAVE_TERMIO_CLINE 1" >>confdefs.h
fi
else
sim_cv_termio_cline=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking type of array argument to getgroups" >&5
$as_echo_n "checking type of array argument to getgroups... " >&6; }
if ${ac_cv_type_getgroups+:} false; then :
@@ -12477,7 +12611,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 12480 "configure"
#line 12614 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12583,7 +12717,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 12586 "configure"
#line 12720 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H

View File

@@ -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

View File

@@ -1,17 +1,5 @@
/* config.in. Generated from configure.ac by autoheader. */
/* Define if struct termios has c_line. */
#undef HAVE_TERMIOS_CLINE
/* Define if struct termios exists. */
#undef HAVE_TERMIOS_STRUCTURE
/* Define if struct termio has c_line. */
#undef HAVE_TERMIO_CLINE
/* Define if struct termio exists. */
#undef HAVE_TERMIO_STRUCTURE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT

192
sim/ppc/configure vendored
View File

@@ -1451,63 +1451,6 @@ fi
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
# ----------------------------------------------------
# Tries to find if the field MEMBER exists in type AGGR, after including
# INCLUDES, setting cache variable VAR accordingly.
ac_fn_c_check_member ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
$as_echo_n "checking for $2.$3... " >&6; }
if eval \${$4+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$5
int
main ()
{
static $2 ac_aggr;
if (ac_aggr.$3)
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$4=yes"
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$5
int
main ()
{
static $2 ac_aggr;
if (sizeof ac_aggr.$3)
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$4=yes"
else
eval "$4=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$4
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_member
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -3221,141 +3164,6 @@ 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 ${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;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
sim_cv_termios_struct="yes"
else
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: $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 "$sim_cv_termios_struct" = "yes"; then
if ${sim_cv_termios_cline+:} false; then :
$as_echo_n "(cached) " >&6
fi
ac_fn_c_check_member "$LINENO" "struct termios" "c_line" "ac_cv_member_struct_termios_c_line" "
#include <sys/types.h>
#include <sys/termios.h>
"
if test "x$ac_cv_member_struct_termios_c_line" = xyes; then :
sim_cv_termios_cline="yes"
else
sim_cv_termios_cline="no"
fi
if test $sim_cv_termios_cline = yes; then
$as_echo "#define HAVE_TERMIOS_CLINE 1" >>confdefs.h
fi
else
sim_cv_termios_cline=no
fi
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 ${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;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
sim_cv_termio_struct="yes"
else
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: $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
sim_cv_termio_struct=no
fi
if test "$sim_cv_termio_struct" = "yes"; then
if ${sim_cv_termio_cline+:} false; then :
$as_echo_n "(cached) " >&6
fi
ac_fn_c_check_member "$LINENO" "struct termio" "c_line" "ac_cv_member_struct_termio_c_line" "
#include <sys/types.h>
#include <sys/termio.h>
"
if test "x$ac_cv_member_struct_termio_c_line" = xyes; then :
sim_cv_termio_cline="yes"
else
sim_cv_termio_cline="no"
fi
if test $sim_cv_termio_cline = yes; then
$as_echo "#define HAVE_TERMIO_CLINE 1" >>confdefs.h
fi
else
sim_cv_termio_cline=no
fi

View File

@@ -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)