Edit File: unixccompiler.cpython-37.pyc
B ����m}�c|;������������������@���s����d�Z�ddlZddlZddlZddlmZ�ddlmZ�ddlm Z m Z mZ�ddlm Z mZmZmZ�ddlmZ�ejdkr~ddlZG�d d ��d e �ZdS�)a9��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' �����N)� sysconfig)�newer)� CCompiler�gen_preprocess_options�gen_lib_options)�DistutilsExecError�CompileError�LibError� LinkError)�log�darwinc������������ �������s����e�Zd�ZdZddgdgdgddgdgddgdd�Zejdd��d krNd ged <�ddd dddgZdZdZ dZ dZdZd�Z �ZZeZejdkr�dZ��fdd�Zd.dd�Zdd��Zd/d d!�Zd0d"d#�Zd$d%��Zd&d'��Zd(d)��Zd*d+��Zd1d,d-�Z���ZS�)2� UnixCCompilerZunixNZccz-sharedZarz-cr)�preprocessor�compiler�compiler_so�compiler_cxx� linker_so� linker_exe�archiver�ranlib����r���r���z.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%s�cygwinz.exec����������������sF���t�|�j|���|||�\}}}t�d�}|r<||kr<|�|��|||fS�)z'Remove standard library path from rpathZLIBDIR)�super� __class__� _fix_lib_argsr����get_config_var�remove)�self� libraries�library_dirs�runtime_library_dirsZlibdir)r������</opt/alt/python37/lib64/python3.7/distutils/unixccompiler.pyr���U���s���� zUnixCCompiler._fix_lib_argsc���������� ���C���s����|���d�||�}|\}}}t||�} |�j| �} |r>| �d|g��|rN|| d�d�<�|r\| �|��| �|��|�js~|d�ks~t||�r�|r�|��tj � |���y|��| ��W�n*�tk r��}�zt |��W�d�d�}~X�Y�nX�d�S�)Nz-or���)Z_fix_compile_argsr���r����extend�appendZforcer����mkpath�os�path�dirname�spawnr���r���)r����sourceZoutput_fileZmacrosZinclude_dirs� extra_preargs�extra_postargs� fixed_args�ignore�pp_optsZpp_args�msgr!���r!���r"���� preprocess_���s$���� zUnixCCompiler.preprocessc������� ��� ���C���sp���|�j�}tjdkr t�|||��}y |��||�|d|g�|���W�n*�tk rj�}�zt|��W�d�d�}~X�Y�nX�d�S�)Nr���z-o)r����sys�platform�_osx_support�compiler_fixupr)���r���r���) r����obj�srcZextZcc_argsr,���r/���r���r0���r!���r!���r"����_compiley���s���� zUnixCCompiler._compiler���c���������� ���C���s����|���||�\}}|�j||d�}|��||�r�|��tj�|���|��|�j|g�|�|�j ���|�j r�y|��|�j |g���W�q��tk r��}�zt|��W�d�d�}~X�Y�q�X�nt �d|��d�S�)N)� output_dirzskipping %s (up-to-date))�_fix_object_args�library_filename� _need_linkr%���r&���r'���r(���r)���r����objectsr���r���r ���r����debug)r���r=���Zoutput_libnamer9���r>����target_lang�output_filenamer0���r!���r!���r"����create_static_lib����s����zUnixCCompiler.create_static_libc���������� ���C���s���|���||�\}}|��|||�}|\}}}t|�|||�}t|ttd��f�sPtd��|d�k rftj� ||�}|�� ||��r�||�j�|�d|g�}| r�dg|d�d�<�| r�| |d�d�<�|r�|�|��|�� tj�|���y�|tjkr�|�jd�d���}n|�jd�d���}| dk�rv|�j�rvd}tj�|d��dk�rDd}xd||�k�rB|d7�}�q(W�tj�||��d k�r`d}nd}|�j|�|||�<�tjd k�r�t�||�}|��||���W�n,�tk �r��}�zt|��W�d�d�}~X�Y�nX�nt�d|��d�S�)Nz%'output_dir' must be a string or Nonez-oz-gr���zc++�env�����=Z ld_so_aixr���zskipping %s (up-to-date))r:���r���r���� isinstance�str�type� TypeErrorr&���r'����joinr<���r=���r#���r%���r(���r���Z EXECUTABLEr���r���r����basenamer2���r3���r4���r5���r)���r���r ���r���r>���)r���Ztarget_descr=���r@���r9���r���r���r ���Zexport_symbolsr>���r+���r,���Z build_tempr?���r-���Zlib_optsZld_argsZlinker�i�offsetr0���r!���r!���r"����link����sN���� zUnixCCompiler.linkc�������������C���s���d|�S�)Nz-Lr!���)r����dirr!���r!���r"����library_dir_option����s����z UnixCCompiler.library_dir_optionc�������������C���s���d|kpd|kS�)NZgcczg++r!���)r���Z compiler_namer!���r!���r"����_is_gcc����s����zUnixCCompiler._is_gccc�������������C���s����t�j�t�d��}tjd�d��dkr,d|�S�tjd�d��dkrFd|�S�tjd�d��d krz|��|�rnd d|�gS�dd|�gS�|��|�r�t�d�d kr�d|�S�d|�S�nd|�S�d�S�)NZCCr���r���z-L����Zfreebsdz-Wl,-rpath=����zhp-uxz-Wl,+sz+sZGNULDZyesz-Wl,--enable-new-dtags,-Rz-Wl,-Rz-R)r&���r'���rJ���r���r���r2���r3���rP���)r���rN���r���r!���r!���r"����runtime_library_dir_option����s���� z(UnixCCompiler.runtime_library_dir_optionc�������������C���s���d|�S�)Nz-lr!���)r����libr!���r!���r"����library_option��s����zUnixCCompiler.library_optionc�������������C���s���|�j�|dd�}|�j�|dd�}|�j�|dd�}|�j�|dd�}tjdkrpt�d�}t�d|�} | d�krfd } n | �d �} �x|D��]}tj � ||�}tj � ||�} tj � ||�}tj � ||�}tjdk�rD|�d�s�|�d��rD|�d ��sDtj � | |d d���|�}tj � | |d d���|�} tj � | |d d���|�}tj � | |d d���|�}tj �| ��rV| S�tj �|��rh|S�tj �|��rz|S�tj �|�rx|S�qxW�d�S�)N�shared)Zlib_type�dylib� xcode_stub�staticr���ZCFLAGSz-isysroot\s*(\S+)�/rC���z/System/z/usr/z/usr/local/) r;���r2���r3���r���r����re�search�groupr&���r'���rI���� startswith�exists)r����dirsrT���r>���Zshared_fZdylib_fZxcode_stub_fZstatic_fZcflags�mZsysrootrN���rV���rW���rY���rX���r!���r!���r"����find_library_file��s>���� zUnixCCompiler.find_library_file)NNNNN)Nr���N) NNNNNr���NNNN)r���)�__name__� __module__�__qualname__Z compiler_typeZexecutablesr2���r3���Zsrc_extensionsZ obj_extensionZstatic_lib_extensionZshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ exe_extensionr���r1���r8���rA���rM���rO���rP���rS���rU���rb���� __classcell__r!���r!���)r���r"���r ���-���sF��� � ��� >*r ���)�__doc__r&���r2���r[���Z distutilsr���Zdistutils.dep_utilr���Zdistutils.ccompilerr���r���r���Zdistutils.errorsr���r���r ���r ���r���r3���r4���r ���r!���r!���r!���r"����<module>���s���