관리-도구
편집 파일: unixccompiler.cpython-39.pyc
a �������fh9����������������������@���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 <�g�d�ZdZd Z dZ dZdZd�Z �ZZeZejdkr�dZd'dd�Zdd��Zd(dd�Zd)dd�Zdd��Zdd ��Zd!d"��Zd#d$��Zd*d%d&�ZdS�)+� UnixCCompilerZunixNZccz-shared�arz-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�������������� ���C���s����|���d�||�}|\}}}t||�} |�j| �} |r>| �d|g��|rN|| d�d�<�|r\| �|��| �|��|�js~|d�u�s~t||�r�|r�|��tj � |���z|��| ��W�n,�ty��}�zt |��W�Y�d�}~n d�}~0�0�d�S�)N�-or���)Z_fix_compile_argsr���r����extend�append�forcer����mkpath�os�path�dirname�spawnr���r���)�self�sourceZoutput_fileZmacrosZinclude_dirs� extra_preargs�extra_postargs� fixed_args�ignore�pp_optsZpp_args�msg��r*����G/usr/lib/python3.9/site-packages/setuptools/_distutils/unixccompiler.py� preprocessU���s$���� zUnixCCompiler.preprocessc����������� ��� ���C���sr���|�j�}tjdkr t�|||��}z |��||�|d|g�|���W�n,�tyl�}�zt|��W�Y�d�}~n d�}~0�0�d�S�)Nr���r���)r����sys�platform�_osx_support�compiler_fixupr!���r���r���) r"����obj�src�extZcc_argsr%���r(���r���r)���r*���r*���r+����_compileo���s���� �� zUnixCCompiler._compiler���c�������������� ���C���s����|���||�\}}|�j||d�}|��||�r�|��tj�|���|��|�j|g�|�|�j ���|�j r�z|��|�j |g���W�q��ty��}�zt|��W�Y�d�}~q�d�}~0�0�nt �d|��d�S�)N)� output_dir�skipping %s (up-to-date))�_fix_object_args�library_filename� _need_linkr���r���r���r ���r!���r����objectsr���r���r ���r����debug)r"���r:���Zoutput_libnamer5���r;����target_lang�output_filenamer)���r*���r*���r+����create_static_libz���s$�������� zUnixCCompiler.create_static_libc�������������� ���C���s���|���||�\}}|��|||�}|\}}}t|�|||�}t|ttd��f�sPtd��|d�urftj� ||�}|�� ||��r�||�j�|�d|g�}| r�dg|d�d�<�| r�| |d�d�<�|r�|�|��|�� tj�|���z�|tjkr�|�jd�d���}n|�jd�d���}| dk�rr|�j�rrd}tj�|d��dk�r@d}d||�v��r@|d7�}�q&tj�||��d k�r\d}nd}|�j|�|||�<�tjd k�r�t�||�}|��||���W�n.�t�y��}�zt|��W�Y�d�}~n d�}~0�0�nt�d|��d�S�)Nz%'output_dir' must be a string or Noner���z-gr���zc++�env�����=Z ld_so_aixr���r6���)r7���Z _fix_lib_argsr���� isinstance�str�type� TypeErrorr���r����joinr9���r:���r���r���r ���r���Z EXECUTABLEr���r���r����basenamer-���r.���r/���r0���r!���r���r ���r���r;���)r"���Ztarget_descr:���r=���r5���Z librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsr;���r$���r%���Z build_tempr<���r&���Zlib_optsZld_argsZlinker�i�offsetr)���r*���r*���r+����link����sZ����� ��� zUnixCCompiler.linkc�����������������C���s���d|�S�)N�-Lr*���)r"����dirr*���r*���r+����library_dir_option����s����z UnixCCompiler.library_dir_optionc�����������������C���s���d|v�pd|v�S�)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���rK�������Zfreebsdz-Wl,-rpath=����zhp-uxz-Wl,+sz+sZGNULDZyesz-Wl,--enable-new-dtags,-Rz-Wl,-Rz-R)r���r���rG���r����get_config_varr-���r.���rN���)r"���rL���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�u�rfd } n | �d �} |D��] }tj � ||�}tj � ||�} tj � ||�}tj � ||�}tjdk�r@|�d�s�|�d��r@|�d ��s@tj � | |d d���|�}tj � | |d d���|�} tj � | |d d���|�}tj � | |d d���|�}tj �| ��rV| ��S�tj �|��rl|��S�tj �|��r�|��S�tj �|�rt|��S�qtd�S�)N�shared)Zlib_type�dylib� xcode_stub�staticr���ZCFLAGSz-isysroot\s*(\S+)�/r@���z/System/z/usr/z/usr/local/) r8���r-���r.���r���rQ����re�search�groupr���r���rF���� startswith�exists)r"����dirsrS���r;���Zshared_fZdylib_fZxcode_stub_fZstatic_fZcflags�mZsysrootrL���rU���rV���rX���rW���r*���r*���r+����find_library_file ��sF���� ��� zUnixCCompiler.find_library_file)NNNNN)Nr���N) NNNNNr���NNNN)r���)�__name__� __module__�__qualname__Z compiler_typeZexecutablesr-���r.���Zsrc_extensionsZ obj_extensionZstatic_lib_extensionZshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ exe_extensionr,���r4���r>���rJ���rM���rN���rR���rT���ra���r*���r*���r*���r+���r ���-���sL���� ��� �� ����� B*r ���)�__doc__r���r-���rZ���Z distutilsr���Zdistutils.dep_utilr���Zdistutils.ccompilerr���r���r���Zdistutils.errorsr���r���r ���r ���r���r.���r/���r ���r*���r*���r*���r+����<module>���s���