ok

Mini Shell

Direktori : /opt/alt/python311/lib64/python3.11/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/distutils/__pycache__/ccompiler.cpython-311.pyc

�

�f:�����dZddlZddlZddlZddlTddlmZddlmZddl	m
Z
ddlmZddl
mZmZdd	lmZGd
�d��ZdZdd
�Zdddddd�Zd�Zdd�Zd�Zd�ZdS)z�distutils.ccompiler

Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model.�N)�*)�spawn)�	move_file)�mkpath)�newer_group)�split_quoted�execute)�logc��eZdZdZdZdZdZdZdZdZ	dZ
dZdddddd�Zgd�Z
dAd	�Zd
�Zd�Zd�Zd
�ZdBd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!dBd�Z"d�Z#d�Z$d �Z%d!�Z&		dCd"�Z'			dDd#�Z(d$�Z)		dEd%�Z*d&Z+d'Z,d(Z-										dFd)�Z.										dFd*�Z/										dFd+�Z0								dGd,�Z1d-�Z2d.�Z3d/�Z4		dHd0�Z5dId1�Z6dJd3�Z7dJd4�Z8dJd5�Z9		dKd7�Z:dLd9�Z;d:�Z<d;�Z=dMd<�Z>d=�Z?d>�Z@dNd@�ZAdS)O�	CCompilera�Abstract base class to define the interface that must be implemented
    by real compiler classes.  Also has some utility methods used by
    several compiler classes.

    The basic idea behind a compiler abstraction class is that each
    instance can be used for all the compile/link steps in building a
    single project.  Thus, attributes common to all of those compile and
    link steps -- include directories, macros to define, libraries to link
    against, etc. -- are attributes of the compiler instance.  To allow for
    variability in how individual files are treated, most of those
    attributes may be varied on a per-compilation or per-link basis.
    N�c�c++�objc)�.cz.ccz.cppz.cxxz.m)rrr
rc��||_||_||_d|_g|_g|_g|_g|_g|_g|_	|j
���D]#}|�||j
|���$dS�N)
�dry_run�force�verbose�
output_dir�macros�include_dirs�	libraries�library_dirs�runtime_library_dirs�objects�executables�keys�set_executable)�selfrrr�keys     �:/opt/alt/python311/lib64/python3.11/distutils/ccompiler.py�__init__zCCompiler.__init__Us��������
�������������������%'��!�����#�(�(�*�*�	<�	<�C�����T�%5�c�%:�;�;�;�;�	<�	<�c��|D]F}||jvrtd|�d|jj�����|�|||���GdS)a�Define the executables (and options for them) that will be run
        to perform the various stages of compilation.  The exact set of
        executables that may be specified here depends on the compiler
        class (via the 'executables' class attribute), but most will have:
          compiler      the C/C++ compiler
          linker_so     linker used to create shared objects and libraries
          linker_exe    linker used to create binary executables
          archiver      static library creator

        On platforms with a command-line (Unix, DOS/Windows), each of these
        is a string that will be split into executable name and (optional)
        list of arguments.  (Splitting the string is done similarly to how
        Unix shells operate: words are delimited by spaces, but quotes and
        backslashes can override this.  See
        'distutils.util.split_quoted()'.)
        zunknown executable 'z' for class N)r�
