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