Bug 6920 - Compiling busybox (make menuconfig) if ncurses is in nonstandard path
Summary: Compiling busybox (make menuconfig) if ncurses is in nonstandard path
Status: RESOLVED WORKSFORME
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.22.x
Hardware: PC Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-24 13:37 UTC by dusan.halicky
Modified: 2014-02-26 15:00 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dusan.halicky 2014-02-24 13:37:24 UTC
I have ncurses installed in /opt/ncurses/5.9-1/, when I issue "make menuconfig" in busybox 1.22.1, I get this error:

  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  In file included from scripts/kconfig/lxdialog/checklist.c:24:0:
  scripts/kconfig/lxdialog/dialog.h:31:20: fatal error: curses.h: No such file or directory
  compilation terminated.
  make[2]: *** [scripts/kconfig/lxdialog/checklist.o] Error 1
  make[1]: *** [menuconfig] Error 2
  make: *** [menuconfig] Error 2

I try to set CFLAGS but it had no effect:

  export CFLAGS="-I/opt/ncurses/5.9-1/include/ncurses -DCURSES_LOC=<ncurses.h>"
  make menuconfig
  ... same error

I changed busybox-1.22.1/scripts/kconfig/lxdialog/Makefile like this:

  HOST_EXTRACFLAGS += -DLOCALE -I/opt/ncurses/5.9-1/include/ncurses
  HOST_LOADLIBES   += -ltinfo -lncurses -L/opt/ncurses/5.9-1/lib/

And in dialog.h I have to change #include CURSES_LOC to:

  #include <ncurses.h>

Now it compiles lxdialog binary, and I can see busybox ncurses configuration screens.

In busybox-1.22.1/scripts/kconfig/lxdialog/Makefile, there is -ccflags instead of -cflags, I'm not sure if that is the problem, I tried to change it but it didn't help. I don't know why -DCURSES_LOC=<ncurses.h> doesn't work either, I have to change it in dialog.h.

Bug: "make menuconfig" should accept CFLAGS and LDFLAGS.
Comment 1 Denys Vlasenko 2014-02-24 14:46:13 UTC
(In reply to comment #0)
> I have ncurses installed in /opt/ncurses/5.9-1/

Why do you do that?
Comment 2 dusan.halicky 2014-02-24 15:05:02 UTC
> > I have ncurses installed in /opt/ncurses/5.9-1/
> Why do you do that?

So that I can have multiple versions installed and easily switch between them.
Comment 3 Denys Vlasenko 2014-02-24 15:48:15 UTC
Try HOSTCFLAGS
Comment 4 dusan.halicky 2014-02-25 07:11:58 UTC
> Try HOSTCFLAGS

export HOSTCFLAGS=-I/opt/ncurses/5.9-1/include/ncurses
make menuconfig
> curses.h: No such file or directory

But it is there:

$ ls /opt/ncurses/5.9-1/include/ncurses/curses.h
/opt/ncurses/5.9-1/include/ncurses/curses.h
Comment 5 Denys Vlasenko 2014-02-25 12:51:26 UTC
This works for me:

make HOSTCFLAGS=... menuconfig
Comment 6 dusan.halicky 2014-02-26 07:08:59 UTC
> make HOSTCFLAGS=... menuconfig

Yes, this helped with including ncurses, but now I have problem at linking stage. How do I pass "-L/opt/ncurses/5.9-1/lib -lncurses" ?
Comment 7 Denys Vlasenko 2014-02-26 12:56:57 UTC
HOST_LOADLIBES
Comment 8 dusan.halicky 2014-02-26 15:00:27 UTC
(In reply to comment #7)
> HOST_LOADLIBES

This one finds ncurses, but fails on linking:

$ make HOSTCFLAGS=-I/opt/ncurses/5.9-1/include/ncurses menuconfig

This one doesn't find ncurses:

$ make HOSTCFLAGS=-I/opt/ncurses/5.9-1/include/ncurses HOST_LOADLIBES="-L/opt/ncurses/5.9-1/lib -ltinfo -lncurses" menuconfig

What is entire make command?