ValueError�	__class__�__name__r)r �kwargsr!s   r"�set_executableszCCompiler.set_executablesysr��4�	2�	2�C��$�*�*�*� �j��s�s�D�N�3�3�"5�6�6�6�����V�C�[�1�1�1�1�		2�	2r$c��t|t��r t||t|����dSt|||��dSr)�
isinstance�str�setattrr)r r!�values   r"rzCCompiler.set_executable�sL���e�S�!�!�	&��D�#�|�E�2�2�3�3�3�3�3��D�#�u�%�%�%�%�%r$c�H�d}|jD]}|d|kr|cS|dz
}�dS)Nr�)r)r �name�i�defns    r"�_find_macrozCCompiler._find_macro�s>��
���K�	�	�D��A�w�$�������
��F�A�A��tr$c��|D]~}t|t��rOt|��dvr>t|dt��s|d�t|dt��st	d|zdzdz����dS)z�Ensures that every element of 'definitions' is a valid macro
        definition, ie. either (name,value) 2-tuple or a (name,) tuple.  Do
        nothing if all definitions are OK, raise TypeError otherwise.
        )r1�r1Nrzinvalid macro definition '%s': z.must be tuple (string,), (string, string), or z(string, None))r,�tuple�lenr-�	TypeError)r �definitionsr4s   r"�_check_macro_definitionsz"CCompiler._check_macro_definitions�s���
 �	(�	(�D��t�U�+�+�
(���Y�Y�&�(�(�!�4��7�C�0�0�)�48��G�O���Q���-�-�5D��!B�T�!I�F�!G�&�!'�(�(�(�5D�	(�	(r$c�|�|�|��}|�|j|=|j�||f��dS)a_Define a preprocessor macro for all compilations driven by this
        compiler object.  The optional parameter 'value' should be a
        string; if it is not supplied, then the macro will be defined
        without an explicit value and the exact outcome depends on the
        compiler used (XXX true? does ANSI say anything about this?)
        N�r5r�append)r r2r/r3s    r"�define_macrozCCompiler.define_macro�sE��
���d�#�#���=���A������D�%�=�)�)�)�)�)r$c�~�|�|��}|�|j|=|f}|j�|��dS)a�Undefine a preprocessor macro for all compilations driven by
        this compiler object.  If the same macro is defined by
        'define_macro()' and undefined by 'undefine_macro()' the last call
        takes precedence (including multiple redefinitions or
        undefinitions).  If the macro is redefined/undefined on a
        per-compilation basis (ie. in the call to 'compile()'), then that
        takes precedence.
        Nr>)r r2r3�undefns    r"�undefine_macrozCCompiler.undefine_macro�sH��
���d�#�#���=���A���������6�"�"�"�"�"r$c�:�|j�|��dS)z�Add 'dir' to the list of directories that will be searched for
        header files.  The compiler is instructed to search directories in
        the order in which they are supplied by successive calls to
        'add_include_dir()'.
        N)rr?�r �dirs  r"�add_include_dirzCCompiler.add_include_dir��!��	
�� � ��%�%�%�%�%r$c�$�|dd�|_dS)aySet the list of directories that will be searched to 'dirs' (a
        list of strings).  Overrides any preceding calls to
        'add_include_dir()'; subsequence calls to 'add_include_dir()' add
        to the list passed to 'set_include_dirs()'.  This does not affect
        any list of standard include directories that the compiler may
        search by default.
        N�r�r �dirss  r"�set_include_dirszCCompiler.set_include_dirs�s��!����G����r$c�:�|j�|��dS)a�Add 'libname' to the list of libraries that will be included in
        all links driven by this compiler object.  Note that 'libname'
        should *not* be the name of a file containing a library, but the
        name of the library itself: the actual filename will be inferred by
        the linker, the compiler, or the compiler class (depending on the
        platform).

        The linker will be instructed to link against libraries in the
        order they were supplied to 'add_library()' and/or
        'set_libraries()'.  It is perfectly valid to duplicate library
        names; the linker will be instructed to link against libraries as
        many times as they are mentioned.
        N)rr?)r �libnames  r"�add_libraryzCCompiler.add_library�s ��	
����g�&�&�&�&�&r$c�$�|dd�|_dS)z�Set the list of libraries to be included in all links driven by
        this compiler object to 'libnames' (a list of strings).  This does
        not affect any standard system libraries that the linker may
        include by default.
        N)r)r �libnamess  r"�
set_librarieszCCompiler.set_libraries�s��"�!�!�!�����r$c�:�|j�|��dS)a'Add 'dir' to the list of directories that will be searched for
        libraries specified to 'add_library()' and 'set_libraries()'.  The
        linker will be instructed to search for libraries in the order they
        are supplied to 'add_library_dir()' and/or 'set_library_dirs()'.
        N)rr?rEs  r"�add_library_dirzCCompiler.add_library_dirrHr$c�$�|dd�|_dS)z�Set the list of library search directories to 'dirs' (a list of
        strings).  This does not affect any standard library search path
        that the linker may search by default.
        N)rrKs  r"�set_library_dirszCCompiler.set_library_dirss��
!����G����r$c�:�|j�|��dS)zlAdd 'dir' to the list of directories that will be searched for
        shared libraries at runtime.
        N)rr?rEs  r"�add_runtime_library_dirz!CCompiler.add_runtime_library_dirs!��	
�!�(�(��-�-�-�-�-r$c�$�|dd�|_dS)z�Set the list of directories to search for shared libraries at
        runtime to 'dirs' (a list of strings).  This does not affect any
        standard search path that the runtime linker may search by
        default.
        N)rrKs  r"�set_runtime_library_dirsz"CCompiler.set_runtime_library_dirss��%)����G��!�!�!r$c�:�|j�|��dS)z�Add 'object' to the list of object files (or analogues, such as
        explicitly named library files or the output of "resource
        compilers") to be included in every link driven by this compiler
        object.
        N)rr?)r �objects  r"�add_link_objectzCCompiler.add_link_object s ��	
