Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e588f6d authored by Sam Ravnborg's avatar Sam Ravnborg
Browse files

kconfig: if ncurses-devel is missing then say so



With this patch when ncurses-devel (or whatever it is named)
is missing trying to run menuconfig will result in this:

$ make menuconfig
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o
 *** Unable to find the ncurses libraries or the
 *** required header files.
 *** 'make menuconfig' requires the ncurses libraries.
 ***
 *** Install ncurses (ncurses-devel) and try again.
 ***
make[1]: *** [scripts/kconfig/dochecklxdialog] Error 1
make: *** [menuconfig] Error 2

Much better than before where we just listed some build errors.
The other *config targets will work indepenednt on ncurses
being present or not.

Includes improvements suggested by: Frans Pop <elendil@planet.nl>

Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Cc: Frans Pop <elendil@planet.nl>
parent 551559e1
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -93,12 +93,6 @@ HOST_LOADLIBES = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))


HOST_EXTRACFLAGS += -DLOCALE
HOST_EXTRACFLAGS += -DLOCALE


PHONY += $(obj)/dochecklxdialog
$(obj)/dochecklxdialog:
	$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_LOADLIBES)

always := dochecklxdialog



# ===========================================================================
# ===========================================================================
# Shared Makefile for the various kconfig executables:
# Shared Makefile for the various kconfig executables:
@@ -145,6 +139,14 @@ clean-files := lkc_defs.h qconf.moc .tmp_qtcheck \
		   .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c
		   .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c
clean-files     += mconf qconf gconf
clean-files     += mconf qconf gconf


# Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
PHONY += $(obj)/dochecklxdialog
$(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog
$(obj)/dochecklxdialog:
	$(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES)

always := dochecklxdialog

# Add environment specific flags
# Add environment specific flags
HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))


+9 −7
Original line number Original line Diff line number Diff line
@@ -36,12 +36,14 @@ 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() {
	echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null
	echo -e " #include CURSES_LOC \n main() {}" |
	    $cc -xc - -o $tmp 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 or the"       1>&2
		echo " *** make menuconfig require the ncurses libraries"  1>&2
	    echo " *** required header files."                            1>&2
	    echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2
	    echo " *** "                                                  1>&2
	    echo " *** "                                                  1>&2
		echo " *** Install ncurses (ncurses-devel) and try again"  1>&2
	    echo " *** Install ncurses (ncurses-devel) and try again."    1>&2
	    echo " *** "                                                  1>&2
	    echo " *** "                                                  1>&2
	    exit 1
	    exit 1
	fi
	fi