X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=scripts%2Fconfig%2Flxdialog%2Fcheck-lxdialog.sh;h=9a6c915e5a09ed56d0984a9a12f31ca1371fce1a;hb=628b6993d6def33f8c7e4860177cd480f3e6a0c8;hp=df81c445586a12ac9f6e8b6a451d240e0c4fa54e;hpb=8d6d188205513b9472134f56f4da35b5f04e4c6f;p=openwrt-10.03%2F.git diff --git a/scripts/config/lxdialog/check-lxdialog.sh b/scripts/config/lxdialog/check-lxdialog.sh index df81c4455..9a6c915e5 100644 --- a/scripts/config/lxdialog/check-lxdialog.sh +++ b/scripts/config/lxdialog/check-lxdialog.sh @@ -1,24 +1,28 @@ -#!/bin/sh +#!/usr/bin/env bash # Check ncurses compatibility # 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 -I/opt/local/include/ncurses -DCURSES_LOC=""' elif [ -f /usr/include/ncurses.h ]; then echo '-DCURSES_LOC=""' else