MINI MINI MANI MO
ó
Fì]c           @   s    d  Z  d Z d d l Z d d l m Z m Z m Z m Z m Z d d l	 m
 Z
 m Z d d l m
 Z
 d d l m Z d d l m Z d	 e
 f d
 „  ƒ  YZ d S(   sƒ   distutils.bcppcompiler
Contains BorlandCCompiler, an implementation of the abstract CCompiler class
for the Borland C++ compiler.
s   $Id$iÿÿÿÿN(   t   DistutilsExecErrort   CompileErrort   LibErrort	   LinkErrort   UnknownFileError(   t	   CCompilert   gen_preprocess_options(   t
   write_file(   t   newer(   t   logt   BCPPCompilerc           B   sú   e  Z d  Z d Z i  Z d g Z d d d g Z e e Z d Z d Z	 d Z
 d	 Z Z d
 Z
 d d d d „ Z d d d d d d d d
 „ Z d d d d „ Z d d d d d d d d d d d „
 Z d d „ Z d d d „ Z d d d d d d „ Z RS(   s   Concrete class that implements an interface to the Borland C/C++
    compiler, as defined by the CCompiler abstract class.
    t   bcpps   .cs   .ccs   .cpps   .cxxs   .objs   .libs   .dlls   %s%ss   .exei    c         C   s   t  j |  | | | ƒ d |  _ d |  _ d |  _ d  |  _ d d d d g |  _ d d d d g |  _ d	 d
 d d g |  _	 d	 d
 d d g |  _
 g  |  _ d
 d d g |  _ d
 d d d g |  _
 d  S(
   Ns	   bcc32.exes   ilink32.exes   tlib.exes   /tWMs   /O2s   /qs   /g0s   /Ods   /Tpds   /Gns   /xs   /r(   R   t   __init__t   cct   linkert   libt   Nonet   preprocess_optionst   compile_optionst   compile_options_debugt   ldflags_sharedt   ldflags_shared_debugt   ldflags_statict   ldflags_exet   ldflags_exe_debug(   t   selft   verboset   dry_runt   force(    (    s.   /usr/lib64/python2.7/distutils/bcppcompiler.pyR   5   s    					c	         C   sß  |  j  | | | | | | ƒ \ } }	 } }
 } | p6 g  } | j d ƒ | r_ | j |  j ƒ n | j |  j ƒ xi|	 D]a}
 y | |
 \ } } Wn t k
 r¦ qv n Xt j j | ƒ } t j j |
 ƒ }
 |  j	 t j j
 |
 ƒ ƒ | d k rö qv n  | d k rDy |  j d d |
 | g ƒ Wqv t k
 r=} t
 | ‚ qv Xqv n  | |  j k r\d } n | |  j k rtd } n d } d |
 } y4 |  j |  j g | |
 | | g | | g ƒ Wqv t k
 rÖ} t
 | ‚ qv Xqv W|	 S(	   Ns   -cs   .ress   .rct   brcc32s   -fot    s   -Ps   -o(   t   _setup_compilet   appendt   extendR   R   t   KeyErrort   ost   patht   normpatht   mkpatht   dirnamet   spawnR    R   t
   _c_extensionst   _cpp_extensionsR
   (   R   t   sourcest
   output_dirt   macrost   include_dirst   debugt
   extra_preargst   extra_postargst   dependst   objectst   pp_optst   buildt   compile_optst   objt   srct   extt   msgt	   input_optt
   output_opt(    (    s.   /usr/lib64/python2.7/distutils/bcppcompiler.pyt   compileQ   sF    
		
.c   	      C   s©   |  j  | | ƒ \ } } |  j | d | ƒ} |  j | | ƒ r• | d g | } | rX n  y |  j |  j g | ƒ Wq¥ t k
 r‘ } t | ‚ q¥ Xn t j d | ƒ d  S(   NR,   s   /us   skipping %s (up-to-date)(	   t   _fix_object_argst   library_filenamet
   _need_linkR(   R   R    R   R	   R/   (	   R   R3   t   output_libnameR,   R/   t   target_langt   output_filenamet   lib_argsR:   (    (    s.   /usr/lib64/python2.7/distutils/bcppcompiler.pyt   create_static_lib’   s    c          C   s¾  |  j  | | ƒ \ } } |  j | | | ƒ \ } } } | rU t j d t | ƒ ƒ n  | d  k	 ry t j j | | ƒ } n  |  j	 | | ƒ rª| t
 j k rÀ d } |	 r³ |  j } qã |  j
 } n# d } |	 rÙ |  j } n
 |  j } | d  k rø d } n³ t j j | ƒ \ } } t j j | ƒ \ } } t j j | d ƒ } t j j | d | ƒ } d g } x+ | plg  D] } | j d | | f ƒ qmW|  j t | | f d	 | ƒ t t j j | ƒ } | g } g  } x[ | D]S } t j j t j j | ƒ ƒ \ } } | d
 k r| j | ƒ qÖ| j | ƒ qÖWx+ | D]# } | j d t j j | ƒ ƒ q4W| j d ƒ | j | ƒ | j d
 | g ƒ | j d ƒ xL | D]D } |  j | | |	 ƒ } | d  k rÓ| j | ƒ qœ| j | ƒ qœW| j d ƒ | j d ƒ | j d
 | g ƒ | j d
 ƒ | j | ƒ |
 r>|
 | d *n  | rT| j | ƒ n  |  j t j j | ƒ ƒ y |  j |  j g | ƒ Wqºt k
 r¦} t | ‚ qºXn t j  d | ƒ d  S(   Ns7   I don't know what to do with 'runtime_library_dirs': %st   c0w32t   c0d32R   i    s   %s.deft   EXPORTSs     %s=_%ss
   writing %ss   .ress   /L%ss   /L.t   ,s   ,,t   import32t   cw32mts   skipping %s (up-to-date)(!   R>