If we don't have ncurses.h don't try to look for libncurses

This commit is contained in:
rocky
2011-11-25 10:22:30 +01:00
parent 9c84c2b7b3
commit 7032a6dbd9

View File

@@ -189,9 +189,13 @@ AC_CHECK_HEADERS(stdarg.h stdbool.h stdio.h sys/cdio.h sys/param.h \
# We have to disable cdda_player unless we have either ncurses.h or # We have to disable cdda_player unless we have either ncurses.h or
# curses.h # curses.h
have_ncurses_h='no'
if test $enable_cdda_player = 'yes' ; then if test $enable_cdda_player = 'yes' ; then
enable_cdda_player='no' enable_cdda_player='no'
AC_CHECK_HEADERS(ncurses.h curses.h, enable_cdda_player='yes') AC_CHECK_HEADERS(ncurses.h,
[enable_cdda_player='yes'; have_ncurses_h='yes'],
[AC_CHECK_HEADERS(curses.h,
enable_cdda_player='yes')])
fi fi
# FreeBSD 4 has getopt in unistd.h. So we include that before # FreeBSD 4 has getopt in unistd.h. So we include that before
@@ -576,12 +580,20 @@ AC_SUBST(CDDB_LIBS)
AC_DEFINE(HAVE_KEYPAD, [], [Define this if your libcurses has keypad]) AC_DEFINE(HAVE_KEYPAD, [], [Define this if your libcurses has keypad])
if test x"$enable_cdda_player" = xyes; then if test x"$enable_cdda_player" = xyes; then
AC_CHECK_LIB(ncurses, mvprintw, if test x"$have_ncurses_h" = xyes; then
[LIBCURSES=ncurses; CDDA_PLAYER_LIBS="$CDDA_PLAYER_LIBS -lncurses"], AC_CHECK_LIB(ncurses, mvprintw,
AC_CHECK_LIB(curses, mvprintw, [LIBCURSES=ncurses; CDDA_PLAYER_LIBS="$CDDA_PLAYER_LIBS -lncurses"],
[LIBCURSES=curses; CDDA_PLAYER_LIBS="$CDDA_PLAYER_LIBS -lcurses"], AC_CHECK_LIB(curses, mvprintw,
[AC_MSG_WARN([Will not build cdda-player - did not find libcurses or libncurses]) [LIBCURSES=curses;
enable_cdda_player=no])) CDDA_PLAYER_LIBS="$CDDA_PLAYER_LIBS -lcurses"],
[AC_MSG_WARN([Will not build cdda-player - did not find libncurses or libcurses])
enable_cdda_player=no]))
else
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])])
fi
if test x"$enable_cdda_player" = xyes; then if test x"$enable_cdda_player" = xyes; then
AC_CHECK_LIB($LIBCURSES, keypad, [HAVE_KEYPAD=yes]) AC_CHECK_LIB($LIBCURSES, keypad, [HAVE_KEYPAD=yes])
fi fi