???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
{fc           @   sì   d  Z  d Z d d l Z d d l Z d d l Z d d l m Z m Z d d l m	 Z	 d d l
 m Z d d l m Z m Z m Z d d l m Z m Z m Z m Z d d	 l m Z e j d
 k rÒ d d l Z n  d e f d „  ƒ  YZ d S(   s9  distutils.unixccompiler

Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
  * macros defined with -Dname[=value]
  * macros undefined with -Uname
  * include search directories specified with -Idir
  * libraries specified with -lllib
  * library search directories specified with -Ldir
  * compile handled by 'cc' (or similar) executable with -c option:
    compiles .c to .o
  * link static library handled by 'ar' command (possibly with 'ranlib')
  * link shared library handled by 'cc -shared'
s   $Id$iÿÿÿÿN(   t
   StringTypet   NoneType(   t	   sysconfig(   t   newer(   t	   CCompilert   gen_preprocess_optionst   gen_lib_options(   t   DistutilsExecErrort   CompileErrort   LibErrort	   LinkError(   t   logt   darwint   UnixCCompilerc           B   s|  e  Z d  Z i d( d 6d g d 6d g d 6d g d 6d d g d 6d g d 6d	 d
 g d 6d( d 6Z e j d  d k r… d g e d <n  d d d d d d g Z d Z d Z	 d Z
 d Z d Z d Z Z Z e Z e j d k rç d Z n  d „  Z d( d( d( d( d( d „ Z d „  Z d( d  d( d! „ Z d( d( d( d( d( d  d( d( d( d( d" „
 Z d# „  Z d$ „  Z d% „  Z d& „  Z d  d' „ Z RS()   t   unixt   preprocessort   cct   compilert   compiler_sot   compiler_cxxs   -sharedt	   linker_sot
   linker_exet   ars   -crt   archivert   ranlibi   R   s   .cs   .Cs   .ccs   .cxxs   .cpps   .ms   .os   .as   .sos   .dylibs   .tbds   lib%s%st   cygwins   .exec         C   s_   t  j |  | | | ƒ \ } } } t j d ƒ } | rR | | k rR | j | ƒ n  | | | f S(   s'   Remove standard library path from rpatht   LIBDIR(   R   t   _fix_lib_argsR   t   get_config_vart   remove(   t   selft	   librariest   library_dirst   runtime_library_dirst   libdir(    (    s/   /usr/lib64/python2.7/distutils/unixccompiler.pyR   X   s    c         C   s	  |  j  d  | | ƒ \ } } } t | | ƒ } |  j | }	 | rV |	 j d | g ƒ n  | ri | |	 d *n  | r |	 j | ƒ n  |	 j | ƒ |  j s° | d  k s° t | | ƒ r| rÒ |  j t	 j
 j | ƒ ƒ n  y |  j |	 ƒ Wqt k
 r}
 t |
 ‚ qXn  d  S(   Ns   -oi    (   t   _fix_compile_argst   NoneR   R   t   extendt   appendt   forceR   t   mkpatht   ost   patht   dirnamet   spawnR   R   (   R   t   sourcet   output_filet   macrost   include_dirst   extra_preargst   extra_postargst   ignoret   pp_optst   pp_argst   msg(    (    s/   /usr/lib64/python2.7/distutils/unixccompiler.pyt
   preprocessb   s"    $c   	      C   sz   |  j  } t j d k r1 t j | | | ƒ } n  y& |  j | | | d | g | ƒ Wn t k
 ru } t | ‚ n Xd  S(   NR   s   -o(   R   t   syst   platformt   _osx_supportt   compiler_fixupR,   R   R   (	   R   t   objt   srct   extt   cc_argsR2   R4   R   R6   (    (    s/   /usr/lib64/python2.7/distutils/unixccompiler.pyt   _compile}   s    		i    c         C   s×   |  j  | | ƒ \ } } |  j | d | ƒ} |  j | | ƒ rÃ |  j t j j | ƒ ƒ |  j |  j | g | |  j	 ƒ |  j
 rÓ y |  j |  j
 | g ƒ WqÀ t k
 r¼ } t | ‚ qÀ XqÓ n t j d | ƒ d  S(   Nt
   output_dirs   skipping %s (up-to-date)(   t   _fix_object_argst   library_filenamet
   _need_linkR(   R)   R*   R+   R,   R   t   objectsR   R   R	   R   t   debug(   R   RE   t   output_libnameRA   RF   t   target_langt   output_filenameR6   (    (    s/   /usr/lib64/python2.7/distutils/unixccompiler.pyt   create_static_libˆ   s    	c         C   s"  |  j  | | ƒ \ } } |  j | | | ƒ \ } } } t |  | | | ƒ } t | ƒ t t f k ro t d ‚ n  | d  k	 r“ t j	 j
 | | ƒ } n  |  j | | ƒ r| |  j | d | g } |	 rÖ d g | d *n  |
 ré |
 | d *n  | rÿ | j | ƒ n  |  j t j	 j | ƒ ƒ yÔ | t j k r7|  j } n
 |  j } | d k r¶|  j r¶d } t j	 j | d ƒ d k r¢d } x! d | | k rž| d } qWn  |  j | | | <n  t j d	 k rÚt j | | ƒ } n  |  j | | ƒ Wqt k
 r
} t | ‚ qXn t j d
 | ƒ d  S(   Ns%   'output_dir' must be a string or Nones   -os   -gi    s   c++t   envi   t   =R   s   skipping %s (up-to-date)(   RB   R   R   t   typeR    R   t	   TypeErrorR$   R)   R*   t   joinRD   RE   R%   R(   R+   R   t
   EXECUTABLER   R   R   t   basenameR8   R9   R:   R;   R,   R   R
   R   RF   (   R   t   target_descRE   RI   RA   R   R    R!   t   export_symbolsRF   R1   R2   t
   build_tempRH   t   lib_optst   ld_argst   linkert   iR6   (    (    s/   /usr/lib64/python2.7/distutils/unixccompiler.pyt   link¢   sD    	
c         C   s   d | S(   Ns   -L(    (   R   t   dir(    (    s/   /usr/lib64/python2.7/distutils/unixccompiler.pyt   library_dir_optionÜ   s    c         C   s   d | k p d | k S(   Nt   gccs   g++(    (   R   t   compiler_name(    (    s/   /usr/lib64/python2.7/distutils/unixccompiler.pyt   _is_gccß   s    c         C   sâ   t  j j t j d ƒ ƒ } t j d  d k r6 d | St j d  d k rQ d | St j d  d	 k r |  j | ƒ r d
 d | g Sd d | g St j d  d k sµ t j d  d k r¿ d | g S|  j | ƒ rÖ d | Sd | Sd  S(   Nt   CCi   R   s   -Li   t   freebsds   -Wl,-rpath=i   s   hp-uxs   -Wl,+ss   +st   irix646t   osf1V5s   -rpaths   -Wl,-Rs   -R(   R)   R*   RQ   R   R   R8   R9   R^   (   R   RZ   R   (    (    s/   /usr/lib64/python2.7/distutils/unixccompiler.pyt   runtime_library_dir_optionâ   s    &
c         C   s   d | S(   Ns   -l(    (   R   t   lib(    (    s/   /usr/lib64/python2.7/distutils/unixccompiler.pyt   library_option   s    c         C   s  |  j  | d d ƒ} |  j  | d d ƒ} |  j  | d d ƒ} |  j  | d d ƒ} t j d k r« t j d ƒ } t j d | ƒ }	 |	 d  k r™ d	 }
 q« |	 j d
 ƒ }
 n  xj| D]b} t	 j
 j | | ƒ } t	 j
 j | | ƒ } t	 j
 j | | ƒ } t	 j
 j | | ƒ } t j d k r¼| j d ƒ sI| j d ƒ r¼| j d ƒ r¼t	 j
 j |
 | d
 | ƒ } t	 j
 j |
 | d
 | ƒ } t	 j
 j |
 | d
 | ƒ } t	 j
 j |
 | d
 | ƒ } n  t	 j
 j | ƒ rÒ| St	 j
 j | ƒ rè| St	 j
 j | ƒ rþ| St	 j
 j | ƒ r² | Sq² Wd  S(   Nt   lib_typet   sharedt   dylibt
   xcode_stubt   staticR   t   CFLAGSs   -isysroot\s+(\S+)t   /i   s   /System/s   /usr/s   /usr/local/(   RC   R8   R9   R   R   t   ret   searchR$   t   groupR)   R*   RO   t
   startswitht   exists(   R   t   dirsRd   RF   t   shared_ft   dylib_ft   xcode_stub_ft   static_ft   cflagst   mt   sysrootRZ   Rg   Rh   Rj   Ri   (    (    s/   /usr/lib64/python2.7/distutils/unixccompiler.pyt   find_library_file  s>    	N(   t   __name__t
   __module__t   compiler_typeR$   t   executablesR8   R9   t   src_extensionst   obj_extensiont   static_lib_extensiont   shared_lib_extensiont   dylib_lib_extensiont   xcode_stub_lib_extensiont   static_lib_formatt   shared_lib_formatt   dylib_lib_formatt   xcode_stub_lib_formatt   exe_extensionR   R7   R@   RJ   RY   R[   R^   Rc   Re   Rz   (    (    (    s/   /usr/lib64/python2.7/distutils/unixccompiler.pyR   0   sF   





					6				(   t   __doc__t   __revision__R)   R8   Rm   t   typesR    R   t	   distutilsR   t   distutils.dep_utilR   t   distutils.ccompilerR   R   R   t   distutils.errorsR   R   R	   R
   R   R9   R:   R   (    (    (    s/   /usr/lib64/python2.7/distutils/unixccompiler.pyt   <module>   s   $"