summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2019-09-13 14:25:51 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2019-09-16 16:27:04 +0200
commitde79ed905942d4362451ea2ec3e16bf2c37aa106 (patch)
tree94f82f79a2af466a56446e4065160de239835e3f
parentdb328b77629edbccbf47ff59241905b1d60bc0ae (diff)
downloadptxdist-de79ed905942d4362451ea2ec3e16bf2c37aa106.tar.gz
ptxdist-de79ed905942d4362451ea2ec3e16bf2c37aa106.tar.xz
ptxd_make_world_prepare_init: allow keeping the build tree during prepare for oot packages
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--doc/ref_make_variables.inc5
-rw-r--r--scripts/lib/ptxd_make_world_common.sh8
-rw-r--r--scripts/lib/ptxd_make_world_prepare.sh4
3 files changed, 13 insertions, 4 deletions
diff --git a/doc/ref_make_variables.inc b/doc/ref_make_variables.inc
index e9a5c5a13..08854c7db 100644
--- a/doc/ref_make_variables.inc
+++ b/doc/ref_make_variables.inc
@@ -265,6 +265,11 @@ of the corresponding target package if it exists.
This is especially useful for ``file://`` URLS that point to directories to
keep the source tree free of build files.
+ ``KEEP`` can be used instead of ``YES``. In this case the build tree is
+ not deleted at the beginning of the prepare stage. This make
+ reconfiguration faster. This should only be used for packages that can
+ handle configuration changes correctly and rebuild everything as needed.
+
``<PKG>_SUBDIR``
This is a directory relative to ``<PKG>_DIR``. If set, all build
operations are executed in this directory instead. By default
diff --git a/scripts/lib/ptxd_make_world_common.sh b/scripts/lib/ptxd_make_world_common.sh
index 0a12e39fa..f2b1e22e2 100644
--- a/scripts/lib/ptxd_make_world_common.sh
+++ b/scripts/lib/ptxd_make_world_common.sh
@@ -372,7 +372,7 @@ ptxd_make_world_init() {
esac
fi
case "${pkg_build_oot}" in
- "YES") pkg_build_dir="${pkg_dir}-build" ;;
+ "YES"|"KEEP") pkg_build_dir="${pkg_dir}-build" ;;
"NO") pkg_build_dir="${pkg_conf_dir}" ;;
*) ptxd_bailout "<PKG>_BUILD_OOT: please set to YES or NO" ;;
esac
@@ -381,15 +381,17 @@ ptxd_make_world_init() {
#
# out-of-tree
#
- unset pkg_build_oot
if [ "${pkg_build_dir}" = "${pkg_conf_dir}" ]; then
+ unset pkg_build_oot
#
# some pkgs don't like a full path to their configure
# if building in tree
#
pkg_conf_dir="."
else
- pkg_build_oot=true
+ if [ -z "${pkg_build_oot}" ]; then
+ pkg_build_oot=YES
+ fi
pkg_conf_dir="$(ptxd_abs2rel "${pkg_build_dir}" "${pkg_conf_dir}")"
fi
diff --git a/scripts/lib/ptxd_make_world_prepare.sh b/scripts/lib/ptxd_make_world_prepare.sh
index be3471a46..e21a85b0e 100644
--- a/scripts/lib/ptxd_make_world_prepare.sh
+++ b/scripts/lib/ptxd_make_world_prepare.sh
@@ -158,7 +158,9 @@ export -f ptxd_make_world_prepare_meson
ptxd_make_world_prepare_init() {
# delete existing build_dir
if [ -n "${pkg_build_oot}" ]; then
- rm -rf -- "${pkg_build_dir}" &&
+ if [ "${pkg_build_oot}" = "YES" ]; then
+ rm -rf -- "${pkg_build_dir}"
+ fi &&
mkdir -p -- "${pkg_build_dir}"
fi &&
# remove files from sysroot from the last build