Small update to getprefix.
[Python-Scripts.git] / PySmile / pysmile-run
blob71a921d512fde156c169cfa4ca3ba808ac0d14af
1 #!/bin/sh
3 if [ -z "${PYTHON}" ]; then
4 export PYTHON="$(/usr/bin/which python2)"
5 fi
6 if [ -z "${CC}" ]; then
7 export CC="$(/usr/bin/which gcc)"
8 fi
9 if [ "${2}" = "Python" ]; then
10 ./pysmile-gen "${1}" "${2}" | ${PYTHON} -b -B -x -
11 elif [ "${2}" = "Py" ]; then
12 ./pysmile-gen "${1}" "${2}" | ${PYTHON} -b -B -x -
13 elif [ "${2}" = "C" ]; then
14 export CTEMPFILE=$(${PYTHON} -b -B -c 'import tempfile; print tempfile.mktemp();');
15 CC="${CC}" ./pysmile-gcc "${1}" "${CTEMPFILE}"
16 ${CTEMPFILE}
17 rm -v ${CTEMPFILE}
18 else
19 ./pysmile-gen "${1}" "${2}" | ${PYTHON} -b -B -x -