summaryrefslogtreecommitdiffstats
path: root/linux/b
blob: e5fbbf360d9641a7e2199fe2e627773c3e1fa7e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/bash

waf=waf-1.9.3
p2=${PYTHON:-${PYTHON2:-python2.7}}
p3=${PYTHON3:-python3}


# try Pythons which can load waf

if $p2 $waf --help &> /dev/null; then
    $p2 $waf $@
elif $p3 $waf --help &> /dev/null; then
    $p3 $waf $@

# waf can't be loaded, print the error with available Python

elif which $p2 &> /dev/null; then
    $p2 $waf $@
elif which $p3 &> /dev/null; then
    $p3 $waf $@

# no Python available

else
    echo Required Python 2.7 or 3
    exit 1
fi