����F�#�#�#�#�#r$c�$�|dd�|_dS)z�Set the list of object files (or analogues) to be included in
        every link to 'objects'.  This does not affect any standard object
        files that the linker may include by default (such as system
        libraries).
        N)r)r rs  r"�set_link_objectszCCompiler.set_link_objects(s���q�q�q�z����r$c�:�|�|j}n$t|t��std���|�|j}n1t|t
��r
||jpgz}ntd���|�|j}nEt|t
tf��rt|��|jpgz}ntd���|�g}|�|d|���}t|��t|��ksJ�t||��}i}	tt|����D]p}
||
}||
}tj
�|��d}
|�tj
�|����||
f|	|<�q|||||	fS)z;Process arguments and decide which source files to compile.N�%'output_dir' must be a string or None�/'macros' (if supplied) must be a list of tuples�6'include_dirs' (if supplied) must be a list of stringsr)�	strip_dirrr1)rr,r-r:r�listrr8�object_filenamesr9�gen_preprocess_options�range�os�path�splitextr�dirname)r �outdirr�incdirs�sources�depends�extrar�pp_opts�buildr3�src�obj�exts              r"�_setup_compilezCCompiler._setup_compile6s����>��_�F�F��F�C�(�(�	E��C�D�D�D��>��[�F�F�
���
%�
%�	O��t�{�0�b�1�F�F��M�N�N�N��?��'�G�G�
��$���
/�
/�	L��7�m�m�t�'8�'>�B�?�G�G��J�L�L�
L��=��E��'�'��1�39�(�;�;���7�|�|�s�7�|�|�+�+�+�+�(���9�9�����s�7�|�|�$�$�	$�	$�A��!�*�C��!�*�C��'�"�"�3�'�'��*�C��K�K������,�,�-�-�-��s��E�#�J�J��w��w��5�5r$c�8�|dgz}|rdg|dd�<|r||dd�<|S)Nz-cz-gr�)r rs�debug�before�cc_argss     r"�_get_cc_argszCCompiler._get_cc_argsas?���T�F�"���	!��&�G�B�Q�B�K��	!� �G�B�Q�B�K��r$c�|�|�|j}n$t|t��std���|�|j}n1t|t
��r
||jpgz}ntd���|�|j}nEt|t
tf��rt|��|jpgz}ntd���|||fS)a'Typecheck and fix-up some of the arguments to the 'compile()'
        method, and return fixed-up values.  Specifically: if 'output_dir'
        is None, replaces it with 'self.output_dir'; ensures that 'macros'
        is a list, and augments it with 'self.macros'; ensures that
        'include_dirs' is a list, and augments it with 'self.include_dirs'.
        Guarantees that the returned values are of the correct type,
        i.e. for 'output_dir' either string or None, and for 'macros' and
        'include_dirs' either list or None.
        Nrbrcrd)rr,r-r:rrfrr8)r rrrs    r"�_fix_compile_argszCCompiler._fix_compile_argsjs�������J�J��J��,�,�	E��C�D�D�D��>��[�F�F�
���
%�
%�	O��t�{�0�b�1�F�F��M�N�N�N����,�L�L�
��t�U�m�
4�
4�	L���-�-��1B�1H�b�I�L�L��J�L�L�
L��6�<�/�/r$c�|�|�||���}t|��t|��ksJ�|ifS)a,Decide which source files must be recompiled.

        Determine the list of object files corresponding to 'sources',
        and figure out which ones really need to be recompiled.
        Return a list of all object files and a dictionary telling
        which source files can be skipped.
        )r)rgr9)r rprrqrs     r"�
_prep_compilezCCompiler._prep_compile�sE���'�'��J�'�G�G���7�|�|�s�7�|�|�+�+�+�+���{�r$c���t|ttf��std���t|��}|�|j}n$t|t
��std���||fS)z�Typecheck and fix up some arguments supplied to various methods.
        Specifically: ensure that 'objects' is a list; if output_dir is
        None, replace with self.output_dir.  Return fixed versions of
        'objects' and 'output_dir'.
        z,'objects' must be a list or tuple of stringsNrb)r,rfr8r:rr-)r rrs   r"�_fix_object_argszCCompiler._fix_object_args�sq���'�D�%�=�1�1�	L��J�K�K�K��w�-�-������J�J��J��,�,�	E��C�D�D�D���$�$r$c���|�|j}nEt|ttf��rt|��|jpgz}nt	d���|�|j}nEt|ttf��rt|��|jpgz}nt	d���|�|j}nEt|ttf��rt|��|jpgz}nt	d���|||fS)a;Typecheck and fix up some of the arguments supplied to the
        'link_*' methods.  Specifically: ensure that all arguments are
        lists, and augment them with their permanent versions
        (eg. 'self.libraries' augments 'libraries').  Return a tuple with
        fixed versions of all arguments.
        Nz3'libraries' (if supplied) must be a list of stringsz6'library_dirs' (if supplied) must be a list of stringsz>'runtime_library_dirs' (if supplied) must be a list of strings)rr,rfr8r:rr)r rrrs    r"�
