summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authordiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-07-13 17:54:45 +0000
committerdiego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-07-13 17:54:45 +0000
commit21cc99911c385ef4dc6e66ddf695903d787d2d7b (patch)
tree4762900a9daf525283b28e951ff461c65b10a8c5 /configure
parent6cf3b50551a5359ee6b7fafc5a4b86ccb0fe58a7 (diff)
downloadmpv-21cc99911c385ef4dc6e66ddf695903d787d2d7b.tar.bz2
mpv-21cc99911c385ef4dc6e66ddf695903d787d2d7b.tar.xz
Simplify termios test.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23777 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure35
1 files changed, 11 insertions, 24 deletions
diff --git a/configure b/configure
index 4f313ffa99..6384c12241 100755
--- a/configure
+++ b/configure
@@ -3264,40 +3264,27 @@ echores "$_termcap"
echocheck "termios"
+_def_termios='#undef HAVE_TERMIOS'
+_def_termios_h='#undef HAVE_TERMIOS_H'
+_def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
if test "$_termios" = auto ; then
+ _termios=no
+ for _termios_header in "sys/termios.h" "termios.h"; do
cat > $TMPC <<EOF
-#include <sys/termios.h>
-int main(void) { return 0; }
-EOF
- _termios=auto
- cc_check && _termios=yes
- _def_termios_h_name='sys/termios.h'
-fi
-# second test:
-if test "$_termios" = auto ; then
- cat > $TMPC <<EOF
-#include <termios.h>
+#include <$_termios_header>
int main(void) { return 0; }
EOF
- _termios=no
- cc_check && _termios=yes
- _def_termios_h_name='termios.h'
+ cc_check && _termios=yes && _res_comment="$_termios_header" && break
+done
fi
if test "$_termios" = yes ; then
_def_termios='#define HAVE_TERMIOS 1'
- _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
+ if test "$_termios_header" = "termios.h" ; then
_def_termios_h='#define HAVE_TERMIOS_H 1'
+ else
+ _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
fi
- _res_comment="using $_def_termios_h_name"
-else
- _def_termios='#undef HAVE_TERMIOS'
- _def_termios_h_name=''
fi
echores "$_termios"