From a691a9a1b1f1c5d0bbee31c7b5a0f1f115d83eec Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 22 Apr 2005 01:54:13 +0000 Subject: [PATCH] Add test to see if curses has keypad(). May break on Solaris - we'll see. Fix from discussion with Steve Schultz --- configure.ac | 16 +++++++++++----- src/cdda-player.c | 4 +++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 68f996a6..45ffb342 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ define(RELEASE_NUM, 73) define(CDIO_VERSION_STR, 0.$1) AC_PREREQ(2.52) -AC_REVISION([$Id: configure.ac,v 1.153 2005/04/14 00:35:03 rocky Exp $])dnl +AC_REVISION([$Id: configure.ac,v 1.154 2005/04/22 01:54:13 rocky Exp $])dnl AC_INIT(libcdio, CDIO_VERSION_STR(RELEASE_NUM)) AC_CONFIG_SRCDIR(src/cd-info.c) @@ -509,11 +509,17 @@ fi AC_SUBST(CDDB_LIBS) +AC_DEFINE(HAVE_KEYPAD, [], [Define this if your libcurses has keypad]) if test x$enable_cdda_player = xyes; then - AC_CHECK_LIB(curses, mvprintw, [CDDA_PLAYER_LIBS="$CDDA_PLAYER_LIBS -lcurses"], - AC_CHECK_LIB(ncurses, mvprintw, [CDDA_PLAYER_LIBS="$CDDA_PLAYER_LIBS -lncurses"], - [AC_MSG_WARN([Will not build cdda-player - did not find libcurses or libncurses]) - enable_cdda_player=no])) + AC_CHECK_LIB(ncurses, mvprintw, + [LIBCURSES=ncurses; CDDA_PLAYER_LIBS="$CDDA_PLAYER_LIBS -lncurses"], + AC_CHECK_LIB(curses, mvprintw, + [LIBCURSES=curses; CDDA_PLAYER_LIBS="$CDDA_PLAYER_LIBS -lcurses"], + [AC_MSG_WARN([Will not build cdda-player - did not find libcurses or libncurses]) + enable_cdda_player=no])) + if test x$enable_cdda_player = xyes; then + AC_CHECK_LIB($LIBCURSES, keypad, [HAVE_KEYPAD=yes]) + fi fi AC_SUBST(CDDA_PLAYER_LIBS) diff --git a/src/cdda-player.c b/src/cdda-player.c index f56c0eeb..3263a4ba 100644 --- a/src/cdda-player.c +++ b/src/cdda-player.c @@ -1,5 +1,5 @@ /* - $Id: cdda-player.c,v 1.33 2005/04/17 06:19:48 rocky Exp $ + $Id: cdda-player.c,v 1.34 2005/04/22 01:54:13 rocky Exp $ Copyright (C) 2005 Rocky Bernstein @@ -203,7 +203,9 @@ tty_raw() initscr(); cbreak(); noecho(); +#ifdef HAVE_KEYPAD keypad(stdscr,1); +#endif refresh(); }