Commit 98a54c57 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Added build support for Python3+ and Python2.6+

parent 3333536d
......@@ -594,9 +594,10 @@ 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
......@@ -604,9 +605,16 @@ if test "$f_python" = NO; then
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
......@@ -616,14 +624,14 @@ 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 ------------------------------------------------------------
......
......@@ -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>
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@ import sys
if (len(sys.argv) > 1):
if (sys.argv[1] == "ENONLY"):
print "#define ENGLISH_ONLY"
print("#define ENGLISH_ONLY")
else:
for x in xrange(1, len(sys.argv)):
print "#define LANG_%s"%(sys.argv[x])
for x in range(1, len(sys.argv)):
print("#define LANG_%s"%(sys.argv[x]))
......@@ -15,7 +15,7 @@ for f in files:
# generating file is lang_cfg.py
# the rules file has to output lang_cfg.h
#
print """\
print("""\
<?xml version="1.0" encoding="utf-8"?>
<VisualStudioToolFile
Name="languages"
......@@ -52,7 +52,7 @@ print """\
/>
</Values>
</EnumProperty>
"""
""")
#
# generate loop, English is mandatory (so cannot be chosen)
#
......@@ -76,7 +76,7 @@ for f in new_list:
l1 = l.replace("-","")
# capatalize first letter
l = l.title()
print """\
print("""\
<EnumProperty
Name="%s"
DisplayName="Use %s"
......@@ -96,11 +96,11 @@ for f in new_list:
/>
</Values>
</EnumProperty>
""" % (l1, l, l, l, f[1], l)
""" % (l1, l, l, l, f[1], l))
print """\
print("""\
</Properties>
</CustomBuildRule>
</Rules>
</VisualStudioToolFile>
"""
""")
#if defined(__APPLE__) || defined(macintosh)
// define this before including iconv.h to avoid a mapping of
// iconv_open and friends to libicon_open (done by mac ports),
// while the symbols without 'lib' are linked from /usr/lib/libiconv
#define LIBICONV_PLUG
#endif
#include <iconv.h>
// These functions are implemented in a C file, because there are different
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment