# HG changeset patch # User "Yann E. MORIN" # Date 1286144216 -7200 # Node ID 4009fc9c47d5d2c4e7765f1e9fb6721a87217ae5 # Parent 5dd0b83ae528b496d3eb6ff1382ecebf39868217 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" diff -r 5dd0b83ae528 -r 4009fc9c47d5 kconfig/kconfig.mk --- a/kconfig/kconfig.mk Sun Sep 19 18:37:18 2010 +0200 +++ b/kconfig/kconfig.mk Mon Oct 04 00:16:56 2010 +0200 @@ -73,7 +73,11 @@ # Compiler and linker flags to use ncurses 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_SRC = kconfig/zconf.tab.c @@ -113,6 +117,8 @@ # We must be carefull what we enclose, because we need some of the variable # definitions for clean (and distclean) at least. # 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 $(filter $(configurators),$(MAKECMDGOALS))),) @@ -123,6 +129,9 @@ endif ifneq ($(strip $(filter menuconfig,$(MAKECMDGOALS))),) DEPS += $(mconf_DEP) $(LX_DEP) +$(COMMON_OBJ) $(COMMON_DEP): |dochecklxdialog +$(LX_OBJ) $(LX_DEP): |dochecklxdialog +$(mconf_OBJ) $(mconf_DEP): |dochecklxdialog endif -include $(DEPS) diff -r 5dd0b83ae528 -r 4009fc9c47d5 kconfig/lxdialog/check-lxdialog.sh --- a/kconfig/lxdialog/check-lxdialog.sh Sun Sep 19 18:37:18 2010 +0200 +++ b/kconfig/lxdialog/check-lxdialog.sh Mon Oct 04 00:16:56 2010 +0200 @@ -1,24 +1,14 @@ #!/bin/sh # 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 ldflags() { for ext in so a dylib ; do for lib in ncursesw ncurses curses ; do - if [ -f "${LIBPATH}/lib${lib}.${ext}" ]; then - echo "-L${LIBPATH} -l${lib}" + $cc -print-file-name=lib${lib}.${ext} | grep -q / + if [ $? -eq 0 ]; then + echo "-l${lib}" exit fi done @@ -29,20 +19,14 @@ # Where is ncurses.h? ccflags() { - if [ -f "${INCLUDEPATH}/ncursesw/ncurses.h" ]; then - echo "-I${INCLUDEPATH} \"-DCURSES_LOC=\"" - elif [ -f "${INCLUDEPATH}/ncurses/ncurses.h" ]; then - echo "-I${INCLUDEPATH} \"-DCURSES_LOC=\"" - elif [ -f "${INCLUDEPATH}/ncursesw/curses.h" ]; then - echo "-I${INCLUDEPATH} \"-DCURSES_LOC=\"" - elif [ -f "${INCLUDEPATH}/ncurses/curses.h" ]; then - echo "-I${INCLUDEPATH} \"-DCURSES_LOC=\"" - elif [ -f "${INCLUDEPATH}/ncurses.h" ]; then - echo "-I${INCLUDEPATH} \"-DCURSES_LOC=\"" - elif [ -f "${INCLUDEPATH}/curses.h" ]; then - echo "-I${INCLUDEPATH} \"-DCURSES_LOC=\"" + 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 - exit 1 + echo '-DCURSES_LOC=""' fi } @@ -52,8 +36,7 @@ # Check if we can link to ncurses check() { - IF=`echo $(ccflags) | sed -e 's/"//g'` - $cc $IF $(ldflags) -xc - -o $tmp 2>/dev/null <<'EOF' + $cc -xc - -o $tmp 2>/dev/null <<'EOF' #include CURSES_LOC main() {} EOF