_fix_lib_argszCCompiler._fix_lib_args�s1������I�I�
�	�D�%�=�
1�
1�	I��i�(�(�D�N�,@�b�A�I�I��G�I�I�
I����,�L�L�
��t�U�m�
4�
4�	L���.�.�$�2C�2I�r�J�L�L��J�L�L�
L� �'�#'�#<� � �
�,�t�U�m�
<�
<�	9�$(�)=�$>�$>�%)�%>�%D�"�%F� � ��8�9�9�
9��<�)=�>�>r$c�l�|jrdS|jrt||d���}nt||��}|S)zjReturn true if we need to relink the files listed in 'objects'
        to recreate 'output_file'.
        T�newer)�missing)rrr)r r�output_filer�s    r"�
_need_linkzCCompiler._need_link�sG���:�	��4��|�
;�#�W�k�7�K�K�K���#�W�k�:�:���Lr$c�N�t|t��s|g}d}t|j��}|D]s}tj�|��\}}|j�|��}	|j�	|��}||kr|}|}�d#t$rY�pwxYw|S)z|Detect the language of a given file, or list of files. Uses
        language_map, and language_order to do the job.
        N)r,rfr9�language_orderrjrkrl�language_map�get�indexr&)	r rp�langr��source�baserw�extlang�extindexs	         r"�detect_languagezCCompiler.detect_language�s����'�4�(�(�	 ��i�G����D�'�(�(���		�		�F���(�(��0�0�I�D�#��'�+�+�C�0�0�G�
��.�4�4�W�=�=���e�#�#�"�D�$�E����
�
�
���
�����s�0$B�
B"�!B"c��dS)a�Preprocess a single C/C++ source file, named in 'source'.
        Output will be written to file named 'output_file', or stdout if
        'output_file' not supplied.  'macros' is a list of macro
        definitions as for 'compile()', which will augment the macros set
        with 'define_macro()' and 'undefine_macro()'.  'include_dirs' is a
        list of directory names that will be added to the default list.

        Raises PreprocessError on failure.
        Nrz)r r�r�rr�
extra_preargs�extra_postargss       r"�
preprocesszCCompiler.preprocess�s	��	
�r$c		���|�||||||��\}}	}}
}|�|
||��}|	D]9}
	||
\}}n#t$rY�wxYw|�|
|||||
���:|	S)aK	Compile one or more source files.

        'sources' must be a list of filenames, most likely C/C++
        files, but in reality anything that can be handled by a
        particular compiler and compiler class (eg. MSVCCompiler can
        handle resource files in 'sources').  Return a list of object
        filenames, one per source filename in 'sources'.  Depending on
        the implementation, not all source files will necessarily be
        compiled, but all corresponding object filenames will be
        returned.

        If 'output_dir' is given, object files will be put under it, while
        retaining their original path component.  That is, "foo/bar.c"
        normally compiles to "foo/bar.o" (for a Unix implementation); if
        'output_dir' is "build", then it would compile to
        "build/foo/bar.o".

        'macros', if given, must be a list of macro definitions.  A macro
        definition is either a (name, value) 2-tuple or a (name,) 1-tuple.
        The former defines a macro; if the value is None, the macro is
        defined without an explicit value.  The 1-tuple case undefines a
        macro.  Later definitions/redefinitions/ undefinitions take
        precedence.

        'include_dirs', if given, must be a list of strings, the
        directories to add to the default include file search path for this
        compilation only.

        'debug' is a boolean; if true, the compiler will be instructed to
        output debug symbols in (or alongside) the object file(s).

        'extra_preargs' and 'extra_postargs' are implementation- dependent.
        On platforms that have the notion of a command-line (e.g. Unix,
        DOS/Windows), they are most likely lists of strings: extra
        command-line arguments to prepend/append to the compiler command
        line.  On other platforms, consult the implementation class
        documentation.  In any event, they are intended as an escape hatch
        for those occasions when the abstract compiler framework doesn't
        cut the mustard.

        'depends', if given, is a list of filenames that all targets
        depend on.  If a source file is older than any file in
        depends, then the source file will be recompiled.  This
        supports dependency tracking, but only at a coarse
        granularity.

        Raises CompileError on failure.
        )rxr~�KeyError�_compile)r rprrrr{r�r�rqrrsrtr}rvrurws                r"�compilezCCompiler.compile�s���l�#�#�J���g�$+�^�=�=�	8�����%��#�#�G�U�M�B�B���	K�	K�C�
