From 340cf1cfb699a8b49b8a93967a3ac5c23dd00453 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Fri, 14 Aug 2009 04:24:30 +0000 Subject: * configure.in: Check for sys/select.h, termios.h, sys/socket.h, netinet/in.h, and netinet/tcp.h. * configure: Regenerate. * config.in: Add those headers. * main.c: Check for them. (setup_tcp_console): Disable if no networking. (main): Note missing networking or termios. * mem.c: Check for those headers. (stdin_ready): Disable if no termios. (m32c_sim_restore_console): Disable if no termios. (mem_get_byte): Disable console input if no termios. --- sim/m32c/mem.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'sim/m32c/mem.c') diff --git a/sim/m32c/mem.c b/sim/m32c/mem.c index 51bb0ab..a8630b1 100644 --- a/sim/m32c/mem.c +++ b/sim/m32c/mem.c @@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include "config.h" #include #include #include @@ -26,8 +27,12 @@ along with this program. If not, see . */ #include #include #include +#ifdef HAVE_SYS_SELECT_H #include +#endif +#ifdef HAVE_TERMIOS_H #include +#endif #include "mem.h" #include "cpu.h" @@ -48,9 +53,13 @@ along with this program. If not, see . */ static unsigned char **pt[L1_LEN]; +#ifdef HAVE_TERMIOS_H int m32c_console_ifd = 0; +#endif int m32c_console_ofd = 1; +#ifdef HAVE_TERMIOS_H int m32c_use_raw_console = 0; +#endif #ifdef TIMER_A Timer_A timer_a; @@ -374,6 +383,7 @@ mem_get_pc () return *m; } +#ifdef HAVE_TERMIOS_H static int console_raw = 0; static struct termios oattr; @@ -399,6 +409,7 @@ m32c_sim_restore_console () tcsetattr (m32c_console_ifd, TCSANOW, &oattr); console_raw = 0; } +#endif static unsigned char mem_get_byte (int address) @@ -408,6 +419,7 @@ mem_get_byte (int address) m = mem_ptr (address); switch (address) { +#ifdef HAVE_TERMIOS_H case 0x2ed: /* m32c uart1c1 */ case 0x3ad: /* m16c uart1c1 */ @@ -447,6 +459,7 @@ mem_get_byte (int address) } return c; } +#endif #ifdef TIMER_A case 0x346: /* TA0low */ @@ -457,6 +470,9 @@ mem_get_byte (int address) return timer_a.count; #endif + default: + /* In case both cases above are not included. */ + ; } S ("=>"); -- cgit v1.1