diff -r 607277e3cdab -r 7710d81d15e7 kconfig/lxdialog/check-lxdialog.sh --- a/kconfig/lxdialog/check-lxdialog.sh Tue Jul 22 09:16:07 2008 +0000 +++ b/kconfig/lxdialog/check-lxdialog.sh Thu Jan 29 18:53:32 2009 +0000 @@ -4,21 +4,15 @@ # What library to link ldflags() { - $cc -print-file-name=libncursesw.so | grep -q / - if [ $? -eq 0 ]; then - echo '-lncursesw' - exit - fi - $cc -print-file-name=libncurses.so | grep -q / - if [ $? -eq 0 ]; then - echo '-lncurses' - exit - fi - $cc -print-file-name=libcurses.so | grep -q / - if [ $? -eq 0 ]; then - echo '-lcurses' - exit - fi + for ext in so a dylib ; do + for lib in ncursesw ncurses curses ; do + $cc -print-file-name=lib${lib}.${ext} | grep -q / + if [ $? -eq 0 ]; then + echo "-l${lib}" + exit + fi + done + done exit 1 } @@ -42,14 +36,18 @@ # Check if we can link to ncurses check() { - echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null - if [ $? -ne 0 ]; then - echo " *** Unable to find the ncurses libraries." 1>&2 - echo " *** make menuconfig require the ncurses libraries" 1>&2 - echo " *** " 1>&2 - echo " *** Install ncurses (ncurses-devel) and try again" 1>&2 - echo " *** " 1>&2 - exit 1 + $cc -xc - -o $tmp 2>/dev/null <<'EOF' +#include CURSES_LOC +main() {} +EOF + if [ $? != 0 ]; then + echo " *** Unable to find the ncurses libraries or the" 1>&2 + echo " *** required header files." 1>&2 + echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2 + echo " *** " 1>&2 + echo " *** Install ncurses (ncurses-devel) and try again." 1>&2 + echo " *** " 1>&2 + exit 1 fi }