sb: Add support to search for a suitable version of python.

The command python has been removed from upstream python and python2
and python3 is now used. This patch wraps the commands in a shell
script that locates a suitable python to run.

Updates #3537
This commit is contained in:
Chris Johns
2018-10-07 20:59:45 +11:00
parent 8992d20b8c
commit 13f4c37999
27 changed files with 914 additions and 369 deletions

View File

@@ -1,7 +1,7 @@
#! /usr/bin/env python
#! /bin/sh
#
# RTEMS Tools Project (http://www.rtems.org/)
# Copyright 2013 Chris Johns (chrisj@rtems.org)
# Copyright 2018 Chris Johns (chrisj@rtems.org)
# All rights reserved.
#
# This file is part of the RTEMS Tools package in 'rtems-tools'.
@@ -17,15 +17,11 @@
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
from __future__ import print_function
import sys, os
base = os.path.dirname(sys.argv[0])
sys.path.insert(0, base + '/sb')
try:
import bootstrap
bootstrap.run(sys.argv)
except ImportError:
print("Incorrect Source Builder installation", file = sys.stderr)
sys.exit(1)
#
set -e
base=$(dirname $0)
PYTHON_CMD=${base}/sb/cmd-bootstrap.py
if test -f ${base}/sb/python-wrapper.sh; then
. ${base}/sb/python-wrapper.sh
fi
echo "error: python wrapper not found"