# HG changeset patch # User alex # Date 1007392923 0 # Node ID 310c0b9bea21e56dd47efcbfa5d51826f459c1a0 # Parent 542f7c228e3849193e70ab6977b40c8631fceb04 detect termios.h if no sys/termios.h (qnx getch2 support working) diff -r 542f7c228e38 -r 310c0b9bea21 configure --- a/configure Mon Dec 03 14:37:26 2001 +0000 +++ b/configure Mon Dec 03 15:22:03 2001 +0000 @@ -1216,13 +1216,34 @@ EOF _termios=no cc_check && _termios=yes + _def_termios_h_name='sys/termios.h' fi +# second test: +if test "$_termios" = no ; then + cat > $TMPC < +int main(void) { return 0; } +EOF + _termios=no + cc_check && _termios=yes + _def_termios_h_name='termios.h' +fi + if test "$_termios" = yes ; then _def_termios='#define HAVE_TERMIOS 1' - else + _def_termios_h='#undef HAVE_TERMIOS_H' + _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H' + + if test "$_def_termios_h_name" = 'sys/termios.h' ; then + _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1' + elif test "$_def_termios_h_name" = 'termios.h' ; then + _def_termios_h='#define HAVE_TERMIOS_H 1' + fi +else _def_termios='#undef HAVE_TERMIOS' + _def_termios_h_name='' fi -echores "$_termios" +echores "$_termios (using: $_def_termios_h_name)" echocheck "shm" @@ -2855,6 +2876,8 @@ /* termios flag for getch2.c */ $_def_termios +$_def_termios_h +$_def_termios_sys_h /* enable PNG support */ $_def_png diff -r 542f7c228e38 -r 310c0b9bea21 linux/getch2.c --- a/linux/getch2.c Mon Dec 03 14:37:26 2001 +0000 +++ b/linux/getch2.c Mon Dec 03 15:22:03 2001 +0000 @@ -16,9 +16,16 @@ #ifdef USE_IOCTL #include #endif + #ifdef HAVE_TERMIOS +#ifdef HAVE_TERMIOS_H +#include +#endif +#ifdef HAVE_TERMIOS_SYS_H #include #endif +#endif + #include #include "keycodes.h"