From 4c6e7fa28b66dee069d10b514d5e1317173da250 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Mon, 3 Sep 2018 10:40:49 +0200 Subject: pkg-config: cleanup and improve path and dependency handling - move all search path magic into the wrapper script - use the wrapper script for host packages as well - enforce the dependencies for host packages - make it possible to overwrite the script in the BSP - track host and target dependencies separately Needed e.g. by barebox to build host tools Signed-off-by: Michael Olbrich --- scripts/lib/ptxd_make_world_common.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'scripts/lib/ptxd_make_world_common.sh') diff --git a/scripts/lib/ptxd_make_world_common.sh b/scripts/lib/ptxd_make_world_common.sh index f04d2ed05..86e73538f 100644 --- a/scripts/lib/ptxd_make_world_common.sh +++ b/scripts/lib/ptxd_make_world_common.sh @@ -340,12 +340,21 @@ ptxd_make_world_init() { ;; *) ;; esac - local pkgconfig_whitelist - pkgconfig_whitelist="$(echo $( - for dep in ${pkg_build_deps}; do - cat "${ptx_state_dir}/${dep}.pkgconfig" 2>/dev/null; - done))" - pkg_env="PKGCONFIG_WHITELIST='${pkgconfig_whitelist}' PKGCONFIG_WHITELIST_SRC='${pkg_label}' ${pkg_env}" + local -a deps_host deps_target + local whitelist_host whitelist_target + for dep in ${pkg_build_deps}; do + case "${dep}" in + host-*|cross-*) + deps_host[${#deps_host[@]}]="${ptx_state_dir}/${dep}.pkgconfig" + ;; + *) + deps_target[${#deps_target[@]}]="${ptx_state_dir}/${dep}.pkgconfig" + ;; + esac + done + whitelist_host="$(echo $(cat "${deps_host[@]}" /dev/null 2>/dev/null))" + whitelist_target="$(echo $(cat "${deps_target[@]}" /dev/null 2>/dev/null))" + pkg_env="PKGCONFIG_WHITELIST_HOST='${whitelist_host}' PKGCONFIG_WHITELIST_TARGET='${whitelist_target}' PKGCONFIG_WHITELIST_SRC='${pkg_label}' ${pkg_env}" # DESTDIR if [[ "${pkg_conf_tool}" =~ "python" ]]; then -- cgit v1.2.3