Browse Source

configure: Support --with-curses=FOO to look for curses implementation in libFOO

Luke Dashjr 13 years ago
parent
commit
1e02306f21
1 changed files with 9 additions and 2 deletions
  1. 9 2
      configure.ac

+ 9 - 2
configure.ac

@@ -315,10 +315,17 @@ if test "x$curses" = "xno"; then
 	cursesmsg='User specified --without-curses. TUI support DISABLED'
 	cursesmsg='User specified --without-curses. TUI support DISABLED'
 else
 else
 	orig_libs="$LIBS"
 	orig_libs="$LIBS"
+	if test "x${curses}" = "xyes"; then
+		prefer=''
+		preferl=''
+	else
+		prefer="${curses}"
+		preferl="${curses} ${curses}6 ${curses}5"
+	fi
 	if test "x$cross_compiling" != "xyes"; then
 	if test "x$cross_compiling" != "xyes"; then
 		AC_MSG_CHECKING([for best native curses library])
 		AC_MSG_CHECKING([for best native curses library])
 		orig_cflags="$CFLAGS"
 		orig_cflags="$CFLAGS"
-		for curses_lib in ncurses{w,}{,6,5}; do
+		for curses_lib in ${preferl} ncurses{w,}{,6,5}; do
 			if ! ${curses_lib}-config --cflags >/dev/null 2>/dev/null; then
 			if ! ${curses_lib}-config --cflags >/dev/null 2>/dev/null; then
 				continue
 				continue
 			fi
 			fi
@@ -347,7 +354,7 @@ else
 	fi
 	fi
 	if test "x$curses" != "xyes"; then
 	if test "x$curses" != "xyes"; then
 
 
-	AC_SEARCH_LIBS(addstr, ncursesw ncurses pdcurses, [
+	AC_SEARCH_LIBS(addstr, ${prefer} ncursesw ncurses pdcurses, [
 		curses=yes
 		curses=yes
 		cursesmsg="FOUND: ${ac_cv_search_addstr}"
 		cursesmsg="FOUND: ${ac_cv_search_addstr}"
 		cursesmsg="${cursesmsg/-l/}"
 		cursesmsg="${cursesmsg/-l/}"