build: add PKG_DEPENDS_CONFIG to set PKG_CONFIG_PATH for packages

To be used for "-sysroot" packages.
This commit is contained in:
Andre Heider 2019-12-20 15:47:17 +01:00
parent a6991f0aba
commit 64c73805fe
2 changed files with 15 additions and 0 deletions

View File

@ -35,6 +35,7 @@ To control the build behaviour of your package, use variables in the top-down or
| PKG_BUILD_FLAGS | - | no | A space separated list of flags with which to fine-tune the build process. Flags can be enabled or disabled with a `+` or `-` prefix. For detailed information, see the [Reference](#build_flags-options). |
| PKG_PYTHON_VERSION | python3.7 | no | Define the Python version to be used. |
| PKG_IS_KERNEL_PKG | - | no | Set to `yes` for packages that include Linux kernel modules |
| PKG_DEPENDS_CONFIG | - | no | Space separated list of packages to add to PKG_CONFIG_PATH. Use this to build with support for `-sysroot` packages (See [reference](BUILD_FLAGS options). |
#### Meson Options
| Variable | Default | Required |Description |

View File

@ -231,6 +231,20 @@ if [ -f "${PKG_CONFIGURE_SCRIPT}" -o -f "${PKG_CMAKE_SCRIPT}" -o -f "${PKG_MESON
fi
# configure
if [ -n "${PKG_DEPENDS_CONFIG}" -a -n "${PKG_INSTALL}" ]; then
for pkg in ${PKG_DEPENDS_CONFIG}; do
for dir in "$(get_install_dir ${pkg})"/{usr/local/,usr/,}{lib/,share/}pkgconfig; do
if [ -d "${dir}" ]; then
build_msg "CLR_TOOLCHAIN" "PKG_CONFIG_PATH" "${dir}"
[ -n "${PKG_CONFIG_PATH}" ] && PKG_CONFIG_PATH+=":"
PKG_CONFIG_PATH+="${dir}"
fi
done
done
export PKG_CONFIG_PATH
fi
pkg_call_exists pre_configure && pkg_call pre_configure
pkg_call_exists pre_configure_${TARGET} && pkg_call pre_configure_${TARGET}