%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/setuptools/_distutils/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/setuptools/_distutils/__pycache__/unixccompiler.cpython-312.pyc

�


_�d�<���dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZmZmZmZddlmZdd	lmZd
�Zd�Zd�ZGd
�de�Zy)a9distutils.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)�compiler_fixupc��d}tjj|d�dk(rd}d||vr
|dz
}d||vr�
|d|||dfS)z�
    For macOS, split command into 'env' portion (if any)
    and the rest of the linker command.

    >>> _split_env(['a', 'b', 'c'])
    ([], ['a', 'b', 'c'])
    >>> _split_env(['/usr/bin/env', 'A=3', 'gcc'])
    (['/usr/bin/env', 'A=3'], ['gcc'])
    r�envr�=N��os�path�basename��cmd�pivots  �E/usr/lib/python3/dist-packages/setuptools/_distutils/unixccompiler.py�
_split_envr-sc��
�E�	�w�w����A���5�(����S��Z���Q�J�E��S��Z���v��;��E�F��#�#�c�`�tjj|d�dk(}|d|||dfS)a
    AIX platforms prefix the compiler with the ld_so_aix
    script, so split that from the linker command.

    >>> _split_aix(['a', 'b', 'c'])
    ([], ['a', 'b', 'c'])
    >>> _split_aix(['/bin/foo/ld_so_aix', 'gcc'])
    (['/bin/foo/ld_so_aix'], ['gcc'])
    r�	ld_so_aixNrrs  r�
_split_aixr?s8��
�G�G���S��V�$��3�E��v��;��E�F��#�#rc�:�t|�}|d||k(r|nd}||dS)a
    The linker command usually begins with the compiler
    command (possibly multiple elements), followed by zero or more
    params for shared library building.

    If the LDSHARED env variable overrides the linker command,
    however, the commands may not match.

    Return the best guess of the linker parameters by stripping
    the linker command. If the compiler command does not
    match the linker command, assume the linker command is
    just the first element.

    >>> _linker_params('gcc foo bar'.split(), ['gcc'])
    ['foo', 'bar']
    >>> _linker_params('gcc foo bar'.split(), ['other'])
    ['foo', 'bar']
    >>> _linker_params('ccache gcc foo bar'.split(), 'ccache gcc'.split())
    ['foo', 'bar']
    >>> _linker_params(['gcc'], ['gcc'])
    []
    Nr)�len)�
linker_cmd�compiler_cmd�c_lenrs    r�_linker_paramsr$Ms0��.
���E����'�<�7�E�Q�E��e�f��rc	�"�eZdZdZddgdgdgddgdgddgdd�Zejddd	k(rd
ged
<gd�ZdZd
Z	dZ
dZdZdxZ
xZZeZejdk(rdZ					dd�Zd�Z	dd�Z										d d�Zd�Zd�Zd�Zd�Zed��Zd!d�Zy)"�
UnixCCompiler�unixN�ccz-shared�arz-cr)�preprocessor�compiler�compiler_so�compiler_cxx�	linker_so�
linker_exe�archiver�ranlib��darwinr1)z.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%s�cygwinz.exec���|jd||�}|\}}}t||�}	|j|	z}
|r|
jd|g�|r||
dd|r|
j|�|
j	|�|j
xs|duxst
||�}|sy|r.|jtjj|��	|j|
�y#t$r}t|��d}~wwxYw)N�-or)�_fix_compile_argsrr*�extend�append�forcer�mkpathrr�dirname�spawnr	r
)
�self�source�output_file�macros�include_dirs�
extra_preargs�extra_postargs�
fixed_args�ignore�pp_opts�pp_args�
preprocess�msgs
             rrIzUnixCCompiler.preprocess�s����+�+�D�&�,�G�
�'1�$����(���>���#�#�g�-����N�N�D�+�.�/��'�G�B�Q�K���N�N�>�*����v���Z�Z�T�;�$�#6�T�%���:T�
�����K�K�������4�5�	$��J�J�w���!�	$��s�#�#��	$�s�	C�	C4�$C/�/C4c��t|j||z�}	|j||z|d|gz|z�y#t$r}t	|��d}~wwxYw)Nr6)rr,r=r	r
)	r>�obj�src�ext�cc_argsrDrGr,rJs	         r�_compilezUnixCCompiler._compile�s[��$�T�%5�%5�w��7O�P��	$��J�J�{�W�,��T�3�/?�?�.�P�Q��!�	$��s�#�#��	$�s�9�	A�A
�
Ac���|j||�\}}|j||��}|j||�r�|jtj
j
|��|j|j|gz|z|jz�|jr!	|j|j|gz�yytjd|�y#t$r}t|��d}~wwxYw)N)�
output_dir�skipping %s (up-to-date))�_fix_object_args�library_filename�
_need_linkr;rrr<r=r0�objectsr1r	rr
�debug)r>rW�output_libnamerRrX�target_lang�output_filenamerJs        r�create_static_libzUnixCCompiler.create_static_lib�s���#�3�3�G�Z�H�����/�/��:�/�V���?�?�7�O�4��K�K�������8�9��J�J�t�}�}��'8�8�7�B�T�\�\�Q�R��{�{�(��J�J�t�{�{�o�->�>�?��
�I�I�0�/�B��*�(�"�3�-�'��(�s�%C�	C6�&C1�1C6c���|j||�\}}|j|||�}|\}}}t||||�}t|ttd�f�st
d��|� tjj||�}|j||��r-||jz|zd|gz}|	rdg|dd|
r|
|dd|r|j|�|jtjj|��	|tj k(}|r|j"n|j$dd}|
dk(ro|j&rct)|�\}}t+|�\}}t)|j&�\}}t)|j"�\}}t-||�}||z|z|z}t/||�}|j1||z�yt7j8d|�y#t2$r}t5|��d}~wwxYw)Nz%'output_dir' must be a string or Noner6z-grzc++rS)rT�
_fix_lib_argsr�
isinstance�str�type�	TypeErrorrr�joinrVrWr8r;r<r�
EXECUTABLEr/r.r-rrr$rr=r	rr
rX)r>�target_descrWr[rR�	libraries�library_dirs�runtime_library_dirs�export_symbolsrXrCrD�
build_temprZrE�lib_opts�ld_args�building_exe�linkerr�	linker_ne�aix�	linker_na�_�compiler_cxx_ne�
linker_exe_ne�paramsrJs                            r�linkzUnixCCompiler.link�s��� #�3�3�G�Z�H�����'�'�	�<�AU�V�
�8B�5�	�<�!5�"�4��7K�Y�W���*�s�D��J�&7�8��C�D�D��!� �g�g�l�l�:��G�O��?�?�7�O�4�����,�x�7�4��:Q�Q�G��#�f������+���������~�.��K�K�������8�9�
%� +�i�.B�.B�B��-9�$�/�/�t�~�~�q�Q���%�'�D�,=�,=�%/��%7�N�C��%/�	�%:�N�C��)3�D�4E�4E�)F�&�A��'1�$�/�/�'B�$�A�}�+�I�}�E�F� �3�Y��8�6�A�F�'���8���
�
�6�G�+�,�
�I�I�0�/�B��&�
%���n�$��
%�s�CG�	G5�%G0�0G5c��d|zS)N�-L�)r>�dirs  r�library_dir_optionz UnixCCompiler.library_dir_option����c�z�rc��tjd�}tjj	tj|�d�}d|vxsd|vS)N�CCr�gcczg++)r�get_config_varrrr�shlex�split)r>�cc_varr+s   r�_is_gcczUnixCCompiler._is_gccsI���)�)�$�/���7�7�#�#�E�K�K��$7��$:�;���� �5�E�X�$5�5rc�V�tjdddk(r(ddlm}m}|�}|r||�ddgk\rd|zSd|zStjdd	d
k(rd|zStjdddk(r|j�rd
ndd|zgSt
jd�dk(rd|zSd|zS)Nr2r3r)�get_macosx_target_ver�
split_version�
�z-Wl,-rpath,rx��freebsdz-Wl,-rpath=zhp-uxz-Wl,+sz+s�GNULD�yesz-Wl,--enable-new-dtags,-Rz-Wl,-R)�sys�platform�distutils.utilr�r�r�rr�)r>rzr�r��macosx_target_vers     r�runtime_library_dir_optionz(UnixCCompiler.runtime_library_dir_options����<�<����x�'�K� 5� 7�� �]�3D�%E�"�a��%P�$�s�*�*��c�z�!�
�\�\�"�1�
��
*� �3�&�&�
�\�\�"�1�
��
(� �L�L�N����s�
��
��#�#�G�,��5�/��4�4��c�>�!rc��d|zS)Nz-lry)r>�libs  r�library_optionzUnixCCompiler.library_optionDr|rc�f�tjd�}tjd|�}tj
dk(xr<|xr8|j
d�xs%|j
d�xr|j
d�}|r2tjj|jd�|dd�S|S)	a�
        macOS users can specify an alternate SDK using'-isysroot'.
        Calculate the SDK root if it is specified.

        Note that, as of Xcode 7, Apple SDKs may contain textual stub
        libraries with .tbd extensions rather than the normal .dylib
        shared libraries installed in /.  The Apple compiler tool
        chain handles this transparently but it can cause problems
        for programs that are being built with an SDK and searching
        for specific libraries.  Callers of find_library_file need to
        keep in mind that the base filename of the returned SDK library
        file might have a different extension from that of the library
        file installed on the running system, for example:
          /Applications/Xcode.app/Contents/Developer/Platforms/
              MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/
              usr/lib/libedit.tbd
        vs
          /usr/lib/libedit.dylib
        �CFLAGSz-isysroot\s*(\S+)r3z/System/z/usr/z/usr/local/rN)rr��re�searchr�r��
