� ,�ReVI����dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dej vZ ej�ej��Zej�ej��Zej�ej��Zej�ej��Zdejvr&ej�ejd��ZnNejr8ej�ej�ej����Znej��Zd �Zeed d��Z d �Z!ej"d kr!e d ���Z#e#e��Ze#e ��Z d�Z$e$��Z%dZ& e%sej'Z&n #e($rYnwxYwd�Z)d$d�Z*d�Z+d�Z,d�Z-d�Z.d�Z/d�Z0d%d�Z1d�Z2d�Z3d�Z4d&d�Z5ej6d��Z7ej6d��Z8ej6d��Z9d&d �Z:d!�Z;dadS)'a�Provide access to Python's configuration information. The specific configuration variables available depend heavily on the platform and configuration. The values may be retrieved using get_config_var(name), and the list of variables is available via get_config_vars().keys(). Additional convenience functions are also available. Written by: Fred L. Drake, Jr. Email: �N�)�DistutilsPlatformError)� py39compat)� pass_none�__pypy__�_PYTHON_PROJECT_BASEc���tj|���d���t�fd�dD����S)z] Return True if the target directory appears to point to an un-installed Python. �Modulesc3�f�K�|]+}��|�����V��,dS�N)�joinpath�is_file)�.0�fn�moduless ���/builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/_distutils/sysconfig.py� z(_is_python_source_dir..2s=�����Q�Q�"�w����#�#�+�+�-�-�Q�Q�Q�Q�Q�Q�)�Setupz Setup.local)�pathlib�Pathr �any)�drs @r�_is_python_source_dirr,sD��� �l�1�o�o�&�&�y�1�1�G� �Q�Q�Q�Q�8P�Q�Q�Q� Q� Q�Qr�_homec��tj�|���tj�|����S)z, Return True if a is a parent of b. )�os�path�normcase� startswith)�dir_a�dir_bs r� _is_parentr#8s8�� �7� � �E� "� "� -� -�b�g�.>�.>�u�.E�.E� F� F�Fr�ntc�\��ttf}�fd�|D��}t|���S)Nc3�x�K�|]4}t�tj�|d�����0|V��5dS)�PCbuildN)r#rr�join)r�prefixrs �rrz_fix_pcbuild..EsW����� � ���!�R�W�\�\�&�)�<�<�=�=� � � � � � � � r)�PREFIX� BASE_PREFIX�next)r�prefixes�matcheds` r� _fix_pcbuildr/AsI����;�&�� � � � �"� � � �� �G�Q���rc�`�trtt��Stt��Sr )� _sys_homer� project_base�rr� _python_buildr4Ps&���0�$�Y�/�/�/� �� .� .�.r�c�0�dtjdd�zS)z�Return a string containing the major and minor Python version, leaving off the patchlevel. Sample return values could be '1.5' or '2.2'. z%d.%dN�)�sys� version_infor3rr�get_python_versionr:fs�� �S�%�b�q�b�)� )�)rc���|rtnt}|�|n|} t��dtj��}n*#t $rt dtjz���wxYw||||��S)a�Return the directory containing installed Python header files. If 'plat_specific' is false (the default), this is the path to the non-platform-specific header files, i.e. Python.h and so on; otherwise, this is the path to platform-specific header files (namely pyconfig.h). If 'prefix' is supplied, use it instead of sys.base_prefix or sys.base_exec_prefix -- i.e., ignore 'plat_specific'. N�_get_python_inc_zFI don't know where Python installs its C header files on platform '%s')�BASE_EXEC_PREFIXr+�globalsr�name�KeyErrorr)� plat_specificr)�default_prefix�resolved_prefix�getters r�get_python_incrEns���*7�G�%�%�K�N� &� 2�f�f��O� ����7�b�g�7�7�8���� � � � �$� �!#�� )� � � � ���� �6�/�6�=� 9� 9�9s �!:�'A!c���tr0tjdkr tj�|d��St |��pt||��pt|��S)N����include) �IS_PYPYr8r9rrr(�_get_python_inc_posix_python�_get_python_inc_from_config�_get_python_inc_posix_prefix�r)� spec_prefixrAs r�_get_python_inc_posixrQ�s_���/�3�#�f�,�,��w�|�|�F�I�.�.�.�$�]�3�3� 0� &�}�k� B� B� 0� '�� /� /�rc���tsdS|rtptStj�t d��d��}tj�|��S)z� Assume the executable is in the build directory. The pyconfig.h file should be in the same directory. Since the build directory may not be the source directory, use "srcdir" from the makefile to find the "Include" directory. N�srcdir�Include)� python_buildr1r2rrr(�get_config_var�normpath)rA�incdirs rrLrL�sW�� �����)��(�L�(� �W�\�\�.��2�2�I� >� >�F� �7� � �F� #� #�#rc�4�|�td|zdz��SdS)aj If no prefix was explicitly specified, provide the include directory from the config vars. Useful when cross-compiling, since the config vars may come from the host platform Python installation, while the current Python executable is from the build platform installation. >>> monkeypatch = getfixture('monkeypatch') >>> gpifc = _get_python_inc_from_config >>> monkeypatch.setitem(gpifc.__globals__, 'get_config_var', str.lower) >>> gpifc(False, '/usr/bin/') >>> gpifc(False, '') >>> gpifc(False, None) 'includepy' >>> gpifc(True, None) 'confincludepy' N�CONF� INCLUDEPY)rV)rArPs rrMrM�s*��&���f�}�4�{�B�C�C�C��rc��trdnd}|t��ztz}tj�|d|��S)N�pypy�pythonrJ)rKr:� build_flagsrrr()r)�implementation� python_dirs rrNrN�s>��&�4�V�V�H�N��"4�"6�"6�6��D�J� �7�<�<�� �:� 6� 6�6rc���trStj�|d��tjjztj�|d��zStj�|d��S)NrJ�PC)rUrrr(�pathseprOs r�_get_python_inc_ntre�s`��� � �G�L�L��� +� +��g�o� ��g�l�l�6�4�(�(� )� � �7�<�<�� � *� *�*rc�J�|r|Stj�|d��S)N� site-packages)rrr()� standard_lib� libpython� early_prefixr)s r� _posix_librk�s&���8����w�|�|�I��7�7�7rc��trltjdkr\|�t}|r1tj�|dtjd��Stj�|d��S|}|�#|r|rtpt}n|rtpt}tj dkrj|s|rttdd��}nd}trd nd }tj�|||t��z��}t||||��Stj d krC|r tj�|d ��Stj�|d d��Std tj z���)aSReturn the directory containing the Python library (standard or site additions). If 'plat_specific' is true, return the directory containing platform-specific modules, i.e. any module from a non-pure-Python module distribution; otherwise, return the platform-shared library directory. If 'standard_lib' is true, return the directory containing standard Python library modules; otherwise, return the directory for site-specific modules. If 'prefix' is supplied, use it instead of sys.base_prefix or sys.base_exec_prefix -- i.e., ignore 'plat_specific'. rGNz lib-pythonrrg�posix� platlibdir�libr]r^r$�Libz?I don't know where Python installs its library on platform '%s')rKr8r9r*rrr(�versionr=r+� EXEC_PREFIXr?�getattrr:rkr)rArhr)rj�libdirr`ris r�get_python_libru�ss���5�3�#�f�,�,� �>��F� � F��7�<�<�� �c�k�!�n�E�E� E��w�|�|�F�O�4�4�4��L� �~� � =�"�7�'7�F�;�F�F�"�2�{�<�f�F� �w�'��� � �L� ��S�,��6�6�F�F��F�#*�8������G�L�L����BT�BV�BV�1V�W�W� ��,� �<��H�H�H� ��D��� � @��7�<�<���.�.� .��7�<�<����?�?� ?�$� �!#�� )� � � rc ��|jdk�r�tjdkr7td��s(ddl}|�t ��dt d<tddd d d d d d��\}}}}}}}} dtj vrQtj d} d tj vr/|� |��r| |t|��d�z}| }dtj vrtj d}d tj vrtj d }dtj vrtj d} n|dz} dtj vr|dztj dz}d tj vr0|dztj d z}|dztj d z}dtj vrH| dztj dz} |dztj dz}|dztj dz}d tj vrtj d }dtj vr|dztj dz} n|dz| z} |dz|z} |� | | | dz|z|||| ���dtj vrA|j �dd��r&|� tj d���||_dSdS)z�Do any platform-specific customization of a CCompiler instance. Mainly needed on Unix, so we can plug in the information that varies across Unices and is stored in Python's Makefile. �unix�darwin�CUSTOMIZED_OSX_COMPILERrN�True�CC�CXX�CFLAGS�CCSHARED�LDSHARED� SHLIB_SUFFIX�AR�ARFLAGS�CPPz -E�LDFLAGS� �CPPFLAGS)� preprocessor�compiler� compiler_so� compiler_cxx� linker_so� linker_exe�archiver�RANLIB�ranlib)r�)� compiler_typer8�platformrV� _osx_support�customize_compiler� _config_vars�get_config_varsr�environr �len�set_executables� executables�get�shared_lib_extension)r�r��cc�cxx�cflags�ccshared�ldshared� shlib_suffix�ar�ar_flags�newcc�cppr��cc_cmds rr�r�s��� ���'�'� �<�8� #� #�"�";�<�<� A�#�#�#�#��/�/� �=�=�=�:@� �6�7� � � � � � � � � � � � � � � � � � � � � �2�:� � ��J�t�$�E����+�+��0C�0C�B�0G�0G�+�!�8�C��G�G�I�I�#6�6���B� �B�J� � ��*�U�#�C� ��� #� #��z�*�-�H� �B�J� � ��*�U�#�C�C��u�*�C� �� � "� "��#�~�� �9�(=�=�H� �r�z� !� !��c�\�B�J�x�$8�8�F��#�~�� �8�(<�<�H� ��� #� #���)�b�j��4�4�C��c�\�B�J�z�$:�:�F��#�~�� �:�(>�>�H� �2�:� � ���D�!�B� �� � "� "��C�x�"�*�Y�"7�7�H�H��C�x�(�*�H��c��F�"��� � ����� �x�/����� !� � � � �r�z� !� !�h�&:�&>�&>�x��&N�&N� !� � $� $�B�J�x�,@� $� A� A� A�(4��%�%�%�g(�'rc� �trktjdkr-tj�t pt d��}nt pt }tj�|d��Stj��S)z2Return full pathname of installed pyconfig.h file.r$rcz pyconfig.h) rUrr?rr(r1r2� sysconfig�get_config_h_filename)�inc_dirs rr�r�bs`���1� �7�d�?�?��g�l�l�9�#<� �d�C�C�G�G��/�<�G��w�|�|�G�\�2�2�2��.�0�0�0rc�(�tj��S)zAReturn full pathname of installed Makefile from the Python build.)r��get_makefile_filenamer3rrr�r�ns�� � *� ,� ,�,rc�.�tj||���S)z�Parse a config.h-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. )�vars)r��parse_config_h)�fp�gs rr�r�ss�� � #�B�Q� /� /� /�/rz"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}c�6�ddlm}||dddd���}|�i}i}i} |���}|�n�t�|��}|r�|�dd��\}} | ���} | �d d ��} d | vr| ||<n? t| ��} | ||<n)#t$r| �d d ��||<YnwxYw��d } |�r�t|��D�]�} || } t� | ��pt� | ��}|�rl|�d��}d}||vrt||��}nz||vrd }ns|tjvrtj|}nR|| vrG| �d��r| dd�| vrd }n*d|z|vrd }n t|d|z��}nd x||<}|r�| |���d�}| d|����|z|z} d |vr| || <��8 t| ��} | || <n'#t$r| ���|| <YnwxYw|| =| �d��r| dd�| vr| dd�} | |vr| || <���|| =���|���|���|���D]1\}} t-| t��r| ���||<�2|�|��|S)z�Parse a Makefile-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. r)�TextFiler�surrogateescape)�strip_comments� skip_blanks� join_lines�errorsNTr7z$$r5�$)r}r�r�F�PY_rH)�distutils.text_filer��readline� _variable_rx�match�group�strip�replace�int� ValueError�list� _findvar1_rx�search� _findvar2_rx�strrr�r �end�start�close�items� isinstance�update)rr�r�r��done�notdone�line�m�n�v�tmpv�renamed_variablesr?�value�found�item�after�ks r�parse_makefiler��s���-�,�,�,�,�,� �� �1�!��BS� � � �B� �y� �� �D��G� ��{�{�}�}�� �<� � � � �t� $� $�� � ��7�7�1�a�=�=�D�A�q���� � �A��9�9�T�2�&�&�D��d�{�{���� � � ��A���A�  �D��G�G�� "�3�3�3��i�i��c�2�2�D��G�G�G�3����! �4:�� �0"���M�M�/ "�/ "�D��D�M�E��#�#�E�*�*�H�l�.A�.A�%�.H�.H�A��, "��G�G�A�J�J������9�9��t�A�w�<�<�D�D��'�\�\�!�E�E��"�*�_�_��:�a�=�D�D��+�+�+����u�-�-�4�$�q�r�r�(�>O�2O�2O�!������g�-�-� %��� #�4��� �?�3�3���%'�'�D��G�d��3�!�!�%�%�'�'�)�)�,�E�!�+�A�G�G�I�I�+�.��5��=�E��e�|�|�(-��� � �/�$'��J�J�E�*/�D��J�J�� *�7�7�7�).�����D��J�J�J�7����$�D�M��?�?�5�1�1�3�d�1�2�2�h�BS�6S�6S�#'����8�D�#�4�/�/�-2��T� ���D�M�M�a �0"�d�H�H�J�J�J�� � � � � � ���1� �a�� � � ��g�g�i�i�D��G���H�H�T�N�N�N� �Hs$�!B6�6#C�C�-I�!I&�%I&c�$� t�|��pt�|��}|rV|���\}}|d|�|�|�d����z||d�z}nn��|S)a�Expand Makefile-style variables -- "${foo}" or "$(foo)" -- in 'string' according to 'vars' (a dictionary mapping variable names to values). Variables not present in 'vars' are silently expanded to the empty string. The variable values in 'vars' should not contain further variable expansions; if 'vars' is the output of 'parse_makefile()', you're fine. Returns a variable-expanded version of 's'. TrrN)r�r�r��spanr�r�)�sr�r��begr�s r�expand_makefile_varsr��s���� � � �� "� "� <�l�&9�&9�!�&<�&<�� � ������J�S�#��!�C�%��4�8�8�A�G�G�A�J�J�/�/�/�!�C�D�D�'�9�A�A� � � �Hrc��t�>tj�����at jt��|r d�|D��ntS)a�With no arguments, return a dictionary of all configuration variables relevant for the current platform. Generally this includes everything needed to build extensions and install both pure modules and extensions. On Unix, this means every variable defined in Python's installed Makefile; on Windows it's a much smaller set. With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary. Nc�B�g|]}t�|����Sr3)r�r�)rr?s r� z#get_config_vars..s&�� 4� 4� 4�t�L� � �T� "� "� 4� 4� 4r)r�r�r��copyr�add_ext_suffix)�argss rr�r� sT���� �0�2�2�7�7�9�9� ��!�,�/�/�/�8<� N� 4� 4�t� 4� 4� 4� 4�,�Nrc��|dkr ddl}|�dtd��t���|��S)z�Return the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) �SOrNz SO is deprecated, use EXT_SUFFIXr7)�warnings�warn�DeprecationWarningr�r�)r?r�s rrVrVsH��  �t�|�|������ � �8�:L�a�P�P�P� � � � � �� &� &�&r)rN)rrNr )?�__doc__r�rer8r�rr�rr5r� _functoolsr�builtin_module_namesrKrrWr)r*� exec_prefixrr� base_prefixr+�base_exec_prefixr=r��abspathr2� executable�dirname�getcwdrrsr1r#r?r/r4rUr_�abiflags�AttributeErrorr:rErQrLrMrNrerkrur�r�r�r��compiler�r�r�r�r�r�r�rVr3rr�r�s��� � � � � � � � � � � � � � ���������*�*�*�*�*�*�������!�!�!�!�!�!� ��0� 0�� �� � �#�*� %� %���g���s��/�/� ��g���s��/�/� ��7�#�#�C�$8�9�9�� �R�Z�'�'��7�?�?�2�:�.D�#E�F�F�L�L� �~�#��w���r�w���s�~�'F�'F�G�G� � �!�r�y�{�{� �R�R�R� �G�C��$� '� '� �G�G�G��7�d�?�?�� � ��Y� � �<� �-�-�L�� �Y�'�'�I�/�/�/� �}��� � � � � �#��l� ���� � � � �D� ���� *�*�*�:�:�:�:�.��� $� $� $� D�D�D�.7�7�7� +� +� +�8�8�8�3 �3 �3 �3 �lY5�Y5�Y5�x 1� 1� 1�-�-�-� 0�0�0�0��r�z�?�@�@� ��r�z�:�;�;� ��r�z�8�9�9� �j �j �j �j �Z � � �2� �O�O�O�$ '� '� '� '� 's�: F�F � F