diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-01-15 15:28:35 +0100 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2006-01-15 15:28:35 +0100 |
commit | 60f33b80443a3e7e79e2a3ddc625ab6246a61d3d (patch) | |
tree | 941dd2cb141fd7db86e071a0c469aaba9d22599b /scripts/kconfig/lxdialog/check-lxdialog.sh | |
parent | 7c7dce9209161eb260cdf9e9172f72c3a02379e6 (diff) |
kconfig: get rid of stray a.o, support ncursesw
scripts/kconfig/lxdialog/check-lxdialog.sh uses gcc to check for
what libraries are present. Redirect output to /dev/null
so we do not generate an a.out.
Also included support for ncursesw - so if present prefer that
instead of ncurses.
The order is now (first is preferred):
1) ncursesw
2) ncurses
3) curses
The latter is to support SunOS.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/lxdialog/check-lxdialog.sh')
-rw-r--r-- | scripts/kconfig/lxdialog/check-lxdialog.sh | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh index a3c141b4967..448e353923f 100644 --- a/scripts/kconfig/lxdialog/check-lxdialog.sh +++ b/scripts/kconfig/lxdialog/check-lxdialog.sh @@ -4,11 +4,22 @@ # What library to link ldflags() { - if [ `uname` == SunOS ]; then - echo '-lcurses' - else + echo "main() {}" | $cc -lncursesw -xc - -o /dev/null 2> /dev/null + if [ $? -eq 0 ]; then + echo '-lncursesw' + exit + fi + echo "main() {}" | $cc -lncurses -xc - -o /dev/null 2> /dev/null + if [ $? -eq 0 ]; then echo '-lncurses' + exit fi + echo "main() {}" | $cc -lcurses -xc - -o /dev/null 2> /dev/null + if [ $? -eq 0 ]; then + echo '-lcurses' + exit + fi + exit 1 } # Where is ncurses.h? @@ -28,7 +39,7 @@ ccflags() compiler="" # Check if we can link to ncurses check() { - echo "main() {}" | $compiler -xc - + echo "main() {}" | $cc -xc - -o /dev/null 2> /dev/null if [ $? != 0 ]; then echo " *** Unable to find the ncurses libraries." 1>&2 echo " *** make menuconfig require the ncurses libraries" 1>&2 @@ -51,13 +62,15 @@ fi case "$1" in "-check") shift - compiler="$@" + cc="$@" check ;; "-ccflags") ccflags ;; "-ldflags") + shift + cc="$@" ldflags ;; "*") |