summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2020-01-17 17:53:45 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2020-01-23 17:08:35 +0100
commita63cac26680dd2c7b6615fc9b8623b9b543e1f10 (patch)
tree133c786cdcf94cd2ddf79c33fd3e32e7f8339843 /bin
parentb8060a253bada299010c0169f0ff7470b8c04322 (diff)
downloadptxdist-a63cac26680dd2c7b6615fc9b8623b9b543e1f10.tar.gz
ptxdist-a63cac26680dd2c7b6615fc9b8623b9b543e1f10.tar.xz
wrapper: add python wrapper
It enforces a dependency on host-system-python{,3} and chooses the corresponding Python version when called as 'python'. This makes it possible to use Python 3 for packages that support it but use 'python' to support both Python versions. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ptxdist11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index cd673a9f3..657145918 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -692,6 +692,17 @@ check_compiler() {
}
done
+ ptxd_replace_copy_from_path PTXDIST_PATH "scripts/wrapper/python-wrapper" \
+ "${wrapper_dir}/python-wrapper" &&
+ for python in python2 python2-config python3 python3-config; do
+ if type -P "${python}" > /dev/null; then
+ ptxd_replace_link "python-wrapper" "${wrapper_dir}/${python}" || \
+ ptxd_bailout "Unable to create ${python} wrapper link"
+ ptxd_replace_link "python-wrapper" "${wrapper_dir}/${python/[23]}" || \
+ ptxd_bailout "Unable to create ${python/[23]} wrapper link"
+ fi
+ done &&
+
for tool in ar as nm objcopy objdump ranlib readelf size strip ; do
tool_abs="$(which "${tool}" 2>/dev/null)"
ptxd_replace_link "${tool_abs}" "${wrapper_dir}/${tool}" || \