� ��:���S�S���
�
�
���
�����M�M�#�s�C��.�'�J�J�J�J��s�A	�	
A�Ac��dS)zCompile 'src' to product 'obj'.Nrz)r rvrurwr}r�rss       r"r�zCCompiler._compileCs	��	
�r$c��dS)a&Link a bunch of stuff together to create a static library file.
        The "bunch of stuff" consists of the list of object files supplied
        as 'objects', the extra object files supplied to
        'add_link_object()' and/or 'set_link_objects()', the libraries
        supplied to 'add_library()' and/or 'set_libraries()', and the
        libraries supplied as 'libraries' (if any).

        'output_libname' should be a library name, not a filename; the
        filename will be inferred from the library name.  'output_dir' is
        the directory where the library file will be put.

        'debug' is a boolean; if true, debugging information will be
        included in the library (note that on most platforms, it is the
        compile step where this matters: the 'debug' flag is included here
        just for consistency).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LibError on failure.
        Nrz)r r�output_libnamerr{�target_langs      r"�create_static_libzCCompiler.create_static_libIs	��0	
�r$�
shared_object�shared_library�
executablec��t�)auLink a bunch of stuff together to create an executable or
        shared library file.

        The "bunch of stuff" consists of the list of object files supplied
        as 'objects'.  'output_filename' should be a filename.  If
        'output_dir' is supplied, 'output_filename' is relative to it
        (i.e. 'output_filename' can provide directory components if
        needed).

        'libraries' is a list of libraries to link against.  These are
        library names, not filenames, since they're translated into
        filenames in a platform-specific way (eg. "foo" becomes "libfoo.a"
        on Unix and "foo.lib" on DOS/Windows).  However, they can include a
        directory component, which means the linker will look in that
        specific directory rather than searching all the normal locations.

        'library_dirs', if supplied, should be a list of directories to
        search for libraries that were specified as bare library names
        (ie. no directory component).  These are on top of the system
        default and those supplied to 'add_library_dir()' and/or
        'set_library_dirs()'.  'runtime_library_dirs' is a list of
        directories that will be embedded into the shared library and used
        to search for other shared libraries that *it* depends on at
        run-time.  (This may only be relevant on Unix.)

        'export_symbols' is a list of symbols that the shared library will
        export.  (This appears to be relevant only on Windows.)

        'debug' is as for 'compile()' and 'create_static_lib()', with the
        slight distinction that it actually matters on most platforms (as
        opposed to 'create_static_lib()', which includes a 'debug' flag
        mostly for form's sake).

        'extra_preargs' and 'extra_postargs' are as for 'compile()' (except
        of course that they supply command-line arguments for the
        particular linker being used).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LinkError on failure.
        ��NotImplementedError)r �target_descr�output_filenamerrrr�export_symbolsr{r�r��
build_tempr�s              r"�linkzCCompiler.linkis��r"�!r$c
��|�tj||�|d���|||||||	|
||�
�
dS)N�shared)�lib_type)r�r�SHARED_LIBRARY�library_filename)
r rr�rrrrr�r{r�r�r�r�s
             r"�link_shared_libzCCompiler.link_shared_lib�s_��	
�	�	�)�*�G��'�'���'�J�J���\�+?� �%����[�	J�	J�	J�	J�	Jr$c
�\�|�tj|||||||||	|
||�
�
dSr)r�r�
SHARED_OBJECT)
r rr�rrrrr�r{r�r�r�r�s
             r"�link_shared_objectzCCompiler.link_shared_object�sK��	
�	�	�)�)�7�!�:��\�+?� �%����[�		J�	J�	J�	J�	Jr$c��|�tj||�|��||||d|||	d|
�
�
dSr)r�r�
EXECUTABLE�executable_filename)r r�output_prognamerrrrr{r�r�r�s           r"�link_executablezCCompiler.link_executable�sX��	
�	�	�)�&���*�*�?�;�;�Z��\�+?������k�	K�	K�	K�	K�	Kr$c��t�)zkReturn the compiler option to add 'dir' to the list of
        directories searched for libraries.
        r�rEs  r"�library_dir_optionzCCompiler.library_dir_option��
��"�!r$c��t�)zsReturn the compiler option to add 'dir' to the list of
        directories searched for runtime libraries.
        r�rEs  r"�runtime_library_dir_optionz$CCompiler.runtime_library_dir_option�r�r$c��t�)zReturn the compiler option to add 'lib' to the list of libraries
        linked into the shared library or executable.
        r�)r �libs  r"�library_optionzCCompiler.library_option�r�r$c��ddl}|�g}|�g}|�g}|�g}|�d|d���\}}tj|d��}		|D]}
|	�d|
z���|	�d|z��|	���n#|	���wxYw	|�|g|�	��}n#t$rYd
SwxYw	|�|d||���n#ttf$rYd
SwxYwdS)
z�Return a boolean indicating whether funcname is supported on
        the current platform.  The optional arguments can be used to
        augment the compilation environment.
        rNrT)�text�wz#include "%s"
z=int main (int argc, char **argv) {
    %s();
    return 0;
}
rJFza.out)rr)�tempfile�mkstemprj�fdopen�write�closer��CompileErrorr��	LinkErrorr:)r �funcname�includesrrrr��fd�fname�f�inclrs            r"�has_functionzCCompiler.has_function�s~��	�������H����L����I����L��$�$�T�8�$�$�?�?�	��E��I�b�#����
	� �
6�
6�����-��4�5�5�5�5�
�G�G��
��
�
�
�
�G�G�I�I�I�I��A�G�G�I�I�I�I����	��l�l�E�7��l�F�F�G�G���	�	�	��5�5�	����	�� � ��'�+4�.:�
!�
<�
<�
<�
<���9�%�	�	�	��5�5�	�����ts0�5B�B&�*C�
C�C�C/�/D�Dc��t�)aHSearch the specified list of directories for a static or shared
        library file 'lib' and return the full path to that file.  If
        'debug' true, look for a debugging version (if that makes sense on
        the current platform).  Return None if 'lib' wasn't found in any of
        the specified directories.
        r�)r rLr�r{s    r"�find_library_filezCCompiler.find_library_file$s
��"�!r$�c���|�d}g}|D]�}tj�|��\}}tj�|��d}|tj�|��d�}||jvrt
d|�d|�d����|rtj�|��}|�tj�	|||j
z������|S)Nr�r1zunknown file type 'z	' (from 'z'))rjrkrl�
splitdrive�isabs�src_extensions�UnknownFileError�basenamer?�join�
obj_extension)r �source_filenamesrer�	obj_names�src_namer�rws        r"rgzCCompiler.object_filenamesOs�����J��	�(�
	F�
	F�H���(�(��2�2�I�D�#��7�%�%�d�+�+�A�.�D����
�
�d�+�+�,�,�-�D��$�-�-�-�&�&�>A�c�c�8�8�8�L�N�N�N��
.��w�'�'��-�-�����R�W�\�\�*�*.��1C�*C�E�E�
F�
F�
F�
F��r$c��|�J�|rtj�|��}tj�|||jz��Sr)rjrkr�r��shared_lib_extension�r r�rers    r"�shared_object_filenamez CCompiler.shared_object_filename`sI���%�%�%��	2��w�'�'��1�1�H��w�|�|�J��4�3L�(L�M�M�Mr$c��|�J�|rtj�|��}tj�|||jpdz��S)Nr�)rjrkr�r��
exe_extensionr�s    r"r�zCCompiler.executable_filenamefsN���%�%�%��	2��w�'�'��1�1�H��w�|�|�J��D�4F�4L�"�(M�N�N�Nr$�staticc��|�J�|dvrtd���t||dz��}t||dz��}tj�|��\}}|||fz}	|rd}tj�|||	��S)N)r�r��dylib�
xcode_stubz?'lib_type' must be "static", "shared", "dylib", or "xcode_stub"�_lib_format�_lib_extensionr�)r&�getattrrjrk�splitr�)
r rOr�rer�fmtrwrFr��filenames
          r"r�zCCompiler.library_filenamels����%�%�%��F�F�F��[�]�]�
]��d�H�}�4�5�5���d�H�'7�7�8�8���G�M�M�'�*�*�	��T��$���$���	��C��w�|�|�J��X�6�6�6r$r1c�.�tj|��dSr)r
r{)r �msg�levels   r"�announcezCCompiler.announces���	�#�����r$c�8�ddlm}|rt|��dSdS)Nr)�DEBUG)�distutils.debugr��print)r r�r�s   r"�debug_printzCCompiler.debug_print�s5��)�)�)�)�)�)��	��#�J�J�J�J�J�	�	r$c�J�tj�d|z��dS)Nzwarning: %s
)�sys�stderrr�)r r�s  r"�warnzCCompiler.warn�s#���
����3�.�/�/�/�/�/r$c�4�t||||j��dSr)r	r)r �func�argsr�r�s     r"r	zCCompiler.execute�s����d�C���.�.�.�.�.r$c�2�t||j���dS�N)r)rr)r �cmds  r"rzCCompiler.spawn�s��
�c�4�<�(�(�(�(�(�(r$c�0�t|||j���Sr)rr)r ru�dsts   r"rzCCompiler.move_file�s����c�4�<�8�8�8�8r$�c�4�t|||j���dSr)rr)r r2�modes   r"rzCCompiler.mkpath�s���t�T�4�<�0�0�0�0�0�0r$)rrrr)NNNNN)NNNrNNN)NrN)
NNNNNrNNNN)NNNNrNNN)NNNN)r)rr�)r�rr�)r1)Nr1)r	)Br(�
__module__�__qualname__�__doc__�
compiler_typer�r��static_lib_extensionr��static_lib_format�shared_lib_formatr�r�r�r#r*rr5r<r@rCrGrMrPrSrUrWrYr[r^r`rxr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rgr�r�r�r�r�rr	rrrrzr$r"rrs���������*�M�4�N��M����������M�!�"�"�"�#�	��L�*�)�)�N�"<�"<�"<�"<�H2�2�2�@&�&�&����(�(�(�"
*�
*�
*�
*�#�#�#�$&�&�&�$�$�$�'�'�'� %�%�%�&�&�&�$�$�$�.�.�.�,�,�,�$�$�$�"�"�"�)6�)6�)6�V���0�0�0�@���� %�%�%�" ?� ?� ?�D������0;?�IM�
�
�
�
�8<�:>�-1�B�B�B�B�H
�
�
�EI�/3�
�
�
�
�8$�M�%�N��J����"&� ��� ���9"�9"�9"�9"�B$(�"&�%)�-1�'+��&*�'+�#'�$(�J�J�J�J�0'+�%)�(,�04�*.�!"�)-�*.�&*�'+�J�J�J�J�.$(�"&�%)�-1��&*�'+�$(�K�K�K�K�,"�"�"�"�"�"�"�"�"�BF�26�*�*�*�*�X"�"�"�"�V����"N�N�N�N�O�O�O�O�2:�13�7�7�7�7�&�������
0�0�0�/�/�/�/�)�)�)�9�9�9�1�1�1�1�1�1r$r))zcygwin.*�unix)�posixr)�nt�msvcc��|�tj}|�tj}tD]3\}}tj||���tj||���|cS�4dS)akDetermine the default compiler to use for the given platform.

       osname should be one of the standard Python OS names (i.e. the
       ones returned by os.name) and platform the common value
       returned by sys.platform for the platform in question.

       The default values are os.name and sys.platform in case the
       parameters are not given.
    Nr)rjr2r��platform�_default_compilers�re�match)�osnamer�pattern�compilers    r"�get_default_compilerr�sj���~�������<��/������
�8�G�X�&�&�2�
�8�G�V�$�$�0��O�O�O�1��6r$)�
unixccompiler�
UnixCCompilerzstandard UNIX-style compiler)�
_msvccompiler�MSVCCompilerzMicrosoft Visual C++)�cygwinccompiler�CygwinCCompilerz'Cygwin port of GNU C Compiler for Win32)r$�Mingw32CCompilerz(Mingw32 port of GNU C Compiler for Win32)�bcppcompiler�BCPPCompilerzBorland C++ Compiler)rr�cygwin�mingw32�bcppc��ddlm}g}t���D].}|�d|zdt|df���/|���||��}|�d��dS)zyPrint list of available compilers (used by the "--help-compiler"
    options to "build", "build_ext", "build_clib").
    r)�FancyGetoptz	compiler=Nr7zList of available compilers:)�distutils.fancy_getoptr-�compiler_classrr?�sort�
print_help)r-�	compilersr�pretty_printers    r"�show_compilersr4�s���3�2�2�2�2�2��I�"�'�'�)�)�8�8�����+�h�.��(��2�1�5�7�	8�	8�	8�	8�
�N�N���� �[��+�+�N����<�=�=�=�=�=r$c���|�tj}	|�t|��}t|\}}}n,#t$rd|z}|�|d|zz}t|���wxYw	d|z}t
|��tj|}	t|	��|}
n?#t$rtd|z���t$rtd|�d|�d����wxYw|
d||��S)	a[Generate an instance of some CCompiler subclass for the supplied
    platform/compiler combination.  'plat' defaults to 'os.name'
    (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler
    for that platform.  Currently only 'posix' and 'nt' are supported, and
    the default compilers are "traditional Unix interface" (UnixCCompiler
    class) and Visual C++ (MSVCCompiler class).  Note that it's perfectly
    possible to ask for a Unix compiler object under Windows, and a
    Microsoft compiler object under Unix -- if you supply a value for
    'compiler', 'plat' is ignored.
    Nz5don't know how to compile C/C++ code on platform '%s'z with '%s' compilerz
distutils.z4can't compile C/C++ code: unable to load module '%s'z0can't compile C/C++ code: unable to find class 'z
' in module '�')rjr2rr/r��DistutilsPlatformError�
__import__r��modules�vars�ImportError�DistutilsModuleError)�platrrrr�module_name�
class_name�long_descriptionr��module�klasss           r"�new_compilerrC�sJ���|��w��	*���+�D�1�1�H�6D�X�6N�3��j�"2�"2���*�*�*�E��L�����-��8�8�C�$�S�)�)�)�	*����=�"�[�0���K� � � ���[�)���V���Z�(��������"�D�����	��=�=�=�"�"�#-�:�:�{�{�{�<�=�=�	=�=�����5��w��&�&�&s�"3�)A� ;B�<Cc���g}|D]�}t|t��rdt|��cxkrdksntd|z���t|��dkr|�d|dz���wt|��dkr?|d�|�d|dz����|�d|z����|D]}|�d	|z���|S)
aGenerate C pre-processor options (-D, -U, -I) as used by at least
    two types of compilers: the typical Unix compiler and Visual C++.
    'macros' is the usual thing, a list of 1- or 2-tuples, where (name,)
    means undefine (-U) macro 'name', and (name,value) means define (-D)
    macro 'name' to 'value'.  'include_dirs' is just a list of directory
    names to be added to the header file search path (-I).  Returns a list
    of command-line options suitable for either Unix compilers or Visual
    C++.
    r1r7zPbad macro definition '%s': each element of 'macros' list must be a 1- or 2-tuplez-U%srNz-D%sz-D%s=%sz-I%s)r,r8r9r:r?)rrrs�macrorFs     r"rhrhs��*�G��2�2���5�%�(�(�	�Q�#�e�*�*�-A�-A�-A�-A��-A�-A�-A�-A��J�����
�
�u�:�:��?�?��N�N�6�E�!�H�,�-�-�-�-�
��Z�Z�1�_�_��Q�x�����v��a��0�1�1�1�1�
���y�5�0�1�1�1���%�%�����v��|�$�$�$�$��Nr$c�*�g}|D]*}|�|�|�����+|D]G}|�|��}t|t��r||z}�2|�|���H|D]�}t
j�|��\}}	|rH|�|g|	��}
|
r|�|
���U|�	d|z���n|�|�
|������|S)acGenerate linker options for searching library directories and
    linking with specific libraries.  'libraries' and 'library_dirs' are,
    respectively, lists of library names (not filenames!) and search
    directories.  Returns a list of command-line options suitable for use
    with some compiler (depending on the two format strings passed in).
    z6no library file corresponding to '%s' found (skipping))r?r�r�r,rfrjrkr�r�rr�)rrrr�lib_optsrF�optr��lib_dir�lib_name�lib_files           r"�gen_lib_optionsrL8sF���H��:�:������3�3�C�8�8�9�9�9�9�#�!�!���1�1�#�6�6���c�4� � �	!��#�~�H�H��O�O�C� � � � ��
;�
;�� �g�m�m�C�0�0���(��	;��1�1�7�)�X�F�F�H��
=�����)�)�)�)��
�
�6�8;�<�=�=�=�=�
�O�O�H�3�3�S�9�9�:�:�:�:��Or$)NN)NNrrr)rr�rjr�distutils.errors�distutils.spawnr�distutils.file_utilr�distutils.dir_utilr�distutils.dep_utilr�distutils.utilrr	�	distutilsr
rrrr/r4rCrhrLrzr$r"�<module>rTst��1�1�
����������������!�!�!�!�!�!�)�)�)�)�)�)�%�%�%�%�%�%�*�*�*�*�*�*�0�0�0�0�0�0�0�0�������E1�E1�E1�E1�E1�E1�E1�E1�X������0?�7�J�K�7�
�
��>�>�>�"*'�*'�*'�*'�Z*�*�*�Z$�$�$�$�$r$

Zerion Mini Shell 1.0