From 64c73805fee7b66e4fee450d8d62cf4547a878ba Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Fri, 20 Dec 2019 15:47:17 +0100 Subject: [PATCH] build: add PKG_DEPENDS_CONFIG to set PKG_CONFIG_PATH for packages To be used for "-sysroot" packages. --- packages/readme.md | 1 + scripts/build | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/packages/readme.md b/packages/readme.md index dda9bc6b3a..74da4cb58c 100644 --- a/packages/readme.md +++ b/packages/readme.md @@ -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 | diff --git a/scripts/build b/scripts/build index 82419f992d..88dae73782 100755 --- a/scripts/build +++ b/scripts/build @@ -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}