aboutsummaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-02-14 16:41:09 +0000
committerng0 <ng0@n0.is>2019-02-14 16:41:09 +0000
commit783ac3513030b6006d117f156cfc068148757bcf (patch)
tree8d0e2cce1dc0a591c4c15ec0299d00dbfaac571f /bootstrap
parentb54371bd5ca3d86e7e8383149975fdc31b14d0a7 (diff)
downloadgnunet-783ac3513030b6006d117f156cfc068148757bcf.tar.gz
gnunet-783ac3513030b6006d117f156cfc068148757bcf.zip
Switch to python3.7 (integration-tests incomplete), continue using python2.7 for gnunet-qr with an incredible annoying workaround for autotools inability to deal with 2 major python versions at the same time
Signed-off-by: ng0 <ng0@n0.is>
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap40
1 files changed, 40 insertions, 0 deletions
diff --git a/bootstrap b/bootstrap
index 3155cff61..8fb025599 100755
--- a/bootstrap
+++ b/bootstrap
@@ -19,3 +19,43 @@ else
19 echo "*** No libtoolize (libtool) or libtool found, please install it ***" >&2; 19 echo "*** No libtoolize (libtool) or libtool found, please install it ***" >&2;
20 exit 1 20 exit 1
21fi 21fi
22
23# autotools is being incredible stupid with multiple python versions
24# what we do here is check for a functional python 2.7 which reports
25# back to be a real python 2.7, then later on sed the location in
26# the only python 2.7 file we keep around
27# the rest of the build system can then be happy detecting 3.7 or
28# higher
29# this checks a range of names which is as annoying as what autotools
30# is doing
31# Since everything we could try is do too much work, we will assume
32# that python2 OR python2.7 are the names for python 2.7.
33# If your system diverges, please sed it accordingly!
34echo "save python 2.7 location into src/util/python27_location"
35#if existence python2 || existence python2.7; then
36# echo command -v
37python_version()
38{
39 "$1" -c "print(__import__('sys').version)" | grep -Z "2.7" | cut -c1-3
40}
41
42if existence python; then
43 if [ ! -z "${python_version} python" ]; then
44 loc1=$(command -v python)
45 echo "$loc1" >./src/util/python27_location
46 fi
47elif existence python2; then
48 if [ ! -z "${python_version} python2" ]; then
49 loc2=$(command -v python2)
50 echo "$loc2" >./src/util/python27_location
51 fi
52elif existence python2.7; then
53 if [ ! -z "${python_version} python2.7" ]; then
54 loc3=$(command -v python2.7)
55 echo "$loc3" >./src/util/python27_location
56 fi
57else
58 echo "*** No python 2.7 binary found, please install it" >&2
59 echo "*** for the optional gnunet-qr to work." >&2
60 echo "*** Make sure to install a matching python future module." >&2
61fi