Issue with pkgconfig and ncurses
Hi,
While building alsa-utils I ran in a weird issue. The build system was trying to link alsa-utils with the x86_64 ncurses lib. That issue didn't appear on another machine but could be reproduced 9 out of 10 times on my main machine.
I tracked down the issue: when configuring alsa-utils, configure tries to use pkg-config to fin CFLAGS/LDFLAGS for ncurses. This was failing so it is falling back to use ncursesw5-config which points cflags and ldflags to the x86_64 sysroot.
That is were this is nasty: the reason why pkg-config is failing is that the configure for ncurses is doing that:
PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; thenThat test fails one my main machine because at the time ncurses is configured, PKG_CONFIG_LIBDIR (that is tmp-external-linaro-toolchain/sysroots/am335x-evm/usr/lib/pkgconfig/) is not yet created as ncurses is the first package trying to install .pc files. The configure script then continues with only a warning but deactivate .pc files installation.
This doesn't happen on my other machine because it has more cores and finishes to build zlib before trying to configure ncurses!
I tried multiple thing ot fix that but I couldn't decide what is the best way.
Should we fix the configure script for ncurses but then it may happen again with another package.
Or should we enforce the creation of ${SYSROOT_DESTDIR}/usr/lib/pkgconfig/ from pkg-config. the main issue being that we actually compile pkg-config-native and we want to create that in ${SYSROOT_DESTDIR} for the machine.
Any help would be greatly appreciated.
Signature · 3 lines
Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
Quoted 4 lines · Alexandre Belloni
I tracked down the issue: when configuring alsa-utils, configure tries to use pkg-config to fin CFLAGS/LDFLAGS for ncurses. This was failing so it is falling back to use ncursesw5-config which points cflags and ldflags to the
x86_64sysroot.
http://patchwork.openembedded.org/patch/80727/ is an existing fix for this, but it never got merged. I've queued it locally and hopefully we can push it into 1.7.
Ross