Skip to content

Commit

Permalink
Added build support for Python3+ and Python2.6+
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri van Heesch committed Jun 15, 2014
1 parent 3333536 commit 98a54c5
Show file tree
Hide file tree
Showing 7 changed files with 262 additions and 246 deletions.
20 changes: 14 additions & 6 deletions configure
Expand Up @@ -594,36 +594,44 @@ fi

# - check for python ----------------------------------------------------------

python_version=0
printf " Checking for python... "
if test "$f_python" = NO; then
python_names="python2 python"
python_names="python3 python2 python"
python_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
python_prog=NO
python_found=NO
for i in $python_names; do
for j in $python_dirs; do
if test -x "$j/$i"; then
python_found=YES
if test `$j/$i -c "import sys; print sys.version_info[0]"` = 2; then
python_prog="$j/$i"
if test `$j/$i -c "import sys; print(sys.version_info[0])"` = 3; then
python_prog="$j/$i";
python_version=`$j/$i -c "import platform; print(platform.python_version())"`;
break 2
elif test `$j/$i -c "import sys; print(sys.version_info[0])"` = 2; then
if test `$j/$i -c "import sys; print(sys.version_info[1])"` -ge 6; then
python_prog="$j/$i";
python_version=`$j/$i -c "import platform; print(platform.python_version())"`;
break 2
fi
fi
fi
done
done
f_python="$python_prog"
f_python="$python_prog"
fi

if test "$f_python" = NO; then
if test "$python_found" = YES; then
echo "version should be python 2."
echo "version should be python 2.6 or higher."
else
echo "not found!";
fi
echo
exit 2
fi
echo "using $f_python";
echo "using $f_python (version $python_version)";

# - check for perl ------------------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions doc/install.doc
Expand Up @@ -556,6 +556,7 @@ open-source tools:
<li>GNU bison version 2.5 (Linux) and 2.3 (MacOSX)
<li>GNU make version 3.81
<li>Perl version 5.12
<li>Python verion 2.7 and 3.4
<li>TeX Live 2009 (or later)
</ul>

Expand Down

0 comments on commit 98a54c5

Please sign in to comment.