diff options
| -rwxr-xr-x | configure | 30 |
1 files changed, 29 insertions, 1 deletions
@@ -462,11 +462,39 @@ int main(void) { EOF if $XCC _curses.c -o _curses -lcurses 2>&3; then LIB_CURSES=-lcurses + echo "$LIB_CURSES" fi rm -f _curses.c _curses fi + +# ncurses may have curs_set in libtinfo and not libcurses. +# This is a very poor design as other curses implementations +# do not have this limitation. +if [ -n "$LIB_CURSES" ]; then + printf "Testing for curs_set in $LIB_CURSES ... " + cat <<EOF >_curses.c +#include <curses.h> +int main(void) { + curs_set(1); + return 0; +} +EOF + if $XCC _curses.c -o _curses $LIB_CURSES 2>&3; then + echo "yes" + else + if $XCC _curses.c -o _curses $LIB_CURSES -ltinfo 2>&3; then + echo "no (libtinfo)" + LIB_CURSES="$LIB_CURSES -ltinfo" + else + echo "no and not found" + [ "$WITH_CURSES" = yes ] && exit 1 + LIB_CURSES= + fi + fi + rm -f _curses.c _curses +fi + if [ -n "$LIB_CURSES" ]; then - echo "$LIB_CURSES" echo "LIB_CURSES= $LIB_CURSES" >>$CONFIG_MK UI="dhcpcd-curses${UI:+ }$UI" |
