;ς
ό?c           @   sΞ   d  Z  d Z d k Z d k Z d k Z d k l Z l Z d k l	 Z	 d k
 l Z d k l Z l Z l Z d k l Z d e	 f d	     YZ d
 e f d     YZ d Z d Z d Z d   Z d   Z d S(   s  distutils.cygwinccompiler

Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows.  It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
s>   $Id: cygwinccompiler.py,v 1.24 2003/04/14 12:51:26 jlt63 Exp $N(   s   gen_preprocess_optionss   gen_lib_options(   s   UnixCCompiler(   s
   write_file(   s   DistutilsExecErrors   CompileErrors   UnknownFileError(   s   logs   CygwinCCompilerc           B   s   t  Z d Z d Z d Z d Z d Z d Z d Z d d d d	  Z	 d
   Z
 e e e e e d e e e e d 
 Z d d d  Z RS(   Ns   cygwins   .os   .as   .dlls   lib%s%ss   %s%ss   .exei    c         C   sR  t  i |  | | |  t   \ } } |  i	 d | | f  | t
 j	 o |  i d |  n t   \ |  _ |  _ |  _ |  i	 |  i d |  i |  i |  i f  |  i d j o d |  _ n
 d |  _ |  i d j o
 d } n d	 } |  i d
 d d d d d d d |  i | f  |  i d j o d g |  _ |  i d  n
 g  |  _ d  S(   Ns%   Python's GCC status: %s (details: %s)s   Python's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros.s   : gcc %s, ld %s, dllwrap %s
s   2.10.90s   gccs   dllwraps   2.13s   -shareds   -mdll -statics   compilers   gcc -mcygwin -O -Walls   compiler_sos   gcc -mcygwin -mdll -O -Walls
   linker_exes   gcc -mcygwins	   linker_sos   %s -mcygwin %ss   2.91.57s   msvcrts,   Consider upgrading to a newer version of gcc(   s   UnixCCompilers   __init__s   selfs   verboses   dry_runs   forces   check_config_hs   statuss   detailss   debug_prints   CONFIG_H_OKs   warns   get_versionss   gcc_versions
   ld_versions   dllwrap_versions   compiler_types
   linker_dlls   shared_options   set_executabless   dll_libraries(   s   selfs   verboses   dry_runs   forces   statuss   detailss   shared_option(    (    s6   /mit/python/lib/python2.3/distutils/cygwinccompiler.pys   __init__E   s*    *
	
c         C   s­   | d j p
 | d j oE y  |  i d d | d | g  Wq© t j
 o } t |  q© XnK y) |  i |  i | | d | g |  Wn t j
 o } t |  n Xd  S(   Ns   .rcs   .ress   windress   -is   -o(   s   exts   selfs   spawns   srcs   objs   DistutilsExecErrors   msgs   CompileErrors   compiler_sos   cc_argss   extra_postargs(   s   selfs   objs   srcs   exts   cc_argss   extra_postargss   pp_optss   msg(    (    s6   /mit/python/lib/python2.3/distutils/cygwinccompiler.pys   _compile   s     )c         C   sβ  t  i  |
 p g   }
 t  i  | p g   } t  i  | p g   } | i |  i  | t j	 o | |  i
 j p |  i d j ot i i | d  } t i i t i i |   \ } } t i i | | d  } t i i | d | d  } d t i i |  d g } x | D] } | i |  qW|  i t | | f d |  |  i d	 j o* |
 i d
 | g  |
 i d | g  q| i |  n |	 o |
 i d  n t i |  | | | | | | | t |	 |
 | | |  d  S(   Ns   gcci    s   .defs   libs   .as
   LIBRARY %ss   EXPORTSs
   writing %ss   dllwraps   --output-libs   --defs   -s(&   s   copys   extra_preargss	   librariess   objectss   extends   selfs   dll_librariess   export_symbolss   Nones   target_descs
   EXECUTABLEs
   linker_dlls   oss   paths   dirnames   temp_dirs   splitexts   basenames   output_filenames   dll_names   dll_extensions   joins   def_files   lib_files   contentss   syms   appends   executes
   write_files   debugs   UnixCCompilers   links
   output_dirs   library_dirss   runtime_library_dirss   extra_postargss
   build_temps   target_lang(   s   selfs   target_descs   objectss   output_filenames
   output_dirs	   librariess   library_dirss   runtime_library_dirss   export_symbolss   debugs   extra_preargss   extra_postargss
   build_temps   target_langs   dll_names   dll_extensions   contentss   temp_dirs   lib_files   syms   def_file(    (    s6   /mit/python/lib/python2.3/distutils/cygwinccompiler.pys   link   sF    -
$ 	s    c         C   s  | t j o
 d } n g  } xθ | D]ΰ } t i i t i i |   \ } } | |  i d d g j o t d | | f  n | o t i i |  } n | d j p
 | d j o+ | i t i i | | | |  i   q$ | i t i i | | |  i   q$ W| Sd  S(   Ns    s   .rcs   .ress"   unknown file type '%s' (from '%s')(   s
   output_dirs   Nones	   obj_namess   source_filenamess   src_names   oss   paths   splitexts   normcases   bases   exts   selfs   src_extensionss   UnknownFileErrors	   strip_dirs   basenames   appends   joins   obj_extension(   s   selfs   source_filenamess	   strip_dirs
   output_dirs	   obj_namess   exts   bases   src_name(    (    s6   /mit/python/lib/python2.3/distutils/cygwinccompiler.pys   object_filenamesρ   s      
 $(   s   __name__s
   __module__s   compiler_types   obj_extensions   static_lib_extensions   shared_lib_extensions   static_lib_formats   shared_lib_formats   exe_extensions   __init__s   _compiles   Nones   links   object_filenames(    (    (    s6   /mit/python/lib/python2.3/distutils/cygwinccompiler.pys   CygwinCCompiler;   s   ;	'cs   Mingw32CCompilerc           B   s    t  Z d Z d d d d  Z RS(   Ns   mingw32i    c         C   s   t  i |  | | |  |  i d j o
 d } n d } |  i d j o
 d } n d } |  i
 d d d	 d
 d d d d |  i | | f  g  |  _ d  S(   Ns   2.13s   -shareds   -mdll -statics   2.91.57s   --entry _DllMain@12s    s   compilers   gcc -mno-cygwin -O -Walls   compiler_sos   gcc -mno-cygwin -mdll -O -Walls
   linker_exes   gcc -mno-cygwins	   linker_sos   %s -mno-cygwin %s %s(   s   CygwinCCompilers   __init__s   selfs   verboses   dry_runs   forces
   ld_versions   shared_options   gcc_versions   entry_points   set_executabless
   linker_dlls   dll_libraries(   s   selfs   verboses   dry_runs   forces   shared_options   entry_point(    (    s6   /mit/python/lib/python2.3/distutils/cygwinccompiler.pys   __init__  s    

(   s   __name__s
   __module__s   compiler_types   __init__(    (    (    s6   /mit/python/lib/python2.3/distutils/cygwinccompiler.pys   Mingw32CCompiler  s   s   oks   not oks	   uncertainc          C   sή   d k  l } d k }  |  i t i d  d j o t d f Sn | i   } y& t	 |  } | i   } | i   Wn, t j
 o  } t d | | i f f Sn; X|  i | d  d j o t d | f Sn t d	 | f Sd S(
   s‘  Check if the current Python installation (specifically, pyconfig.h)
    appears amenable to building extensions with GCC.  Returns a tuple
    (status, details), where 'status' is one of the following constants:
      CONFIG_H_OK
        all is well, go ahead and compile
      CONFIG_H_NOTOK
        doesn't look good
      CONFIG_H_UNCERTAIN
        not sure -- unable to read pyconfig.h
    'details' is a human-readable string explaining the situation.

    Note there are two ways to conclude "OK": either 'sys.version' contains
    the string "GCC" (implying that this Python was built with GCC), or the
    installed "pyconfig.h" contains the string "__GNUC__".
    (   s	   sysconfigNs   GCCi    s   sys.version mentions 'GCC's   couldn't read '%s': %ss   __GNUC__s   '%s' mentions '__GNUC__'s    '%s' does not mention '__GNUC__'(   s	   distutilss	   sysconfigs   strings   finds   syss   versions   CONFIG_H_OKs   get_config_h_filenames   fns   opens   fs   reads   ss   closes   IOErrors   excs   CONFIG_H_UNCERTAINs   strerrors   CONFIG_H_NOTOK(   s   strings   fs	   sysconfigs   ss   fns   exc(    (    s6   /mit/python/lib/python2.3/distutils/cygwinccompiler.pys   check_config_hA  s     	c          C   s·  d k  l } d k l }  d k } |  d  } | oh t i | d d  } | i	   }
 | i   | i d |
  } | o | | i d   } q€ t } n t } |  d	  } | oh t i | d
 d  } | i	   }
 | i   | i d |
  } | o | | i d   } q%t } n t } |  d  } | oh t i | d d  } | i	   }
 | i   | i d |
  } | o | | i d   }	 q¦t }	 n t }	 | | |	 f Sd S(   sj    Try to find out the versions of gcc, ld and dllwrap.
        If not possible it returns None for it.
    (   s   StrictVersion(   s   find_executableNs   gccs    -dumpversions   rs   (\d+\.\d+(\.\d+)*)i   s   lds    -vs   dllwraps
    --versions    (\d+\.\d+(\.\d+)*)(   s   distutils.versions   StrictVersions   distutils.spawns   find_executables   res   gcc_exes   oss   popens   outs   reads
   out_strings   closes   searchs   results   groups   gcc_versions   Nones   ld_exes
   ld_versions   dllwrap_exes   dllwrap_version(   s   find_executables   dllwrap_exes
   ld_versions   StrictVersions   res   gcc_exes   results   ld_exes   gcc_versions   dllwrap_versions
   out_strings   out(    (    s6   /mit/python/lib/python2.3/distutils/cygwinccompiler.pys   get_versionst  sF     	





(   s   __doc__s   __revision__s   oss   syss   copys   distutils.ccompilers   gen_preprocess_optionss   gen_lib_optionss   distutils.unixccompilers   UnixCCompilers   distutils.file_utils
   write_files   distutils.errorss   DistutilsExecErrors   CompileErrors   UnknownFileErrors	   distutilss   logs   CygwinCCompilers   Mingw32CCompilers   CONFIG_H_OKs   CONFIG_H_NOTOKs   CONFIG_H_UNCERTAINs   check_config_hs   get_versions(   s   __revision__s   DistutilsExecErrors   logs   gen_preprocess_optionss   Mingw32CCompilers   get_versionss   gen_lib_optionss   CONFIG_H_NOTOKs   check_config_hs   UnixCCompilers   syss   CygwinCCompilers   CONFIG_H_UNCERTAINs   CompileErrors
   write_files   copys   oss   UnknownFileErrors   CONFIG_H_OK(    (    s6   /mit/python/lib/python2.3/distutils/cygwinccompiler.pys   ?   s   +Τ.	3