summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/lxdialog/check-lxdialog.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/lxdialog/check-lxdialog.sh')
-rw-r--r--scripts/kconfig/lxdialog/check-lxdialog.sh26
1 files changed, 10 insertions, 16 deletions
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 120d624e67..9681476b96 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
exit 1
}
@@ -57,7 +51,7 @@ usage() {
printf "Usage: $0 [-check compiler options|-header|-library]\n"
}
-if [ $# == 0 ]; then
+if [ $# -eq 0 ]; then
usage
exit 1
fi