Your IP : 3.133.145.168
���]W: � @ s� d d l Z d d l m Z m Z m Z m Z m Z m Z d d l m Z m
Z
m Z d d l m
Z
d d l m Z d d l m Z Gd d � d e � Z d S) � N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError� LinkError�UnknownFileError)� CCompiler�gen_preprocess_options�gen_lib_options)�
write_file)�newer)�logc @ 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 d
� Z d d d d d d d d d � Z d d d d d � Z d d d d d d d d d d d d �
Z d d d � Z d d d d � Z d d d d d d d � Z d S)�BCPPCompilerZbcppz.cz.ccz.cppz.cxxz.objz.libz.dllz%s%sz.exer 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)
Nz bcc32.exezilink32.exeztlib.exez/tWMz/O2z/qz/g0z/Odz/Tpdz/Gnz/xz/r)
r �__init__�cc�linker�libZpreprocess_options�compile_options�compile_options_debug�ldflags_shared�ldflags_shared_debugZldflags_static�ldflags_exe�ldflags_exe_debug)�self�verbose�dry_run�force� r �1/opt/alt/python35/lib64/python3.5/bcppcompiler.pyr 5 s zBCPPCompiler.__init__Nc C s | j | | | | | | � \ } } } }
} | p6 g } | j d � | r_ | j | j � n | j | j � x�| D]�}
y | |
\ } } Wn t k
r� wv Yn Xt j j | � } t j j |
� }
| j t j j
|
� � | d k r� qv | d k rTy | j d d |
| g � Wqv t k
rP} z t
| � � WYd d } ~ Xqv Xqv | | j k rld } n | | j k r�d } n d } d |
} y4 | j | j g | |
| | g | | g � Wqv t k
r�} z t
| � � WYd d } ~ Xqv Xqv W| S) Nz-cz.resz.rcZbrcc32z-fo� z-Pz-o)Z_setup_compile�append�extendr r �KeyError�os�path�normpath�mkpath�dirname�spawnr r �
_c_extensions�_cpp_extensionsr )r Zsources�
output_dir�macros�include_dirs�debug�
extra_preargs�extra_postargsZdepends�objects�pp_optsZbuildZcompile_opts�obj�src�ext�msgZ input_optZ
output_optr r r �compileQ sF
.#zBCPPCompiler.compilec C s� | j | | � \ } } | j | d | �} | j | | � r� | d g | } | rU y | j | j g | � Wq� t k
r� } z t | � � WYd d } ~ Xq� Xn t j d | � d S)Nr+ z/uzskipping %s (up-to-date)) �_fix_object_args�library_filename�
_need_linkr( r r r r
r. ) r r1 Zoutput_libnamer+ r. �target_lang�output_filenameZlib_argsr6 r r r �create_static_lib� s "zBCPPCompiler.create_static_libc C s� | j | | � \ } } | j | | | � \ } } } | rR t j d t | � � | d k rs t j j | | � } | j | | � r�| t j
k r� d } | r� | j d d � } q| j d d � } n5 d } | r� | j
d d � } n | j d d � } | d k rd } n� t j j | � \ } } t j j | � \ } } t j j | d � } t j j | d | � } d g } x+ | p�g D] } | j d | | f � q�W| 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 | � � qRW| 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 d � <| rr| j | � | j t j j | � � y | j | j g | � Wq�t k
r�} z t | � � WYd d } ~ Xq�Xn t j d | � d S)Nz7I don't know what to do with 'runtime_library_dirs': %sZc0w32Zc0d32r r z%s.defZEXPORTSz %s=_%sz
writing %sz.resz/L%sz/L.�,z,,Zimport32Zcw32mtzskipping %s (up-to-date)) r8 Z
_fix_lib_argsr
�warn�strr# r$ �joinr: r Z
EXECUTABLEr r r r �split�splitextr'