Ë
    ¨Õ°j5  ã                  óŠ   — d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	 ddl
mZmZ dd	lmZ dd
lmZ ddlmZ  G d„ de«      Zy)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.é    )ÚannotationsN)ÚCallable)Úlog)ÚClassVaré   )Únew_compilerÚshow_compilers)ÚCommand)ÚDistutilsSetupError)Úcustomize_compilerc                  ó€   — e Zd ZU dZg d¢Zded<   ddgZded<   d	d
defgZded<   d„ Z	dd„Z
dd„Zdd„Zd„ Zd„ Zdd„Zy
)Ú
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 typez$ClassVar[list[tuple[str, str, str]]]Úuser_optionsr   r   zClassVar[list[str]]Úboolean_optionszhelp-compilerNzlist available compilerszAClassVar[list[tuple[str, str | None, str, Callable[[], object]]]]Úhelp_optionsc                ó‚   — d | _         d | _        d | _        d | _        d | _        d | _        d | _        d| _        d | _        y )NF)	r   Ú
build_tempÚ	librariesÚinclude_dirsÚdefineÚundefr   r   Úcompiler©Úselfs    ú^/var/www/mission/venv/lib/python3.12/site-packages/setuptools/_distutils/command/build_clib.pyÚinitialize_optionszbuild_clib.initialize_options-   sF   € ØˆŒØˆŒð ˆŒð !ˆÔØˆŒØˆŒ
ØˆŒ
ØˆŒ
Øˆ�ó    c                óœ  — | j                  dddddd«       | j                  j                  | _        | j                  r| j                  | j                  «       | j                  €| j                  j                  xs g | _        t        | j                  t        «      r/| j                  j                  t        j                  «      | _        y y )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_options<   s©   € ð 	×"Ñ"ØØ(Ø(Ø$ØØô	
ð ×*Ñ*×4Ñ4ˆŒØ�>Š>Ø×#Ñ# D§N¡NÔ3à×ÑÐ$Ø $× 1Ñ 1× >Ñ >Ò DÀ"ˆDÔÜ�d×'Ñ'¬Ô-Ø $× 1Ñ 1× 7Ñ 7¼¿
¹
Ó CˆDÕð .r$   c                ó  — | j                   sy t        | j                  | j                  ¬«      | _        t	        | j                  «       | j
                  �%| j                  j                  | j
                  «       | j                  �0| j                  D ]!  \  }}| j                  j                  ||«       Œ# | j                  �,| j                  D ]  }| j                  j                  |«       Œ | j                  | j                   «       y )N)r   r   )r   r   r   r   r   r   Úset_include_dirsr   Údefine_macror   Úundefine_macroÚbuild_libraries)r!   ÚnameÚvalueÚmacros       r"   Úrunzbuild_clib.runW   sÊ   € Ø�~Š~Øä$¨d¯m©mÀ4Ç:Á:ÔNˆŒÜ˜4Ÿ=™=Ô)à×ÑÐ(Ø�M‰M×*Ñ*¨4×+<Ñ+<Ô=Ø�;‰;Ð"à#Ÿ{™{ò 8‘��eØ—‘×*Ñ*¨4°Õ7ð8à�:‰:Ð!ØŸ™ò 4�Ø—‘×,Ñ,¨UÕ3ð4ð 	×Ñ˜TŸ^™^Õ,r$   c                ó†  — t        |t        «      st        d«      ‚|D ]¡  }t        |t        «      st	        |«      dk7  rt        d«      ‚|\  }}t        |t
        «      st        d«      ‚d|v s%t        j                  dk7  r$t        j                  |v rt        d|d   › d�«      ‚t        |t        «      rŒ˜t        d	«      ‚ y
)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 tuplesr   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 'r   z'': may not contain directory separatorszMsecond element of each tuple in 'libraries' must be a dictionary (build info)N)	r*   Úlistr   ÚtupleÚlenr+   r-   ÚsepÚdict)r!   r   Úlibr5   Ú
build_infos        r"   r)   zbuild_clib.check_library_listj   sÈ   € ô ˜)¤TÔ*Ü%Ð&SÓTÐTàò 	ˆCÜ˜c¤5Ô)¬c°#«h¸!ªmÜ)Ð*VÓWÐWà"ÑˆD�*ä˜d¤CÔ(Ü)ð:óð ð
 �d‰{œrŸv™v¨š}´·±¸4±Ü)Ø(¨¨Q©¨Ð0WÐXóð ô ˜j¬$Õ/Ü)ð8óð ñ%	r$   c                ón   — | j                   sy g }| j                   D ]  \  }}|j                  |«       Œ |S )N)r   Úappend)r!   Ú	lib_namesÚlib_nameÚ_build_infos       r"   Úget_library_nameszbuild_clib.get_library_namesŽ   s?   € ð �~Š~Øàˆ	Ø%)§^¡^ò 	'Ñ!ˆH�kØ×Ñ˜XÕ&ð	'àÐr$   c                óú   — | j                  | j                  «       g }| j                  D ]N  \  }}|j                  d«      }|�t        |t        t
        f«      st        d|› d�«      ‚|j                  |«       ŒP |S )NÚsourcesú in 'libraries' option (library 'úD'), 'sources' must be present and must be a list of source filenames)r)   r   Úgetr*   r;   r<   r   Úextend)r!   Ú	filenamesrE   rA   rI   s        r"   Úget_source_fileszbuild_clib.get_source_files™   sˆ   € Ø×Ñ §¡Ô/Øˆ	Ø$(§N¡Nò 		&Ñ ˆH�jØ —n‘n YÓ/ˆGØˆ¤j°¼4Ä¸-Ô&HÜ)Ø6°x°jð A1ð 1óð ð ×Ñ˜WÕ%ð		&ð Ðr$   c                óÜ  — |D ]ç  \  }}|j                  d«      }|�t        |t        t        f«      st	        d|› d�«      ‚t        |«      }t        j                  d|«       |j                  d«      }|j                  d«      }| j                  j                  || j                  ||| j                  ¬«      }| j                  j                  ||| j                  | j                  ¬«       Œé y )	NrI   rJ   rK   zbuilding '%s' libraryÚmacrosr   )Ú
