From 7a4f8fa7aa868b5f56e6cddbbac58bb62d76860c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 27 Sep 2006 12:20:18 +0000 Subject: [PATCH] fix lxdialog cc/ldflags check script for darwin/osx SVN-Revision: 4864 --- .../scripts/config/lxdialog/check-lxdialog.sh | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/openwrt/scripts/config/lxdialog/check-lxdialog.sh b/openwrt/scripts/config/lxdialog/check-lxdialog.sh index df81c445586..275e3954229 100644 --- a/openwrt/scripts/config/lxdialog/check-lxdialog.sh +++ b/openwrt/scripts/config/lxdialog/check-lxdialog.sh @@ -4,21 +4,25 @@ # 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 dylib; do + for dir in "" /usr/local/lib /opt/local/lib; do + $cc ${dir:+-L$dir} -print-file-name=libncursesw.$ext | grep -q / + if [ $? -eq 0 ]; then + echo $dir '-lncursesw' + exit + fi + $cc ${dir:+-L$dir} -print-file-name=libncurses.$ext | grep -q / + if [ $? -eq 0 ]; then + echo $dir '-lncurses' + exit + fi + $cc ${dir:+-L$dir} -print-file-name=libcurses.$ext | grep -q / + if [ $? -eq 0 ]; then + echo $dir '-lcurses' + exit + fi + done + done exit 1 } @@ -29,6 +33,8 @@ ccflags() echo '-I/usr/include/ncurses -DCURSES_LOC=""' elif [ -f /usr/include/ncurses/curses.h ]; then echo '-I/usr/include/ncurses -DCURSES_LOC=""' + elif [ -f /opt/local/include/ncurses/ncurses.h ]; then + echo '-I/opt/local/include/ncurses -DCURSES_LOC=""' elif [ -f /usr/include/ncurses.h ]; then echo '-DCURSES_LOC=""' else -- 2.30.2