startswithrrrc�group)rz�cflags�match�
apply_roots    r�
_library_rootzUnixCCompiler._library_rootGs���*�)�)�(�3���	�	�.��7��
�L�L�H�$�
��
����z�*�S��N�N�7�+�Q�C�N�N�=�4Q�0Q�	�9C�r�w�w�|�|�E�K�K��N�C���G�4�K��Krc������fd�dj�D�}t�j|�}d�tj||�D�}ttjj|�}t|d�S)a/
        Second-guess the linker with not much hard
        data to go on: GCC seems to prefer the shared library, so
        assume that *all* Unix C compilers do,
        ignoring even GCC's "-static" option.

        >>> compiler = UnixCCompiler()
        >>> compiler._library_root = lambda dir: dir
        >>> monkeypatch = getfixture('monkeypatch')
        >>> monkeypatch.setattr(os.path, 'exists', lambda d: 'existing' in d)
        >>> dirs = ('/foo/bar/missing', '/foo/bar/existing')
        >>> compiler.find_library_file(dirs, 'abc').replace('\\', '/')
        '/foo/bar/existing/libabc.dylib'
        >>> compiler.find_library_file(reversed(dirs), 'abc').replace('\\', '/')
        '/foo/bar/existing/libabc.dylib'
        >>> monkeypatch.setattr(os.path, 'exists',
        ...     lambda d: 'existing' in d and '.a' in d)
        >>> compiler.find_library_file(dirs, 'abc').replace('\\', '/')
        '/foo/bar/existing/libabc.a'
        >>> compiler.find_library_file(reversed(dirs), 'abc').replace('\\', '/')
        '/foo/bar/existing/libabc.a'
        c3�D�K�|]}�j�|�����y�w))�lib_typeN)rU)�.0rar�r>s  ��r�	<genexpr>z2UnixCCompiler.find_library_file.<locals>.<genexpr>�s)�����
��
�!�!�#��!�5�
�s� zdylib xcode_stub shared staticc3�bK�|]'\}}tjj||����)y�w)N)rrrc)r��root�lib_names   rr�z2UnixCCompiler.find_library_file.<locals>.<genexpr>�s+����
���h�
�G�G�L�L��x�(�
�s�-/N)
r��mapr��	itertools�product�filterrr�exists�next)r>�dirsr�rX�	lib_names�roots�searched�founds` `     r�find_library_filezUnixCCompiler.find_library_filejsp���.
�8�>�>�@�
�	�
�D�&�&��-��
�"+�"3�"3�E�9�"E�
��
�r�w�w�~�~�x�0���E�4� � r)NNNNN)NrN)
NNNNNrNNNN)r)�__name__�
__module__�__qualname__�
compiler_type�executablesr�r��src_extensions�
obj_extension�static_lib_extension�shared_lib_extension�dylib_lib_extension�xcode_stub_lib_extension�static_lib_format�shared_lib_format�dylib_lib_format�xcode_stub_lib_format�
exe_extensionrIrPr\rvr{r�r�r��staticmethodr�r�ryrrr&r&is(���M���F��v����I�&��f��5�M��	�K��|�|�B�Q��8�#�!)�
��H��?�N��M��� ��"��%��?H�H��H�)�,<�,��
�|�|�x���
�
�����#$�J$�NR�C�:���!�������9C�~�6�
&"�P�� L�� L�D&!rr&)�__doc__rr�r�r�r��r�dep_utilr�	ccompilerrrr�errorsr	r
rr�_logr
�
_macos_compatrrrr$r&ryrr�<module>r�sP��
�
�
�	�����I�I�I�I��)�$$�$$��8g!�I�g!r

Zerion Mini Shell 1.0