reverting partially distutils to its 2.6.x state so 2.7a4 looks more like the 2.7b1 in this. the whole revert will occur after a4 is tagged
diff --git a/Lib/distutils/emxccompiler.py b/Lib/distutils/emxccompiler.py
index f2f77e5..f52e632 100644
--- a/Lib/distutils/emxccompiler.py
+++ b/Lib/distutils/emxccompiler.py
@@ -21,13 +21,12 @@
__revision__ = "$Id$"
-import os, sys, copy
-from warnings import warn
-
+import os,sys,copy
+from distutils.ccompiler import gen_preprocess_options, gen_lib_options
from distutils.unixccompiler import UnixCCompiler
from distutils.file_util import write_file
from distutils.errors import DistutilsExecError, CompileError, UnknownFileError
-from distutils.util import get_compiler_versions
+from distutils import log
class EMXCCompiler (UnixCCompiler):
@@ -56,8 +55,8 @@
("Reason: %s." % details) +
"Compiling may fail because of undefined preprocessor macros.")
- gcc_version, ld_version, dllwrap_version = get_compiler_versions()
- self.gcc_version, self.ld_version = gcc_version, ld_version
+ (self.gcc_version, self.ld_version) = \
+ get_versions()
self.debug_print(self.compiler_type + ": gcc %s, ld %s\n" %
(self.gcc_version,
self.ld_version) )
@@ -294,11 +293,23 @@
""" Try to find out the versions of gcc and ld.
If not possible it returns None for it.
"""
- warn("'distutils.emxccompiler.get_versions' is deprecated "
- "use 'distutils.util.get_compiler_versions' instead",
- DeprecationWarning)
+ from distutils.version import StrictVersion
+ from distutils.spawn import find_executable
+ import re
+ gcc_exe = find_executable('gcc')
+ if gcc_exe:
+ out = os.popen(gcc_exe + ' -dumpversion','r')
+ out_string = out.read()
+ out.close()
+ result = re.search('(\d+\.\d+\.\d+)',out_string)
+ if result:
+ gcc_version = StrictVersion(result.group(1))
+ else:
+ gcc_version = None
+ else:
+ gcc_version = None
# EMX ld has no way of reporting version number, and we use GCC
# anyway - so we can link OMF DLLs
- gcc_version, ld_version, dllwrap_version = get_compiler_versions()
- return gcc_version, None
+ ld_version = None
+ return (gcc_version, ld_version)