§
    ZQdV  ã                   ó`   — d Z ddlZddlmZ ddlT ddlmZ ddlmZ d„ Z	 G d„ d	e¦  «        Z
dS )
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                  ó&   — ddl m}   | ¦   «          d S )Nr   ©Úshow_compilers)Údistutils.ccompilerr	   r   s    ú3/usr/lib/python3.11/distutils/command/build_clib.pyr	   r	      s(   € Ø2Ð2Ð2Ð2Ð2Ð2Ø€NÑÔÐÐÐó    c                   óZ   — e Zd ZdZg d¢ZddgZdddefgZd„ Zd	„ Z	d
„ Z
d„ Zd„ Zd„ Zd„ ZdS )Ú
build_clibz/build C/C++ libraries used by Python extensions))zbuild-clib=Úbz%directory to build C/C++ libraries to)zbuild-temp=Útz,directory to put temporary build by-products)ÚdebugÚgz"compile with debugging information)ÚforceÚfz2forcibly build everything (ignore file timestamps))z	compiler=Úczspecify the compiler typer   r   zhelp-compilerNzlist available compilersc                 ó„   — d | _         d | _        d | _        d | _        d | _        d | _        d | _        d| _        d | _        d S )Nr   )	r   Ú
build_tempÚ	librariesÚinclude_dirsÚdefineÚundefr   r   Úcompiler©Úselfs    r   Úinitialize_optionszbuild_clib.initialize_options4   sJ   € ØˆŒØˆŒð ˆŒð !ˆÔØˆŒØˆŒ
ØˆŒ
ØˆŒ
ØˆŒˆˆr   c                 ó\  — |                       dddddd¦  «         | j        j        | _        | j        r|                      | j        ¦  «         | j        €| j        j        pg | _        t          | j        t          ¦  «        r+| j                             t          j	        ¦  «        | _        d S d S )NÚbuild)r   r   )r   r   )r   r   )r   r   )r   r   )
Úset_undefined_optionsÚdistributionr   Úcheck_library_listr   Ú
isinstanceÚstrÚsplitÚosÚpathsepr   s    r   Úfinalize_optionszbuild_clib.finalize_optionsD   s»   € ð 	×"Ò" 7Ø#?Ø#?Ø#;Ø#5Ø#5ñ	7ô 	7ð 	7ð Ô*Ô4ˆŒØŒ>ð 	4Ø×#Ò# D¤NÑ3Ô3Ð3àÔÐ$Ø $Ô 1Ô >Ð DÀ"ˆDÔÝ�dÔ'­Ñ-Ô-ð 	DØ $Ô 1× 7Ò 7½¼
Ñ CÔ CˆDÔÐÐð	Dð 	Dr   c                 óÄ  — | j         sd S ddlm}  || j        | j        | j        ¬¦  «        | _        t          | j        ¦  «         | j        �| j                             | j        ¦  «         | j	        �(| j	        D ] \  }}| j         
                    ||¦  «         Œ!| j        �$| j        D ]}| j                             |¦  «         Œ|                      | j         ¦  «         d S )Nr   )Únew_compiler)r   Údry_runr   )r   r
   r,   r   r-   r   r   r   Úset_include_dirsr   Údefine_macror   Úundefine_macroÚbuild_libraries)r   r,   ÚnameÚvalueÚmacros        r   Úrunzbuild_clib.run^   s  € ØŒ~ð 	ØˆFð 	5Ð4Ð4Ð4Ð4Ð4Ø$˜¨d¬mØ-1¬\Ø+/¬:ð7ñ 7ô 7ˆŒõ 	˜4œ=Ñ)Ô)Ð)àÔÐ(ØŒM×*Ò*¨4Ô+<Ñ=Ô=Ð=ØŒ;Ð"à $¤ð 8ð 8‘��eØ”×*Ò*¨4°Ñ7Ô7Ð7Ð7ØŒ:Ð!Øœð 4ð 4�Ø”×,Ò,¨UÑ3Ô3Ð3Ð3à×Ò˜Tœ^Ñ,Ô,Ð,Ð,Ð,r   c                 óÔ  — t          |t          ¦  «        st          d¦  «        ‚|D ]À}t          |t          ¦  «        s"t	          |¦  «        dk    rt          d¦  «        ‚|\  }}t          |t
          ¦  «        st          d¦  «        ‚d|v st          j        dk    r&t          j        |v rt          d|d         z  ¦  «        ‚t          |t          ¦  «        st          d¦  «        ‚ŒÁd	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   Úlibr2   Ú
build_infos        r   r$   zbuild_clib.check_library_listv   s.  € õ ˜)¥TÑ*Ô*ð 	AÝ%Ø?ñAô Að Að ð 	;ð 	;ˆCÝ˜c¥5Ñ)Ô)ð D­c°#©h¬h¸!ªm¨mÝ)ØBñDô Dð Dð  #ÑˆD�*å˜d¥CÑ(Ô(ð =Ý)ð<ñ=ô =ð =ð �dˆ{ˆ{�rœv¨š}˜}µ´¸4°°Ý)ð +>Ø@CÀAÄñ+Gñ Hô Hð Hõ ˜j­$Ñ/Ô/ð ;Ý)ð:ñ;ô ;ð ;ð;ð!	;ð 	;r   c                 ó`   — | j         sd S g }| j         D ]\  }}|                     |¦  «         Œ|S )N)r   Úappend)r   Ú	lib_namesÚlib_namer@   s       r   Úget_library_nameszbuild_clib.get_library_namesš   sK   € ð Œ~ð 	Ø�4àˆ	Ø&*¤nð 	'ð 	'Ñ"ˆX�zØ×Ò˜XÑ&Ô&Ð&Ð&ØÐr   c                 ó  — |                       | j        ¦  «         g }| j        D ]_\  }}|                     d¦  «        }|�t          |t          t
          f¦  «        st          d|z  ¦  «        ‚|                     |¦  «         Œ`|S )NÚsourcesúfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)r$   r   Úgetr%   r9   r;   r:   Úextend)r   Ú	filenamesrD   r@   rG   s        r   Úget_source_fileszbuild_clib.get_source_files¦   sœ   € Ø×Ò ¤Ñ/Ô/Ð/Øˆ	Ø&*¤nð 	&ð 	&Ñ"ˆX�zØ —n’n YÑ/Ô/ˆGØˆ¥j°½4Å¸-Ñ&HÔ&HˆÝ)ð4à6>ñ?ñ@ô @ð @ð
 ×Ò˜WÑ%Ô%Ð%Ð%ØÐr   c                 óÞ  — |D ]é\  }}|                      d¦  «        }|�t          |t          t          f¦  «        st	          d|z  ¦  «        ‚t          |¦  «        }t          j        d|¦  «         |                      d¦  «        }|                      d¦  «        }| j                             || j	        ||| j
        ¬¦  «        }| j                             ||| j        | j
        ¬¦  «         Œêd S )NrG   rH   zbuilding '%s' libraryÚmacrosr   )Ú
output_dirrN   r   r   )rO   r   )rI   r%   r9   r;   r:   r   Úinfor   Úcompiler   r   Úcreate_static_libr   )r   r   rD   r@   rG   rN   r   Úobjectss           r   r1   zbuild_clib.build_librariesµ   s  € Ø&/ð 	>ð 	>Ñ"ˆX�zØ —n’n YÑ/Ô/ˆGØˆ¥j°½4Å¸-Ñ&HÔ&HˆÝ)ð4à6>ñ?ñ@ô @ð @õ ˜7‘m”mˆGåŒHÐ,¨hÑ7Ô7Ð7ð
  —^’^ HÑ-Ô-ˆFØ%Ÿ>š>¨.Ñ9Ô9ˆLØ”m×+Ò+¨GØ7;´Ø39Ø9EØ26´*ð	 ,ñ >ô >ˆGð ŒM×+Ò+¨G°XØ7;´Ø26´*ð ,ñ >ô >ð >ð >ð3	>ð 	>r   )Ú__name__Ú
__module__Ú__qualname__ÚdescriptionÚuser_optionsÚboolean_optionsr	   Úhelp_optionsr   r*   r5   r$   rE   rL   r1   © r   r   r   r      s»   € € € € € àC€Kð
ð 
ð 
€Lð  Ð(€Oð 
˜$Ø	# ^ð	5ð
€Lð
ð ð ð Dð Dð Dð4-ð -ð -ð0!;ð !;ð !;ðH	ð 	ð 	ðð ð ð>ð >ð >ð >ð >r   r   )Ú__doc__r(   Údistutils.corer   Údistutils.errorsÚdistutils.sysconfigr   Ú	distutilsr   r	   r   r[   r   r   ú<module>ra      s©   ððð ð  
€	€	€	Ø "Ð "Ð "Ð "Ð "Ð "Ø Ð Ð Ð Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø Ð Ð Ð Ð Ð ðð ð ð
u>ð u>ð u>ð u>ð u>�ñ u>ô u>ð u>ð u>ð u>r   