Commit 60f33b80 authored by Sam Ravnborg's avatar Sam Ravnborg

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: default avatarSam Ravnborg <sam@ravnborg.org>
parent 7c7dce92
# Makefile to build lxdialog package # Makefile to build lxdialog package
# #
check-lxdialog := $(srctree)/$(src)/check-lxdialog.sh check-lxdialog := $(srctree)/$(src)/check-lxdialog.sh
HOST_EXTRACFLAGS := $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) HOST_EXTRACFLAGS:= $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
HOST_LOADLIBES := $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags) HOST_LOADLIBES := $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
HOST_EXTRACFLAGS += -DLOCALE HOST_EXTRACFLAGS += -DLOCALE
......
...@@ -4,11 +4,22 @@ ...@@ -4,11 +4,22 @@
# What library to link # What library to link
ldflags() ldflags()
{ {
if [ `uname` == SunOS ]; then echo "main() {}" | $cc -lncursesw -xc - -o /dev/null 2> /dev/null
echo '-lcurses' if [ $? -eq 0 ]; then
else echo '-lncursesw'
exit
fi
echo "main() {}" | $cc -lncurses -xc - -o /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
echo '-lncurses' echo '-lncurses'
exit
fi 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? # Where is ncurses.h?
...@@ -28,7 +39,7 @@ ccflags() ...@@ -28,7 +39,7 @@ ccflags()
compiler="" compiler=""
# Check if we can link to ncurses # Check if we can link to ncurses
check() { check() {
echo "main() {}" | $compiler -xc - echo "main() {}" | $cc -xc - -o /dev/null 2> /dev/null
if [ $? != 0 ]; then if [ $? != 0 ]; then
echo " *** Unable to find the ncurses libraries." 1>&2 echo " *** Unable to find the ncurses libraries." 1>&2
echo " *** make menuconfig require the ncurses libraries" 1>&2 echo " *** make menuconfig require the ncurses libraries" 1>&2
...@@ -51,13 +62,15 @@ fi ...@@ -51,13 +62,15 @@ fi
case "$1" in case "$1" in
"-check") "-check")
shift shift
compiler="$@" cc="$@"
check check
;; ;;
"-ccflags") "-ccflags")
ccflags ccflags
;; ;;
"-ldflags") "-ldflags")
shift
cc="$@"
ldflags ldflags
;; ;;
"*") "*")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment