U
    ,d                     @   sZ   d dl Z d dlZd dlZd dlZd dlZddlmZ ddlmZm	Z	 dd Z
d	ddZdS )
    N   )CC)export
exportmanyc                 C   s*   | j r
dS | jrdS | jr t S t S d S )Nz.bc.o)llvmolibspythonfind_pyext_endingfind_shared_ending)args r   7/tmp/pip-unpacked-wheel-eu7e0c37/numba/pycc/__init__.py
get_ending   s    r   c                 C   s  dd l }ddlm} ddlm}m}m} ddlm} |j	dd}|j
dd	d
d |j
ddddd | }|j
ddddd |j
dddd |j
dddd |j
dddd |j
ddddd || } tt}	| jr|	tj |	d | jr&| jd | _tj| jd }
tj|
d }n4tj| jd d }tj|d }|t|  | _|	d | j | jrtd! td |	d"| j || j ||j |d#}| j!r|	d$ |j"| j| j#d% n| j$r|	d& |j%| j| j#d% n|	d' |	d(t&'  | }| j|_t&' tj( tj)| j d) }|j%|| j#d% |* }|j+| j|g|* |, |j-d* t.| d S )+Nr   r   )ModuleCompiler)	Toolchainr   r
   )
decoratorsz>DEPRECATED - Compile Python modules to a single shared library)descriptioninputs+zInput file(s))nargshelpz-ooutputz@Output file  (default is name of first input -- with new ending))r   destr   z-c
store_truer   z<Create object file from each input instead of shared-library)actionr   r   z--llvmz Emit llvm instead of native code)r   r   z--headerz+Emit C header file with function signaturesz--pythonzNEmit additionally generated Python wrapper and extension module code in outputz-dz--debugzPrint extra debug informationzIThe 'pycc' script is DEPRECATED; please use the numba.pycc.CC API insteadzargs.output --> %szKERROR: pycc --header has been disabled in this release due to a known issuezinputs --> %s)module_namez	emit llvm)wrapzemit object filezemit shared libraryz!write to temporary object file %sr   )export_symbols)/argparsecompilerr   platformr   r   r
   Z
numba.pyccr   ArgumentParseradd_argumentadd_mutually_exclusive_group
parse_argslogging	getLogger__name__debugsetLevelDEBUGwarnr   ospathsplitsplitextr   r   headerprintsysexitZprocess_input_filesZexport_registryr   Zwrite_llvm_bitcoder	   r   Zwrite_native_objecttempfile
gettempdirsepbasenameZget_python_librariesZlink_sharedZget_python_library_dirsZdll_exportsremove)r   r   r   r   r   r
   r   parsergrouploggerZoutput_baser   Z
input_baser    Z	toolchainZtemp_obj	librariesr   r   r   main   s    









r>   )N)r-   r&   
subprocessr5   r3   ccr   r   r   r   r   r>   r   r   r   r   <module>   s   