ฦ
1O๖9c       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 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.8 2000/09/27 02:08:14 gward Exp $N(   s   gen_preprocess_optionss   gen_lib_options(   s   UnixCCompiler(   s
   write_file(   s   DistutilsExecErrors   CompileErrors   UnknownFileErrors   CygwinCCompilerc    
  s   d Z  d Z d Z d Z d Z d Z d Z d	 d	 d	 d  Z e e e d	 e e d
  Z	 e e e e e d	 e e e d 	 Z
 d	 d d  Z RS(   Ns   cygwins   .os   .as   .dlls   lib%s%ss   %s%ss   .exec  
  s4  t  i |  | | |  t   \ } } |  i	 d | | f  | t
 j	 o |  i d d | d  n t   \ |  _ |  _ |  _ |  i	 |  i d |  i |  i |  i f  |  i d j o d |  _ n
 d |  _ |  i d	 d
 d d d d d d |  i  |  i d j o d g |  _ |  i d  n
 g  |  _ d  S(   Ns%   Python's GCC status: %s (details: %s)s:   Python's config.h doesn't seem to support your compiler.  s   Reason: %s.s<   Compiling may fail because of undefined preprocessor macros.s   : gcc %s, ld %s, dllwrap %s
s   2.10.90s   gccs   dllwraps   compilers   gcc -mcygwin -O -Walls   compiler_sos   gcc -mcygwin -mdll -O -Walls
   linker_exes   gcc -mcygwins	   linker_sos   %s -mcygwin -mdll -statics   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   set_executabless   dll_libraries(   s   selfs   verboses   dry_runs   forces   statuss   detailss6   /mit/python/lib/python2.0/distutils/cygwinccompiler.pys   __init__@ s$    *
	i    c    sฯ  |  i | | |  \ } } } |  i | |  \ } }	 t	 | |  }
 |
 d g } | o d g | d *n | o | | d *n | t j o
 g  } n x.t t |   d r} | | } | | } t i i |  d } |	 | o |  i d | | f  nร |  i t i i |   | d j p
 | d j oE y  |  i d d	 | d
 | g  Wn t j
 o } t |  n XnK y) |  i |  i  | | d
 | g |  Wn t j
 o } t |  n Xqซ W| Sd  S(   Ns   -cs   -gi    i   s   skipping %s (%s up-to-date)s   .rcs   .ress   windress   -is   -o(!   s   selfs   _fix_compile_argss
   output_dirs   macross   include_dirss   _prep_compiles   sourcess   objectss   skip_sourcess   gen_preprocess_optionss   pp_optss   cc_argss   debugs   extra_preargss   extra_postargss   Nones   ranges   lens   is   srcs   objs   oss   paths   splitexts   exts   announces   mkpaths   dirnames   spawns   DistutilsExecErrors   msgs   CompileErrors   compiler_so(   s   selfs   sourcess
   output_dirs   macross   include_dirss   debugs   extra_preargss   extra_postargss   objectss   skip_sourcess   pp_optss   cc_argss   is   srcs   objs   exts   msgs6   /mit/python/lib/python2.0/distutils/cygwinccompiler.pys   compilez s6    	
  )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  } t i i | d | d  } d t i i |  d g } x | d r } | i |  q-W|  i t | | f d	 |  |  i d
 j o* |
 i d | g  |
 i d | g  n | i |  n |	 o |
 i d  n t i  |  | | | | | | | t |	 |
 | |  d  S(   Ns   gcci    s   .defs   .exps   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   exp_files   lib_files   contentss   syms   appends   executes
   write_files   debugs   UnixCCompilers   links
   output_dirs   library_dirss   runtime_library_dirss   extra_postargss
   build_temp(   s   selfs   target_descs   objectss   output_filenames
   output_dirs	   librariess   library_dirss   runtime_library_dirss   export_symbolss   debugs   extra_preargss   extra_postargss
   build_temps   temp_dirs   dll_names   dll_extensions   def_files   exp_files   lib_files   contentss   syms6   /mit/python/lib/python2.0/distutils/cygwinccompiler.pys   linkฎ sF    -
$	 	c    s  | t j o
 d } n g  } x๊ | d rเ } 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   n$ | i t i i | | |  i   q& W| Sd  S(   Ns    i    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   src_names   bases   exts6   /mit/python/lib/python2.0/distutils/cygwinccompiler.pys   object_filenamess      
	 $s    (   s   compiler_types   obj_extensions   static_lib_extensions   shared_lib_extensions   static_lib_formats   shared_lib_formats   exe_extensions   __init__s   Nones   compiles   links   object_filenames(    s6   /mit/python/lib/python2.0/distutils/cygwinccompiler.pys   CygwinCCompiler6 s    :4$ds   Mingw32CCompilerc      s   d Z  d d d d  Z RS(   Ns   mingw32c    sr   t  i |  | | |  |  i d j o
 d } n d } |  i d d d d d d	 d
 d |  i	 | f  g  |  _
 d  S(   Ns   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 -mdll -static %s(   s   CygwinCCompilers   __init__s   selfs   verboses   dry_runs   forces   gcc_versions   entry_points   set_executabless
   linker_dlls   dll_libraries(   s   selfs   verboses   dry_runs   forces   entry_points6   /mit/python/lib/python2.0/distutils/cygwinccompiler.pys   __init__4s    
i    (   s   compiler_types   __init__(    s6   /mit/python/lib/python2.0/distutils/cygwinccompiler.pys   Mingw32CCompiler0s    s   oks   not oks	   uncertainc     s็   d k  l }  d k } d k } | i | 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, config.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 config.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 "config.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   syss   finds   versions   CONFIG_H_OKs   get_config_h_filenames   fns   opens   fs   reads   ss   closes   IOErrors   excs   CONFIG_H_UNCERTAINs   strerrors   CONFIG_H_NOTOK(   s	   sysconfigs   strings   syss   fns   fs   ss   excs6   /mit/python/lib/python2.0/distutils/cygwinccompiler.pys   check_config_hZs     c     sท  d k  l }  d k l } d k } | d  } | oh t i | d d  } | i	   } | i   | i d |  } | o |  | i d   } n t } n t } | d	  } | oh t i | d
 d  } | i	   } | i   | i d |  } | o |  | i d   }	 n t }	 n t }	 | d  }
 |
 oh t i |
 d d  } | i	   } | i   | i d |  } | o |  | i d   } n 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   StrictVersions   find_executables   res   gcc_exes   outs
   out_strings   results   gcc_versions   ld_exes
   ld_versions   dllwrap_exes   dllwrap_versions6   /mit/python/lib/python2.0/distutils/cygwinccompiler.pys   get_versions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   CygwinCCompilers   Mingw32CCompilers   CONFIG_H_OKs   CONFIG_H_NOTOKs   CONFIG_H_UNCERTAINs   check_config_hs   get_versions(    s6   /mit/python/lib/python2.0/distutils/cygwinccompiler.pys   ? s   '๚&	3