output_dirrQ   r   r   )rR   r   )rL   r*   r;   r<   r   r   Úinfor   Úcompiler   r   Úcreate_static_libr   )r!   r   rE   rA   rI   rQ   r   Úobjectss           r"   r4   zbuild_clib.build_libraries¨   sç   € Ø$-ò 	Ñ ˆH�jØ —n‘n YÓ/ˆGØˆ¤j°¼4Ä¸-Ô&HÜ)Ø6°x°jð A1ð 1óð ô
 ˜7“mˆGä�H‰HÐ,¨hÔ7ð
  —^‘^ HÓ-ˆFØ%Ÿ>™>¨.Ó9ˆLØ—m‘m×+Ñ+ØØŸ?™?ØØ)Ø—j‘jð ,ó ˆGð �M‰M×+Ñ+Ø˜¨d¯o©oÀTÇZÁZð ,õ ñ9	r$   )ÚreturnÚNone)Ú__name__Ú
__module__Ú__qualname__Údescriptionr   Ú__annotations__r   r	   r   r#   r/   r8   r)   rG   rO   r4   © r$   r"   r   r      sl   … ØC€Kò:€LÐ6ó ð -4°WÐ+=€OÐ(Ó=ð 
˜$Ð :¸NÐKðW€LÐSó òóDó6-ó&"òH	òôr$   r   )Ú__doc__Ú
__future__r   r-   Úcollections.abcr   Údistutils._logr   Útypingr   Ú	ccompilerr   r	   Úcorer
   Úerrorsr   Ú	sysconfigr   r   r^   r$   r"   ú<module>rh      s5   ðñõ #ã 	Ý $Ý Ý ç 4Ý Ý (Ý *ôk�õ kr$   