From 5c472fc895c32a189d574b338057164e95430825 Mon Sep 17 00:00:00 2001 From: nbd Date: Thu, 20 Apr 2006 20:17:34 +0000 Subject: add kconfig from linux 2.6 to scripts/config git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3682 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/config/lxdialog/check-lxdialog.sh | 84 +++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 scripts/config/lxdialog/check-lxdialog.sh (limited to 'scripts/config/lxdialog/check-lxdialog.sh') diff --git a/scripts/config/lxdialog/check-lxdialog.sh b/scripts/config/lxdialog/check-lxdialog.sh new file mode 100644 index 0000000000..120d624e67 --- /dev/null +++ b/scripts/config/lxdialog/check-lxdialog.sh @@ -0,0 +1,84 @@ +#!/bin/sh +# 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 + exit 1 +} + +# Where is ncurses.h? +ccflags() +{ + if [ -f /usr/include/ncurses/ncurses.h ]; then + echo '-I/usr/include/ncurses -DCURSES_LOC=""' + elif [ -f /usr/include/ncurses/curses.h ]; then + echo '-I/usr/include/ncurses -DCURSES_LOC=""' + elif [ -f /usr/include/ncurses.h ]; then + echo '-DCURSES_LOC=""' + else + echo '-DCURSES_LOC=""' + fi +} + +# Temp file, try to clean up after us +tmp=.lxdialog.tmp +trap "rm -f $tmp" 0 1 2 3 15 + +# Check if we can link to ncurses +check() { + echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null + if [ $? != 0 ]; then + echo " *** Unable to find the ncurses libraries." 1>&2 + echo " *** make menuconfig require the ncurses libraries" 1>&2 + echo " *** " 1>&2 + echo " *** Install ncurses (ncurses-devel) and try again" 1>&2 + echo " *** " 1>&2 + exit 1 + fi +} + +usage() { + printf "Usage: $0 [-check compiler options|-header|-library]\n" +} + +if [ $# == 0 ]; then + usage + exit 1 +fi + +cc="" +case "$1" in + "-check") + shift + cc="$@" + check + ;; + "-ccflags") + ccflags + ;; + "-ldflags") + shift + cc="$@" + ldflags + ;; + "*") + usage + exit 1 + ;; +esac -- cgit v1.2.3 From 8d6d188205513b9472134f56f4da35b5f04e4c6f Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 21 Sep 2006 13:59:20 +0000 Subject: Standardize shell script, closes #788 git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4807 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/config/lxdialog/check-lxdialog.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/config/lxdialog/check-lxdialog.sh') diff --git a/scripts/config/lxdialog/check-lxdialog.sh b/scripts/config/lxdialog/check-lxdialog.sh index 120d624e67..df81c44558 100644 --- a/scripts/config/lxdialog/check-lxdialog.sh +++ b/scripts/config/lxdialog/check-lxdialog.sh @@ -57,7 +57,7 @@ usage() { printf "Usage: $0 [-check compiler options|-header|-library]\n" } -if [ $# == 0 ]; then +if [ $# -eq 0 ]; then usage exit 1 fi -- cgit v1.2.3 From 78981f18b8c54713cf5434184f65d83b4655d15e Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 27 Sep 2006 12:20:18 +0000 Subject: fix lxdialog cc/ldflags check script for darwin/osx git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4864 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/config/lxdialog/check-lxdialog.sh | 36 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'scripts/config/lxdialog/check-lxdialog.sh') diff --git a/scripts/config/lxdialog/check-lxdialog.sh b/scripts/config/lxdialog/check-lxdialog.sh index df81c44558..275e395422 100644 --- a/scripts/config/lxdialog/check-lxdialog.sh +++ b/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 -- cgit v1.2.3