kconfig: use POSIX equality test in check-lxdialog.sh
[firefly-linux-kernel-4.4.55.git] / scripts / kconfig / lxdialog / check-lxdialog.sh
index 120d624e672c5740faf2aa744aa7785c5edbecab..9681476b96e7fcf371840d78e17aa85657d327a1 100644 (file)
@@ -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