mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-01-30 16:14:09 +00:00
kconfig: resync curses check with Linux kernel
check-lxdialog.sh breaks on 64-bit distributions which are lacking the lib -> lib64 symlinks (eg. some Fedora). The script from the 2.6.35 Linux kernel is reportedly functional on the systems that were requiring the current hack. See: http://sourceware.org/ml/crossgcc/2010-09/msg00113.html Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
This commit is contained in:
parent
a6552be181
commit
ddac60504f
@ -73,7 +73,11 @@ INTL_CFLAGS = $(shell $(SHELL) $(check_gettext) $(HOST_CC) $(EXTRA_CFLAGS))
|
|||||||
|
|
||||||
# Compiler and linker flags to use ncurses
|
# Compiler and linker flags to use ncurses
|
||||||
NCURSES_CFLAGS = $(shell $(SHELL) $(check_lxdialog) -ccflags)
|
NCURSES_CFLAGS = $(shell $(SHELL) $(check_lxdialog) -ccflags)
|
||||||
NCURSES_LDFLAGS = $(shell $(SHELL) $(check_lxdialog) -ldflags $(HOST_CC) $(LX_FLAGS) $(EXTRA_CFLAGS))
|
NCURSES_LDFLAGS = $(shell $(SHELL) $(check_lxdialog) -ldflags $(HOST_CC))
|
||||||
|
|
||||||
|
# Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
|
||||||
|
dochecklxdialog:
|
||||||
|
$(SILENT)$(SHELL) $(check_lxdialog) -check $(HOST_CC) $(NCURSES_CFLAGS) $(NCURSES_LDFLAGS)
|
||||||
|
|
||||||
# Common source files
|
# Common source files
|
||||||
COMMON_SRC = kconfig/zconf.tab.c
|
COMMON_SRC = kconfig/zconf.tab.c
|
||||||
@ -113,6 +117,8 @@ ALL_DEPS = $(sort $(COMMON_DEP) $(LX_DEP) $(conf_DEP) $(mconf_DEP))
|
|||||||
# We must be carefull what we enclose, because we need some of the variable
|
# We must be carefull what we enclose, because we need some of the variable
|
||||||
# definitions for clean (and distclean) at least.
|
# definitions for clean (and distclean) at least.
|
||||||
# Just protecting the "-include $(DEPS)" line should be sufficient.
|
# Just protecting the "-include $(DEPS)" line should be sufficient.
|
||||||
|
# And in case we want menuconfig, we have to check that lxdialog
|
||||||
|
# can find a curses lib.
|
||||||
|
|
||||||
ifneq ($(strip $(MAKECMDGOALS)),)
|
ifneq ($(strip $(MAKECMDGOALS)),)
|
||||||
ifneq ($(strip $(filter $(configurators),$(MAKECMDGOALS))),)
|
ifneq ($(strip $(filter $(configurators),$(MAKECMDGOALS))),)
|
||||||
@ -123,6 +129,9 @@ DEPS += $(conf_DEP)
|
|||||||
endif
|
endif
|
||||||
ifneq ($(strip $(filter menuconfig,$(MAKECMDGOALS))),)
|
ifneq ($(strip $(filter menuconfig,$(MAKECMDGOALS))),)
|
||||||
DEPS += $(mconf_DEP) $(LX_DEP)
|
DEPS += $(mconf_DEP) $(LX_DEP)
|
||||||
|
$(COMMON_OBJ) $(COMMON_DEP): |dochecklxdialog
|
||||||
|
$(LX_OBJ) $(LX_DEP): |dochecklxdialog
|
||||||
|
$(mconf_OBJ) $(mconf_DEP): |dochecklxdialog
|
||||||
endif
|
endif
|
||||||
|
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
|
@ -1,24 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Check ncurses compatibility
|
# Check ncurses compatibility
|
||||||
|
|
||||||
OS=`uname`
|
|
||||||
|
|
||||||
# Under MACOS make sure that the macports-installed version is used.
|
|
||||||
case "$OS" in
|
|
||||||
Darwin) BASEDIR="/opt/local";;
|
|
||||||
*) BASEDIR="/usr";;
|
|
||||||
esac
|
|
||||||
|
|
||||||
INCLUDEPATH="${BASEDIR}/include"
|
|
||||||
LIBPATH="${BASEDIR}/lib"
|
|
||||||
|
|
||||||
# What library to link
|
# What library to link
|
||||||
ldflags()
|
ldflags()
|
||||||
{
|
{
|
||||||
for ext in so a dylib ; do
|
for ext in so a dylib ; do
|
||||||
for lib in ncursesw ncurses curses ; do
|
for lib in ncursesw ncurses curses ; do
|
||||||
if [ -f "${LIBPATH}/lib${lib}.${ext}" ]; then
|
$cc -print-file-name=lib${lib}.${ext} | grep -q /
|
||||||
echo "-L${LIBPATH} -l${lib}"
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "-l${lib}"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -29,20 +19,14 @@ ldflags()
|
|||||||
# Where is ncurses.h?
|
# Where is ncurses.h?
|
||||||
ccflags()
|
ccflags()
|
||||||
{
|
{
|
||||||
if [ -f "${INCLUDEPATH}/ncursesw/ncurses.h" ]; then
|
if [ -f /usr/include/ncurses/ncurses.h ]; then
|
||||||
echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncursesw/ncurses.h>\""
|
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
|
||||||
elif [ -f "${INCLUDEPATH}/ncurses/ncurses.h" ]; then
|
elif [ -f /usr/include/ncurses/curses.h ]; then
|
||||||
echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncurses/ncurses.h>\""
|
echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses/curses.h>"'
|
||||||
elif [ -f "${INCLUDEPATH}/ncursesw/curses.h" ]; then
|
elif [ -f /usr/include/ncurses.h ]; then
|
||||||
echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncursesw/curses.h>\""
|
echo '-DCURSES_LOC="<ncurses.h>"'
|
||||||
elif [ -f "${INCLUDEPATH}/ncurses/curses.h" ]; then
|
|
||||||
echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncurses/curses.h>\""
|
|
||||||
elif [ -f "${INCLUDEPATH}/ncurses.h" ]; then
|
|
||||||
echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<ncurses.h>\""
|
|
||||||
elif [ -f "${INCLUDEPATH}/curses.h" ]; then
|
|
||||||
echo "-I${INCLUDEPATH} \"-DCURSES_LOC=<curses.h>\""
|
|
||||||
else
|
else
|
||||||
exit 1
|
echo '-DCURSES_LOC="<curses.h>"'
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,8 +36,7 @@ trap "rm -f $tmp" 0 1 2 3 15
|
|||||||
|
|
||||||
# Check if we can link to ncurses
|
# Check if we can link to ncurses
|
||||||
check() {
|
check() {
|
||||||
IF=`echo $(ccflags) | sed -e 's/"//g'`
|
$cc -xc - -o $tmp 2>/dev/null <<'EOF'
|
||||||
$cc $IF $(ldflags) -xc - -o $tmp 2>/dev/null <<'EOF'
|
|
||||||
#include CURSES_LOC
|
#include CURSES_LOC
|
||||||
main() {}
|
main() {}
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user