diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2010-10-16 22:18:54 +0300 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2010-10-16 22:18:54 +0300 |
commit | 9dd7c7b8ad826beefbbc0c10ff457c62f1be223d (patch) | |
tree | 8b377a512813eae1ace1b5acfa348a85f1f866e5 /numpy/distutils | |
parent | 43b05fdd1c0ba1c6686297d16d257985dd986d3b (diff) | |
download | numpy-9dd7c7b8ad826beefbbc0c10ff457c62f1be223d.tar.gz |
UPDATE: gcc-4 series do not support -mno-cygwin option.
Diffstat (limited to 'numpy/distutils')
-rw-r--r-- | numpy/distutils/fcompiler/gnu.py | 18 | ||||
-rw-r--r-- | numpy/distutils/mingw32ccompiler.py | 18 |
2 files changed, 27 insertions, 9 deletions
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py index 632c6d97a..dd1fbb2cc 100644 --- a/numpy/distutils/fcompiler/gnu.py +++ b/numpy/distutils/fcompiler/gnu.py @@ -224,7 +224,17 @@ class Gnu95FCompiler(GnuFCompiler): v = self.gnu_version_match(version_string) if not v or v[0] != 'gfortran': return None - return v[1] + v = v[1] + if v>='4.': + # gcc-4 series releases do not support -mno-cygwin option + pass + else: + # use -mno-cygwin flag for gfortran when Python is not Cygwin-Python + if sys.platform == 'win32': + for key in ['version_cmd', 'compiler_f77', 'compiler_f90', + 'compiler_fix', 'linker_so', 'linker_exe']: + self.executables[key].append('-mno-cygwin') + return v # 'gfortran --version' results: # XXX is the below right? @@ -248,12 +258,6 @@ class Gnu95FCompiler(GnuFCompiler): 'linker_exe' : [None, "-Wall"] } - # use -mno-cygwin flag for g77 when Python is not Cygwin-Python - if sys.platform == 'win32': - for key in ['version_cmd', 'compiler_f77', 'compiler_f90', - 'compiler_fix', 'linker_so', 'linker_exe']: - executables[key].append('-mno-cygwin') - module_dir_switch = '-J' module_include_switch = '-I' diff --git a/numpy/distutils/mingw32ccompiler.py b/numpy/distutils/mingw32ccompiler.py index 907e0047c..f5d996490 100644 --- a/numpy/distutils/mingw32ccompiler.py +++ b/numpy/distutils/mingw32ccompiler.py @@ -104,11 +104,19 @@ class Mingw32CCompiler(distutils.cygwinccompiler.CygwinCCompiler): # bad consequences, like using Py_ModuleInit4 instead of # Py_ModuleInit4_64, etc... So we add it here if get_build_architecture() == 'AMD64': - self.set_executables( + if self.gcc_version < "4.": + self.set_executables( compiler='gcc -g -DDEBUG -DMS_WIN64 -mno-cygwin -O0 -Wall', compiler_so='gcc -g -DDEBUG -DMS_WIN64 -mno-cygwin -O0 -Wall -Wstrict-prototypes', linker_exe='gcc -g -mno-cygwin', linker_so='gcc -g -mno-cygwin -shared') + else: + # gcc-4 series releases do not support -mno-cygwin option + self.set_executables( + compiler='gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall', + compiler_so='gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes', + linker_exe='gcc -g', + linker_so='gcc -g -shared') else: if self.gcc_version <= "3.0.0": self.set_executables(compiler='gcc -mno-cygwin -O2 -w', @@ -116,11 +124,17 @@ class Mingw32CCompiler(distutils.cygwinccompiler.CygwinCCompiler): linker_exe='g++ -mno-cygwin', linker_so='%s -mno-cygwin -mdll -static %s' % (self.linker, entry_point)) - else: + elif self.gcc_version < "4.": self.set_executables(compiler='gcc -mno-cygwin -O2 -Wall', compiler_so='gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes', linker_exe='g++ -mno-cygwin', linker_so='g++ -mno-cygwin -shared') + else: + # gcc-4 series releases do not support -mno-cygwin option + self.set_executables(compiler='gcc -O2 -Wall', + compiler_so='gcc -O2 -Wall -Wstrict-prototypes', + linker_exe='g++ ', + linker_so='g++ -shared') # added for python2.3 support # we can't pass it through set_executables because pre 2.2 would fail self.compiler_cxx = ['g++'] |