diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-10 08:21:33 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-10 08:21:33 -0800 |
commit | ab396e91bfe953db26fa1083d9c3e7a4fbe0334a (patch) | |
tree | 81db9e5f919b84dcb4284ca8cdf675e13716c191 /scripts/kconfig/lxdialog/check-lxdialog.sh | |
parent | 9979ead5d1eb23191a00453559927c5abf9087e2 (diff) | |
parent | 4f0210b9c4889eede9f8f379f93570c01998ccb9 (diff) |
Merge ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
Fix up some trivial conflicts in {i386|ia64}/Makefile
Diffstat (limited to 'scripts/kconfig/lxdialog/check-lxdialog.sh')
-rw-r--r-- | scripts/kconfig/lxdialog/check-lxdialog.sh | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh new file mode 100644 index 00000000000..a3c141b4967 --- /dev/null +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -0,0 +1,67 @@ +#!/bin/sh +# Check ncurses compatibility + +# What library to link +ldflags() +{ + if [ `uname` == SunOS ]; then + echo '-lcurses' + else + echo '-lncurses' + fi +} + +# Where is ncurses.h? +ccflags() +{ + if [ -f /usr/include/ncurses/ncurses.h ]; then + echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' + elif [ -f /usr/include/ncurses/curses.h ]; then + echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"' + elif [ -f /usr/include/ncurses.h ]; then + echo '-DCURSES_LOC="<ncurses.h>"' + else + echo '-DCURSES_LOC="<curses.h>"' + fi +} + +compiler="" +# Check if we can link to ncurses +check() { + echo "main() {}" | $compiler -xc - + 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 + +case "$1" in + "-check") + shift + compiler="$@" + check + ;; + "-ccflags") + ccflags + ;; + "-ldflags") + ldflags + ;; + "*") + usage + exit 1 + ;; +esac |