All of lore.kernel.org
 help / color / mirror / Atom feed
* menuconfig: fail with clearer error if curses.h N/A
@ 2007-10-14 21:23 Frans Pop
  2007-12-09 19:13 ` Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Frans Pop @ 2007-10-14 21:23 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kernel

It would be nice if 'make menuconfig' could fail earlier or with a clearer
error if curses.h is not available. The actual error is currently rather
buried in a huge amount of indirect errors.

After installing libncurses-dev (Debian) everything was fine.

$ make menuconfig
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
In file included from scripts/kconfig/lxdialog/checklist.c:24:
scripts/kconfig/lxdialog/dialog.h:32:20: error: curses.h: No such file or directory
In file included from scripts/kconfig/lxdialog/checklist.c:24:
scripts/kconfig/lxdialog/dialog.h:97: error: expected specifier-qualifier-list before ‘chtype’
scripts/kconfig/lxdialog/dialog.h:187: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:194: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:196: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:197: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:198: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:199: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/dialog.h:201: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/checklist.c:31: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/checklist.c:59: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/checklist.c:95: error: expected ‘)’ before ‘*’ token
scripts/kconfig/lxdialog/checklist.c: In function ‘dialog_checklist’:
[another 30 or so lines with warnings/errors omitted]

Cheers,
FJP

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: menuconfig: fail with clearer error if curses.h N/A
  2007-10-14 21:23 menuconfig: fail with clearer error if curses.h N/A Frans Pop
@ 2007-12-09 19:13 ` Sam Ravnborg
  2007-12-09 19:35   ` Frans Pop
  0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2007-12-09 19:13 UTC (permalink / raw)
  To: Frans Pop; +Cc: linux-kernel, linux-kbuild

On Sun, Oct 14, 2007 at 11:23:20PM +0200, Frans Pop wrote:
> It would be nice if 'make menuconfig' could fail earlier or with a clearer
> error if curses.h is not available. The actual error is currently rather
> buried in a huge amount of indirect errors.

It worked some time ago but I did not bother to check it out
when it broke.
With following patch it fails like this:

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

This is much better.

	Sam

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 1ad6f7f..8091435 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -93,12 +93,6 @@ HOST_LOADLIBES   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
 
 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:
@@ -145,6 +139,14 @@ clean-files	:= lkc_defs.h qconf.moc .tmp_qtcheck \
 		   .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c
 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
 HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
 
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 9681476..451297f 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -36,9 +36,10 @@ trap "rm -f $tmp" 0 1 2 3 15
 
 # Check if we can link to ncurses
 check() {
-	echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null
+	echo " \#include CURSES_LOC main() {}" | $cc -xc - -o $tmp 2> /dev/null
 	if [ $? != 0 ]; then
-		echo " *** Unable to find the ncurses libraries."          1>&2
+		echo " *** Unable to find the ncurses libraries"           1>&2
+		echo " *** or the required header files."                  1>&2
 		echo " *** make menuconfig require the ncurses libraries"  1>&2
 		echo " *** "                                               1>&2
 		echo " *** Install ncurses (ncurses-devel) and try again"  1>&2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: menuconfig: fail with clearer error if curses.h N/A
  2007-12-09 19:13 ` Sam Ravnborg
@ 2007-12-09 19:35   ` Frans Pop
  2007-12-09 19:55     ` Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Frans Pop @ 2007-12-09 19:35 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kernel, linux-kbuild

On Sunday 09 December 2007, Sam Ravnborg wrote:
> This is much better.

Thanks!

A few minor corrections maybe (nitpicks really).

>  *** Unable to find the ncurses libraries
>  *** or the required header files.

That first line is strangely short like this.
Move "or the" to the first line?

>  *** make menuconfig require the ncurses libraries

At least s/require/requires/ and probably add a period at end of the line.
I also suggest adding quotes around make menuconfig:
 *** 'make menuconfig' requires the ncurses libraries.

>  ***
>  *** Install ncurses (ncurses-devel) and try again

Again add a period at end of the line.

Cheers,
FJP

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: menuconfig: fail with clearer error if curses.h N/A
  2007-12-09 19:35   ` Frans Pop
@ 2007-12-09 19:55     ` Sam Ravnborg
  0 siblings, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2007-12-09 19:55 UTC (permalink / raw)
  To: Frans Pop; +Cc: linux-kernel, linux-kbuild

On Sun, Dec 09, 2007 at 08:35:32PM +0100, Frans Pop wrote:
> On Sunday 09 December 2007, Sam Ravnborg wrote:
> > This is much better.
> 
> Thanks!
> 
> A few minor corrections maybe (nitpicks really).
Thanks - updated patch below.

	Sam

>From c00c91abddc0903e7b4bc818cfbaf401119ca676 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@saturn.ravnborg.org>
Date: Sun, 9 Dec 2007 20:11:15 +0100
Subject: [PATCH] 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: Sam Ravnborg <sam@ravnborg.org>
Cc: Frans Pop <elendil@planet.nl>
---
 scripts/kconfig/Makefile                   |   14 ++++++++------
 scripts/kconfig/lxdialog/check-lxdialog.sh |   16 +++++++++-------
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 1ad6f7f..8091435 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -93,12 +93,6 @@ HOST_LOADLIBES   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
 
 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:
@@ -145,6 +139,14 @@ clean-files	:= lkc_defs.h qconf.moc .tmp_qtcheck \
 		   .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c
 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
 HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
 
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 9681476..62e1e02 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -36,14 +36,16 @@ trap "rm -f $tmp" 0 1 2 3 15
 
 # Check if we can link to ncurses
 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
-		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
+	    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
 }
 
-- 
1.5.3.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-09 19:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-14 21:23 menuconfig: fail with clearer error if curses.h N/A Frans Pop
2007-12-09 19:13 ` Sam Ravnborg
2007-12-09 19:35   ` Frans Pop
2007-12-09 19:55     ` Sam Ravnborg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.