관리-도구
편집 파일: build_clib.cpython-39.pyc
a �����DOgV����������������������@���sT���d�Z�ddlZddlmZ�ddlT�ddlmZ�ddlmZ�dd��Z G�d d ��d e�Z dS�)z�distutils.command.build_clib Implements the Distutils 'build_clib' command, to build a C/C++ library that is included in the module distribution and needed by an extension module.�����N)�Command)�*)�customize_compiler)�logc������������������C���s���ddl�m}��|����d�S�)Nr�����show_compilers)�distutils.ccompilerr���r�����r ����4/usr/lib64/python3.9/distutils/command/build_clib.pyr������s����r���c�������������������@���sf���e�Zd�ZdZg�d�ZddgZdddefgZdd ��Zd d��Z dd ��Z dd��Zdd��Zdd��Z dd��ZdS�)� build_clibz/build C/C++ libraries used by Python extensions))zbuild-clib=�bz%directory to build C/C++ libraries to)zbuild-temp=�tz,directory to put temporary build by-products)�debug�gz"compile with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z compiler=�czspecify the compiler typer���r���z help-compilerNzlist available compilersc�����������������C���s:���d�|�_�d�|�_d�|�_d�|�_d�|�_d�|�_d�|�_d|�_d�|�_d�S�)Nr���) r���� build_temp� libraries�include_dirs�define�undefr���r����compiler��selfr ���r ���r ����initialize_options4���s����zbuild_clib.initialize_optionsc�����������������C���sh���|���dddddd��|�jj|�_|�jr0|��|�j��|�jd�u�rH|�jjpDg�|�_t|�jt�rd|�j�tj �|�_d�S�)NZbuild)r���r���)r���r���)r���r���)r���r���)r���r���) Zset_undefined_optionsZdistributionr����check_library_listr���� isinstance�str�split�os�pathsepr���r ���r ���r ����finalize_optionsD���s����� zbuild_clib.finalize_optionsc�����������������C���s����|�j�s d�S�ddlm}�||�j|�j|�jd�|�_t|�j��|�jd�urN|�j�|�j��|�j d�urv|�j D�]\}}|�j� ||��q^|�jd�ur�|�jD�]}|�j�|��q�|�� |�j���d�S�)Nr���)�new_compiler)r����dry_runr���)r���r���r#���r���r$���r���r���r���Zset_include_dirsr���Zdefine_macror���Zundefine_macro�build_libraries)r���r#����name�valueZmacror ���r ���r ����run^���s"����� zbuild_clib.runc�����������������C���s����t�|t�std��|D�]z}t�|t�s8t|�dkr8td��|\}}t�|t�sRtd��d|v�sntjdkr~tj|v�r~td|d����t�|t�std��qd S�) a`��Ensure that the list of libraries is valid. `library` is presumably provided as a command option 'libraries'. This method checks that it is a list of 2-tuples, where the tuples are (library_name, build_info_dict). Raise DistutilsSetupError if the structure is invalid anywhere; just returns otherwise. z+'libraries' option must be a list of tuples����z*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)�/z;bad library name '%s': may not contain directory separatorsr���zMsecond element of each tuple in 'libraries' must be a dictionary (build info)N) r����list�DistutilsSetupError�tuple�lenr���r ����sep�dict)r���r����libr&���� build_infor ���r ���r ���r���v���s,���� �� �� �zbuild_clib.check_library_listc�����������������C���s,���|�j�s d�S�g�}|�j�D�]\}}|�|��q|S�)N)r����append)r���Z lib_names�lib_namer2���r ���r ���r ����get_library_names����s����zbuild_clib.get_library_namesc�����������������C���sZ���|���|�j��g�}|�jD�]>\}}|�d�}|d�u�s>t|ttf�sJtd|���|�|��q|S�)N�sources�fin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)r���r����getr���r+���r-���r,����extend)r���� filenamesr4���r2���r6���r ���r ���r ����get_source_files����s���� ��zbuild_clib.get_source_filesc�����������������C���s����|D�]�\}}|��d�}|d�u�s,t|ttf�s8td|���t|�}t�d|��|��d�}|��d�}|�jj||�j |||�j d�}|�jj|||�j|�j d��qd�S�)Nr6���r7���zbuilding '%s' library�macrosr���)� output_dirr<���r���r���)r=���r���) r8���r���r+���r-���r,���r����infor����compiler���r���Zcreate_static_libr���)r���r���r4���r2���r6���r<���r���Zobjectsr ���r ���r ���r%�������s,���� �� � �zbuild_clib.build_libraries)�__name__� __module__�__qualname__�descriptionZuser_optionsZboolean_optionsr���Zhelp_optionsr���r"���r(���r���r5���r;���r%���r ���r ���r ���r ���r������s��� ��$r���)�__doc__r ���Zdistutils.corer���Zdistutils.errorsZdistutils.sysconfigr���Z distutilsr���r���r���r ���r ���r ���r ����<module>���s���