kconfig: search harder for curses library in check-lxdialog.sh
authorMike Frysinger <vapier@gentoo.org>
Thu, 17 May 2007 19:06:31 +0000 (15:06 -0400)
committerSam Ravnborg <sam@ravnborg.org>
Sat, 19 May 2007 07:11:15 +0000 (09:11 +0200)
The check-lxdialog.sh script searches for "libFOO.so" which fails on OS X, due
to their special naming of libraries like "libfoo.dylib".  This patch turns
the curses lib search into extensible loops and adds dylib as a valid
extension.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
scripts/kconfig/lxdialog/check-lxdialog.sh

index 120d624e672c5740faf2aa744aa7785c5edbecab..cdca7388e0f1f982ae0a05994bbb7e22a6ef74b0 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
 }