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 ...@@ -594,9 +594,10 @@ fi
# - check for python ---------------------------------------------------------- # - check for python ----------------------------------------------------------
python_version=0
printf " Checking for python... " printf " Checking for python... "
if test "$f_python" = NO; then 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_dirs="$bin_dirs /usr/bin /usr/local/bin /bin /sbin"
python_prog=NO python_prog=NO
python_found=NO python_found=NO
...@@ -604,9 +605,16 @@ if test "$f_python" = NO; then ...@@ -604,9 +605,16 @@ if test "$f_python" = NO; then
for j in $python_dirs; do for j in $python_dirs; do
if test -x "$j/$i"; then if test -x "$j/$i"; then
python_found=YES python_found=YES
if test `$j/$i -c "import sys; print sys.version_info[0]"` = 2; then if test `$j/$i -c "import sys; print(sys.version_info[0])"` = 3; then
python_prog="$j/$i" python_prog="$j/$i";
python_version=`$j/$i -c "import platform; print(platform.python_version())"`;
break 2 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
fi fi
done done
...@@ -616,14 +624,14 @@ fi ...@@ -616,14 +624,14 @@ fi
if test "$f_python" = NO; then if test "$f_python" = NO; then
if test "$python_found" = YES; then if test "$python_found" = YES; then
echo "version should be python 2." echo "version should be python 2.6 or higher."
else else
echo "not found!"; echo "not found!";
fi fi
echo echo
exit 2 exit 2
fi fi
echo "using $f_python"; echo "using $f_python (version $python_version)";
# - check for perl ------------------------------------------------------------ # - check for perl ------------------------------------------------------------
......
...@@ -556,6 +556,7 @@ open-source tools: ...@@ -556,6 +556,7 @@ open-source tools:
<li>GNU bison version 2.5 (Linux) and 2.3 (MacOSX) <li>GNU bison version 2.5 (Linux) and 2.3 (MacOSX)
<li>GNU make version 3.81 <li>GNU make version 3.81
<li>Perl version 5.12 <li>Perl version 5.12
<li>Python verion 2.7 and 3.4
<li>TeX Live 2009 (or later) <li>TeX Live 2009 (or later)
</ul> </ul>
......
This diff is collapsed.
This diff is collapsed.
...@@ -2,7 +2,7 @@ import sys ...@@ -2,7 +2,7 @@ import sys
if (len(sys.argv) > 1): if (len(sys.argv) > 1):
if (sys.argv[1] == "ENONLY"): if (sys.argv[1] == "ENONLY"):
print "#define ENGLISH_ONLY" print("#define ENGLISH_ONLY")
else: else:
for x in xrange(1, len(sys.argv)): for x in range(1, len(sys.argv)):
print "#define LANG_%s"%(sys.argv[x]) print("#define LANG_%s"%(sys.argv[x]))
...@@ -15,7 +15,7 @@ for f in files: ...@@ -15,7 +15,7 @@ for f in files:
# generating file is lang_cfg.py # generating file is lang_cfg.py
# the rules file has to output lang_cfg.h # the rules file has to output lang_cfg.h
# #
print """\ print("""\
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<VisualStudioToolFile <VisualStudioToolFile
Name="languages" Name="languages"
...@@ -52,7 +52,7 @@ print """\ ...@@ -52,7 +52,7 @@ print """\
/> />
</Values> </Values>
</EnumProperty> </EnumProperty>
""" """)
# #
# generate loop, English is mandatory (so cannot be chosen) # generate loop, English is mandatory (so cannot be chosen)
# #
...@@ -76,7 +76,7 @@ for f in new_list: ...@@ -76,7 +76,7 @@ for f in new_list:
l1 = l.replace("-","") l1 = l.replace("-","")
# capatalize first letter # capatalize first letter
l = l.title() l = l.title()
print """\ print("""\
<EnumProperty <EnumProperty
Name="%s" Name="%s"
DisplayName="Use %s" DisplayName="Use %s"
...@@ -96,11 +96,11 @@ for f in new_list: ...@@ -96,11 +96,11 @@ for f in new_list:
/> />
</Values> </Values>
</EnumProperty> </EnumProperty>
""" % (l1, l, l, l, f[1], l) """ % (l1, l, l, l, f[1], l))
print """\ print("""\
</Properties> </Properties>
</CustomBuildRule> </CustomBuildRule>
</Rules> </Rules>
</VisualStudioToolFile> </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> #include <iconv.h>
// These functions are implemented in a C file, because there are different // 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