Since we bumped CMake from 3.5.2 to 3.6.3 in commit
99ed85d740, CMake uses pkg-config during
its configure step to find available libraries on the host.
If host-pkgconf was not built before host-cmake, everything was working
fine. However, if host-pkgconf was built before, the configure step of
host-cmake was finding pkg-config and used it to find
libraries. Unfortunately, since we were not passing
PKG_CONFIG_PATH/PKG_CONFIG_SYSROOT_DIR, pkg-config was behaving in its
"default" mode, i.e returning results valid when building things for the
target, not for the host. This lead to header paths pointing to the
staging directory being used when building native binary objects,
causing all sort of build failures.
This commit fixes that by passing $(HOST_CONFIGURE_OPTS) to the
environment of host-cmake configure step. This variable contains
HOST_MAKE_ENV, which itself contains the appropriate
PKG_CONFIG_PATH/PKG_CONFIG_SYSROOT_DIR definitions.
At the same time, we drop LDFLAGS="$(HOST_LDFLAGS)" because this
definition is already in $(HOST_CONFIGURE_OPTS).
Fixes:
http://autobuild.buildroot.net/results/4e703ed8c2eb0f914794038b0ef7bd73a67f38ce/
(and 424 similar build failures)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>