diff options
author | Greg Ward <gward@python.net> | 2000-06-07 03:00:06 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-06-07 03:00:06 (GMT) |
commit | 9d17a7ad6df0a940f8f10cf7a113aaffc4222309 (patch) | |
tree | 825174ee769bf6ab27252f9a2965ed2b81680fb5 /Lib/distutils/ccompiler.py | |
parent | 1169687692e5e897033421fe6a73a3c32675a7d7 (diff) | |
download | cpython-9d17a7ad6df0a940f8f10cf7a113aaffc4222309.zip cpython-9d17a7ad6df0a940f8f10cf7a113aaffc4222309.tar.gz cpython-9d17a7ad6df0a940f8f10cf7a113aaffc4222309.tar.bz2 |
Patch from Rene Liebscher: this adds "--help-foo" options to list the
values that "--foo" can take for various commands: eg. what formats for
"sdist" and "bdist", what compilers for "build_ext" and "build_clib".
I have *not* reviewed this patch; I'm checking it in as-is because it also
fixes a paper-bag-over-head bug in bdist.py, and because I won't have
time to review it properly for several days: so someone else can
test it for me, instead!
Diffstat (limited to 'Lib/distutils/ccompiler.py')
-rw-r--r-- | Lib/distutils/ccompiler.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py index 834d543..b146f89 100644 --- a/Lib/distutils/ccompiler.py +++ b/Lib/distutils/ccompiler.py @@ -726,10 +726,22 @@ default_compiler = { 'posix': 'unix', # Map compiler types to (module_name, class_name) pairs -- ie. where to # find the code that implements an interface to this compiler. (The module # is assumed to be in the 'distutils' package.) -compiler_class = { 'unix': ('unixccompiler', 'UnixCCompiler'), - 'msvc': ('msvccompiler', 'MSVCCompiler'), +compiler_class = { 'unix': ('unixccompiler', 'UnixCCompiler',"standard UNIX-style compiler"), + 'msvc': ('msvccompiler', 'MSVCCompiler',"Microsoft Visual C++"), + 'cygwin': ('cygwinccompiler', 'CygwinCCompiler',"Cygwin-Gnu-Win32-C-Compiler"), + 'mingw32': ('cygwinccompiler', 'Mingw32CCompiler',"MinGW32-C-Compiler (or cygwin in this mode)"), } +# prints all possible arguments to --compiler +def show_compilers(): + from distutils.fancy_getopt import FancyGetopt + list_of_compilers=[] + for compiler in compiler_class.keys(): + list_of_compilers.append(("compiler="+compiler,None,compiler_class[compiler][2])) + list_of_compilers.sort() + pretty_printer=FancyGetopt(list_of_compilers) + pretty_printer.print_help("List of available compilers:") + def new_compiler (plat=None, compiler=None, @@ -755,7 +767,7 @@ def new_compiler (plat=None, if compiler is None: compiler = default_compiler[plat] - (module_name, class_name) = compiler_class[compiler] + (module_name, class_name,long_description) = compiler_class[compiler] except KeyError: msg = "don't know how to compile C/C++ code on platform '%s'" % plat if compiler is not None: |