diff options
author | Bernhard Reutner-Fischer | 2008-08-27 07:39:57 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer | 2008-08-27 07:39:57 +0000 |
commit | f3d1e213fef45ba2df4090e9cd02217d1ef82f00 (patch) | |
tree | 6d464a52c841d35da82fa24b2fad4e179756f478 | |
parent | b522d6931d16e9e8ef41fe8d9f23035ccf53270c (diff) | |
download | busybox-f3d1e213fef45ba2df4090e9cd02217d1ef82f00.zip busybox-f3d1e213fef45ba2df4090e9cd02217d1ef82f00.tar.gz |
- pull check-lxdialog from linux-2.6.26
-rw-r--r-- | scripts/kconfig/lxdialog/check-lxdialog.sh | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh index 9e277b1..260743f 100644 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -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 #bbox# exit 1 echo '-lcurses' exit @@ -44,14 +38,18 @@ trap "rm -f $tmp" 0 1 2 3 15 # Check if we can link to ncurses check() { - echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null + $cc -xc - -o $tmp 2>/dev/null <<'EOF' +#include CURSES_LOC +main() {} +EOF if [ $? != 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 + 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 } @@ -59,7 +57,7 @@ usage() { printf "Usage: $0 [-check compiler options|-header|-library]\n" } -if [ $# == 0 ]; then +if [ $# -eq 0 ]; then usage exit 1 fi |