Skip to content

Commit

Permalink
config/Makefile: only link with ncurses lib if needed
Browse files Browse the repository at this point in the history
The config/conf application don't need the ncurses library to be linked to it.
Specialize the link flags to mconf for the menuconfig target.
This can solve issues with some build systems.

Signed-off-by: Nicolas Ferre <[email protected]>
  • Loading branch information
noglitch committed Jun 7, 2017
1 parent 15f3b42 commit 544c74d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions config/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ host-cobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-objs)))
host-cxxobjs := $(sort $(foreach m,$(__hostprogs),$($(m)-cxxobjs)))

$(host-csingle): %: %.c
$(Q)$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $< $(HOST_LOADLIBES) -o $@
$(Q)$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $< $(HOSTLOADLIBES_$@) -o $@

$(host-cmulti): %: $(host-cobjs) $(host-cshlib)
$(Q)$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $($@-objs) $(HOST_LOADLIBES) -o $@
$(Q)$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $($@-objs) $(HOSTLOADLIBES_$@) -o $@

$(host-cxxmulti): %: $(host-cxxobjs) $(host-cobjs) $(host-cshlib)
$(Q)$(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTCFLAGS) $(HOSTCFLAGS_$@) $($@-objs) $($@-cxxobjs) $(HOSTLOADLIBES_$@) -o $@
Expand Down
11 changes: 5 additions & 6 deletions config/Makefile.kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,8 @@ check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh

# Use recursively expanded variables so we do not call gcc unless
# we really need to do so. (Do not call gcc as part of make mrproper)
HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))

HOST_EXTRACFLAGS += -DLOCALE

HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \
-DLOCALE

# ===========================================================================
# Shared Makefile for the various kconfig executables:
Expand Down Expand Up @@ -190,7 +187,7 @@ clean-files += config.pot linux.pot
PHONY += $(obj)/dochecklxdialog
$(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog
$(obj)/dochecklxdialog:
$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES)
$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf)

always := dochecklxdialog

Expand All @@ -208,6 +205,8 @@ HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
-D LKC_DIRECT_LINK

HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))

$(obj)/qconf.o: $(obj)/.tmp_qtcheck

ifeq ($(qconf-target),1)
Expand Down

0 comments on commit 544c74d

Please sign in to comment.