diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2007-10-26 21:59:56 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-10-26 21:59:56 +0000 |
commit | 7f8e2298181fcbf3399eb9bde1564c1fe2fe9df3 (patch) | |
tree | 5519c693b2684c85b642f3b600eb8a83a862bd9b /configure.ac | |
parent | 26461dcc1b03fa0ad47c7abbec4b8999f1fe5a28 (diff) | |
download | zsh-7f8e2298181fcbf3399eb9bde1564c1fe2fe9df3.tar.gz zsh-7f8e2298181fcbf3399eb9bde1564c1fe2fe9df3.tar.xz zsh-7f8e2298181fcbf3399eb9bde1564c1fe2fe9df3.zip |
24024: add zcurses input with keypad handling
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index d7483e1fb..ebd339630 100644 --- a/configure.ac +++ b/configure.ac @@ -1134,7 +1134,7 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \ brk sbrk \ pathconf sysconf \ tgetent tigetflag tigetnum tigetstr setupterm initscr \ - setcchar waddwstr \ + setcchar waddwstr wget_wch \ pcre_compile pcre_study pcre_exec \ nl_langinfo \ erand48 open_memstream \ @@ -1354,6 +1354,46 @@ zsh_cv_path_errno_h="$ERRNO_H" ERRNO_H="$zsh_cv_path_errno_h" AC_SUBST(ERRNO_H)dnl +dnl Where are curses key definitions located? Need for keypad() mode. +AC_CACHE_CHECK(where curses key definitions are located, zsh_cv_path_curses_keys_h, +[dnl This is an identical trick to errno.h, except we use ncurses.h +dnl if we can. +if test x$ac_cv_header_ncurses_h = xyes; then + echo "#include <ncurses.h>" >nametmp.c +else + if test x$ac_cv_header_curses_h = xyes; then + echo "#include <curses.h>" >nametmp.c + else + echo >nametmp.c + fi +fi +curses_list="`$CPP nametmp.c | +sed -n -e 's/^#line[ ].*\"\(.*\)\"/\1/p' \ + -e 's/^#[ 0-9].*\"\(.*\)\"/\1/p' | +sed 's/\\\\\\\\/\//g' | +$AWK '{ if ($1 ~ /\.h/) files[[$1]] = $1 } + END { for (var in files) print var }'`" +rm -f nametmp.c +if x"$curses_list" = x; then + echo Failed + exit 1 +fi +for CURSES_TRY_H in $curses_list /dev/null +do + nkeys=`test -f $CURSES_TRY_H && \ + $EGREP '#[ ]*define[ ][ ]*KEY_' $CURSES_TRY_H | \ + wc -l | sed 's/[ ]//g'` + if test "x$nkeys" != x && test "$nkeys" -ge 10 + then + CURSES_KEYS_H=$CURSES_TRY_H + break + fi +done +zsh_cv_path_curses_keys_h="$CURSES_KEYS_H" +]) +CURSES_KEYS_H="$zsh_cv_path_curses_keys_h" +AC_SUBST(CURSES_KEYS_H)dnl + dnl ----------------------------------------------------- dnl Look for the file containing the RLIMIT_* definitions dnl ----------------------------------------------------- |