From bf71ef864b193c3e41271f1d43d8ad9f64c4101f Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Mon, 18 Dec 2017 11:09:55 +0000 Subject: [PATCH] buildsystem: add configure_package function to finalise package initialisation --- config/path | 8 ++++++++ scripts/build | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/config/path b/config/path index e3a768f136..748c066504 100644 --- a/config/path +++ b/config/path @@ -112,6 +112,7 @@ unset LD_LIBRARY_PATH fi if [ -n "$PKG_DIR" -a -r $PKG_DIR/package.mk ]; then + unset -f configure_package . $PKG_DIR/package.mk [ -z "$PKG_SHORTDESC" ] && PKG_SHORTDESC="$PKG_NAME (autogenerated)" [ -z "$PKG_LONGDESC" ] && PKG_LONGDESC="$PKG_NAME (autogenerated)" @@ -208,6 +209,13 @@ if [ "$DISABLE_COLORS" != "yes" ]; then endcolor="\e[0m" fi +# If sourcing a package, configure any package variables dependent on variables we have set +if [ -n "$PKG_DIR" -a -r $PKG_DIR/package.mk ]; then + if [ "$(type -t configure_package)" = "function" ]; then + configure_package + fi +fi + # multilib? nah unset CONFIG_SITE diff --git a/scripts/build b/scripts/build index 5986653796..dd7128c62e 100755 --- a/scripts/build +++ b/scripts/build @@ -80,6 +80,7 @@ rm -f $STAMP setup_toolchain $TARGET # unset functions +unset -f configure_package unset -f pre_build_target unset -f pre_configure_target unset -f configure_target @@ -207,6 +208,11 @@ BOOTSTRAP_MESON_OPTS="$HOST_MESON_OPTS" # include buildfile . $PKG_DIR/package.mk +# finalise package configuration +if [ "$(type -t configure_package)" = "function" ]; then + configure_package +fi + if [ "$PKG_IS_KERNEL_PKG" = "yes" ]; then if [ "$TARGET_KERNEL_ARCH" = "arm64" -a "$TARGET_ARCH" = "arm" ]; then TARGET_PREFIX=$TOOLCHAIN/lib/gcc-linaro-aarch64-linux-gnu/bin/aarch64-linux-gnu-