annotate mingw32distutils.py @ 3172:d1b367fc08bc tests-returncode

Use a return code of 1 when the tests fail.
author Thomas Kluyver <takowl@gmail.com>
date Wed, 09 Jan 2013 10:13:57 +0000
parents a787fef11a25
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
916
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
1 # module mingw32distutils.py
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
2 # Requires Python 2.1 or better.
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
3
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
4 """Enhance distutils mingw32 compilation by adding Win32 GUI/console support."""
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
5
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
6 from distutils import ccompiler
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
7 from distutils.errors import DistutilsModuleError
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
8
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
9 compilers = ['mingw32', 'mingw32-console']
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
10
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
11 # Add the compiler classes to the ccompiler table. Unfortunate hacks follow.
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
12
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
13 compiler_class = ccompiler.compiler_class
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
14 value = compiler_class['mingw32']
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
15 assert len(value) == 3, "distutils.ccompiler.compiler_class has changed"
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
16 compiler_class['mingw32'] = ('', '',
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
17 value[2] + ", Win32 GUI shared libraries defaullt")
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
18 compiler_class['mingw32-console'] = ('', '',
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
19 value[2] + ", console shared libraries")
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
20
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
21 original_new_compiler = ccompiler.new_compiler
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
22 def new_compiler (plat=None,
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
23 compiler=None,
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
24 verbose=0,
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
25 dry_run=0,
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
26 force=0):
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
27 """Recognizes replacement mingw32 compiler classes"""
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
28
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
29 if compiler == 'mingw32':
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
30 from mingw32ccompiler import Mingw32DefaultCCompiler
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
31 return Mingw32DefaultCCompiler (None, dry_run, force)
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
32 if compiler == 'mingw32-console':
938
a787fef11a25 small repairs for MinGW build
Lenard Lindstrom <len-l@telus.net>
parents: 916
diff changeset
33 from mingw32ccompiler import Mingw32ConsoleCCompiler
916
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
34 return Mingw32ConsoleCCompiler (None, dry_run, force)
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
35 return original_new_compiler (plat, compiler, verbose, dry_run, force)
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
36
8a7d9b2de067 MinGW/MSYS build process more automated and DLLs Win32 GUI by default
Lenard Lindstrom <len-l@telus.net>
parents:
diff changeset
37 ccompiler.new_compiler = new_compiler