Bug #1165
closed
POPT_LIBS and POPT_CFLAGS ignored by configure and the build
Added by Rolf Theunissen almost 6 years ago.
Updated about 5 years ago.
Description
With LTTng-tools 2.10.x
Setting the POPT_LIBS variable is ignored, the configure always checks for '-lpopt' instead of the value specified in POPT_LIBS.
The POPT_CFLAGS options are not added in the compiler options, resulting in '<popt.h>' file not found exceptions.
BTW: The libxml2_LIBS and libxml2_CFLAGS are handled correctly
Files
Hi,
Do you have pkg-config on your system? Also, could you share the generated config.log
Thanks,
YL
pkg-config is installed, but pkg data is not available for popt and libxml2. Therefore the configuration is manually specified:
export POPT_CFLAGS="-I/home/user/lttng_source/include"
export POPT_LIBS="-l:libpopt.so.0"
export libxml2_CFLAGS="-I/home/user/lttng_source/include/libxml2"
export libxml2_LIBS="-l:libxml2.so.2"
make finishes with this error:
/opt/windriver/toolchain/bin/../lib/gcc/i686-wrs-linux-gnu/4.8.1/../../../../i686-wrs-linux-gnu/bin/ld: cannot find -lpopt
collect2: error: ld returned 1 exit status
make3: * [lttng] Error 1
make3: Leaving directory `/home/user/lttng_source/lttng-tools-2.10.4/src/bin/lttng'
make2: [all-recursive] Error 1
make2: Leaving directory `/home/user/lttng_source/lttng-tools-2.10.4/src/bin'
make1: [all-recursive] Error 1
make1: Leaving directory `/home/user/lttng_source/lttng-tools-2.10.4/src'
make: * [all-recursive] Error 1
See also the resulting config.log attached
Specifying the following workaround before make works:
export CFLAGS="-g -02 -I/home/user/lttng_source/include"
1) Looking through the config.log, it seems that POPT_CFLAGS was not set prior running configure hence why it calls pkg-config to try to set it, fails (because of the missing .pc) and falls back on -lpopt overriding the POPT_LIBS setting. The generated Makefile will use the settings used at configure time. You'll have to rerun configure if you want to change these values and make sure POPT_CFLAGS is non-null if you don't want your settings overriden.
2) I've also investigated the missing POPT_CFLAGS and libpopt is not the only one where some of the flags are assumed and/or unused. So, I'll patch those too before sending a patch.
Here is the patch for POPT. This patch HAS TO be applied to code coming from a git-tree (pre-bootstrap code). Can you test it before it is submitted for integration?
- Status changed from New to Feedback
To bootstrap in my environment, I had to run:
autoreconf -vi -I /usr/share/pkgconfig/ -I ./m4
After that, the build runs corretly, with the POPT_LIBS and POPT_CFLAGS varialbes taken into account.
Rolf Theunissen wrote:
To bootstrap in my environment, I had to run:
autoreconf -vi -I /usr/share/pkgconfig/ -I ./m4
After that, the build runs corretly, with the POPT_LIBS and POPT_CFLAGS varialbes taken into account.
Of course with the patch applied
- Status changed from Feedback to Resolved
- % Done changed from 0 to 100
Also available in: Atom
PDF