-í
ë¶<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 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.14 2001/12/06 20:51:35 fdrake Exp $N(   s   gen_preprocess_optionss   gen_lib_options(   s   UnixCCompiler(   s
   write_file(   s   DistutilsExecErrors   CompileErrors   UnknownFileErrors   CygwinCCompilerc    
  s’   t  Z 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   .exei    c  
  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 pyconfig.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   details(    (    s/   /usr/lib/python2.2/distutils/cygwinccompiler.pys   __init__@ s$    *
	c    sÍ  |  i | | | ƒ \ } } } |  i | | ƒ \ }	 } t	 | | ƒ } | d g } | o d g | d *n | o | | d *n | t j o
 g  } n x,t t | ƒ ƒ D]} | | }
 |	 | } 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   pp_optss   objectss   srcs   skip_sourcess   objs   cc_argss   is   exts   msg(    (    s/   /usr/lib/python2.2/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] } | 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   dll_names   lib_files   syms   dll_extensions   exp_files   contentss   def_files   temp_dir(    (    s/   /usr/lib/python2.2/distutils/cygwinccompiler.pys   link® sF    -
$ 	s    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 ƒ ƒ n$ | 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(    (    s/   /usr/lib/python2.2/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   Nones   compiles   links   object_filenames(    (    (    s/   /usr/lib/python2.2/distutils/cygwinccompiler.pys   CygwinCCompiler6 s   :4$ds   Mingw32CCompilerc      s    t  Z d Z d d d d „ Z RS(   Ns   mingw32i    c    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_point(    (    s/   /usr/lib/python2.2/distutils/cygwinccompiler.pys   __init__4s    
(   s   __name__s
   __module__s   compiler_types   __init__(    (    (    s/   /usr/lib/python2.2/distutils/cygwinccompiler.pys   Mingw32CCompiler0s   s   oks   not oks	   uncertainc     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(    (    s/   /usr/lib/python2.2/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   find_executables   dllwrap_exes
   ld_versions   StrictVersions   res   gcc_versions   results   ld_exes   gcc_exes   dllwrap_versions
   out_strings   out(    (    s/   /usr/lib/python2.2/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(   s   __revision__s   DistutilsExecErrors   CONFIG_H_UNCERTAINs   gen_preprocess_optionss   Mingw32CCompilers   get_versionss   gen_lib_optionss   CONFIG_H_NOTOKs   check_config_hs   UnixCCompilers   syss   CygwinCCompilers   CompileErrors
   write_files   copys   oss   UnknownFileErrors   CONFIG_H_OK(    (    s/   /usr/lib/python2.2/distutils/cygwinccompiler.pys   ? s   'ú&	3