Htop: Cross-compilation using Yocto fails on ncurses check

Created on 21 Aug 2017  路  2Comments  路  Source: hishamhm/htop

I'm trying to use Yocto to cross-compile htop 2.0.2 for an ARM-based system (BeagleBone Black). I'm using configure option --disable-unicode since I have disabled wchar support.

It fails with the message:

...
checking for refresh in -lncurses... no
checking for refresh in -lncurses6... no
checking for refresh in -lncurses... (cached) no
checking for curses.h... (cached) yes
configure: error: missing libraries: libncurses

The config.log contains:

configure:13533: checking for refresh in -lncurses
configure:13558: arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard --sysroot=/home/craigm/yocto-laura/poky/build/tmp/sysroots/laura -o conftest -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/craigm/yocto-laura/poky/build/tmp/work/armv7ahf-neon-poky-linux-gnueabi/htop/2.0.2-r0=/usr/src/debug/htop/2.0.2-r0 -fdebug-prefix-map=/home/craigm/yocto-laura/poky/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/home/craigm/yocto-laura/poky/build/tmp/sysroots/laura= --should-not-have-used-/usr/bin/ncurses5-config -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c -lncurses -lm >&5
arm-poky-linux-gnueabi-gcc: error: unrecognized command line option '--should-not-have-used-/usr/bin/ncurses5-config'

See [oe] --should-not-have-used- on the OpenEmbedded mailing list which describes the should-not-have-used- part in the error message.

I think the essence is, use pkg-config to find the ncurses dependency.

htop 1.0.3 builds okay in Yocto, I guess because it's not using the same method to check for ncurses.

Most helpful comment

htop 2.2.0, the same problem, not fixed yet?

All 2 comments

htop 2.2.0, the same problem, not fixed yet?

We hit the same issue on Exherbo. For now I was able to workaround that by passing

HTOP_NCURSESW_CONFIG_SCRIPT="/usr/$(exhost --target)/bin/ncursesw6-config"

during configure. $(exhost --target) is the triple of the targeted host, e.g. armv7-unknown-linux-gnueabihf

But this only works because ncursesw6-config is a bash script. Usually you can't expect to run stuff from /usr/$(exhost --target)/bin on your build host.

So +1 for using pkg-config here to find ncurses in a cross-compatible way

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RalfJung picture RalfJung  路  4Comments

edouard-lopez picture edouard-lopez  路  3Comments

brendangregg picture brendangregg  路  8Comments

ghost picture ghost  路  4Comments

rafis picture rafis  路  7Comments