diff options
author | DJ Delorie <dj@redhat.com> | 2009-08-14 04:24:30 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2009-08-14 04:24:30 +0000 |
commit | 340cf1cfb699a8b49b8a93967a3ac5c23dd00453 (patch) | |
tree | c6c9d6571ec7afca88c7c2fd07f51a0877fef243 /sim/m32c/mem.c | |
parent | a109e2f5583d186cb85203cf65900b6dd138993d (diff) | |
download | gdb-340cf1cfb699a8b49b8a93967a3ac5c23dd00453.zip gdb-340cf1cfb699a8b49b8a93967a3ac5c23dd00453.tar.gz gdb-340cf1cfb699a8b49b8a93967a3ac5c23dd00453.tar.bz2 |
* 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.
Diffstat (limited to 'sim/m32c/mem.c')
-rw-r--r-- | sim/m32c/mem.c | 16 |
1 files changed, 16 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>. */ +#include "config.h" #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -26,8 +27,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <sys/time.h> #include <sys/types.h> #include <unistd.h> +#ifdef HAVE_SYS_SELECT_H #include <sys/select.h> +#endif +#ifdef HAVE_TERMIOS_H #include <termios.h> +#endif #include "mem.h" #include "cpu.h" @@ -48,9 +53,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ 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 ("=>"); |