# HG changeset patch # User "Yann E. MORIN" # Date 1228078755 0 # Node ID 5be36a4b304d49cc35dc0c98df280e11f0608af2 # Parent dadcb622168312ad727ca041093309298b323a91 Make the kconfig stuff build under Cygwin. /trunk/kconfig/kconfig.mk | 7 5 2 0 ++++-- /trunk/kconfig/lxdialog/check-lxdialog.sh | 44 21 23 0 ++++++++++++++++++------------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff -r dadcb6221683 -r 5be36a4b304d kconfig/kconfig.mk --- a/kconfig/kconfig.mk Sun Nov 30 20:46:17 2008 +0000 +++ b/kconfig/kconfig.mk Sun Nov 30 20:59:15 2008 +0000 @@ -82,6 +82,9 @@ mconf_DEP = $(patsubst %.c,%.dep,$(mconf_SRC)) $(mconf_OBJ) $(mconf_DEP): CFLAGS += $(NCURSES_CFLAGS) $(INTL_CFLAGS) $(obj)/mconf: LDFLAGS += $(NCURSES_LDFLAGS) +ifeq ($(shell uname -o 2>/dev/null || echo unknown),Cygwin) +$(obj)/mconf: LDFLAGS += -Wl,--enable-auto-import +endif # These are generated files: ALL_OBJS = $(sort $(COMMON_OBJ) $(LX_OBJ) $(conf_OBJ) $(mconf_OBJ)) @@ -139,11 +142,11 @@ # Actual link $(obj)/mconf: $(COMMON_OBJ) $(LX_OBJ) $(mconf_OBJ) @$(ECHO) ' LD $@' - $(SILENT)$(HOST_LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $^ + $(SILENT)$(HOST_LD) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(obj)/conf: $(COMMON_OBJ) $(conf_OBJ) @$(ECHO) ' LD $@' - $(SILENT)$(HOST_LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -o $@ $^ + $(SILENT)$(HOST_LD) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) #----------------------------------------------------------- # Cleaning up the mess... diff -r dadcb6221683 -r 5be36a4b304d kconfig/lxdialog/check-lxdialog.sh --- a/kconfig/lxdialog/check-lxdialog.sh Sun Nov 30 20:46:17 2008 +0000 +++ b/kconfig/lxdialog/check-lxdialog.sh Sun Nov 30 20:59:15 2008 +0000 @@ -4,21 +4,15 @@ # What library to link ldflags() { - $cc -print-file-name=libncursesw.so | grep -q / - if [ $? -eq 0 ]; then - echo '-lncursesw' - exit - fi - $cc -print-file-name=libncurses.so | grep -q / - if [ $? -eq 0 ]; then - echo '-lncurses' - exit - fi - $cc -print-file-name=libcurses.so | grep -q / - if [ $? -eq 0 ]; then - echo '-lcurses' - exit - fi + for ext in so a dylib ; do + for lib in ncursesw ncurses curses ; do + $cc -print-file-name=lib${lib}.${ext} | grep -q / + if [ $? -eq 0 ]; then + echo "-l${lib}" + exit + fi + done + done exit 1 } @@ -42,14 +36,18 @@ # Check if we can link to ncurses check() { - echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null - if [ $? -ne 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 + $cc -xc - -o $tmp 2>/dev/null <<'EOF' +#include CURSES_LOC +main() {} +EOF + if [ $? != 0 ]; then + echo " *** Unable to find the ncurses libraries or the" 1>&2 + echo " *** required header files." 1>&2 + echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2 + echo " *** " 1>&2 + echo " *** Install ncurses (ncurses-devel) and try again." 1>&2 + echo " *** " 1>&2 + exit 1 fi }