
    f65                        d Z ddlZddlZddlZddlZddlZddlmZ ddlm	Z	 ddl
mZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%  e#            a& ej'        de(d	           dd
Z ee d          Z) eetL                    Zd Z* e*            Z+d Z,ddZ-dZ.	 esej/        Z.n# e0$ r Y nw xY wd Z1ddZ2ddZ3dS )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:        <fdrake@acm.org>
    N)partial   )DistutilsPlatformError)_PREFIX_BASE_PREFIX_EXEC_PREFIX_BASE_EXEC_PREFIX_PROJECT_BASE_PYTHON_BUILD_init_posixparse_config_h_init_non_posix_variable_rx_findvar1_rx_findvar2_rxexpand_makefile_varsis_python_buildget_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_python_versionzCThe distutils.sysconfig module is deprecated, use sysconfig instead   )
stacklevelc                 $    t          | |          S )N)vars)sysconfig_parse_config_h)fpgs     (../lib/python3.11/distutils/sysconfig.pyr   r   =   s    #BQ////    T)
check_homec                      t           j                            d          } | r|                     d          rdS t           j        dk    pt           j        dk    odt
          j        v S )N_PYTHON_HOST_PLATFORMmingwTposixntGCC)osenvironget
startswithnamesysversion)host_platforms    r    _posix_buildr1   D   sd     JNN#:;;M ##G,, 	47g 3	D	1Uck13r!   c                  `    t           rt          t                    S t          t                    S N)posix_buildr   _config_varsr    r!   r    _init_ntr7   P   s&     )<(((<(((r!   c                 4   ddl m}  || dddd          }|i }i }i }	 |                                }|nt          j        t
          |          }|r|                    dd          \  }}	|	                                }	|	                    d	d
          }
d|
v r|	||<   n?	 t          |	          }	|	||<   n)# t          $ r |	                    d	d          ||<   Y nw xY wd}|rt          |          D ]}||         }t          j        t          |          pt          j        t          |          }|rk|                    d          }d}||v rt          ||                   }nz||v rd}ns|t           j        v rt           j        |         }nR||v rG|                    d          r|dd         |v rd
}n*d|z   |v rd}n t          |d|z                      }nd
x||<   }|r||                                d         }|d|                                         |z   |z   }d|v r|||<   8t          |          }|||<   n'# t          $ r |                                ||<   Y nw xY w||= |                    d          r|dd         |v r|dd         }||vr|||<   ||= ||                                 |                                D ]1\  }}	t/          |	t                    r|	                                ||<   2|                    |           |S )zParse 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errorsNTr   z$$ $)CFLAGSLDFLAGSCPPFLAGSFPY_   )distutils.text_filer9   readlinerematchr   groupstripreplaceint
ValueErrorlistsearchr   r   strr)   r*   r,   endstartcloseitems
isinstanceupdate)fnr   r9   r   donenotdonelinemnvtmpvrenamed_variablesr-   valuefounditemafterks                     r    parse_makefilerf   W   s    -,,,,,	"QA!L]	^	^	^ByDG {{}}<H\4(( 	 771a==DAq		A99T2&&Dd{{

 AA
  DGG	 " 3 3 3iic22DGGG3! 4 :  0"MM /	" /	"DDME	,..P")L%2P2PA ,"GGAJJ99tAw<<DD'\\!EE"*__:a=DD+++u-- 4$qrr(>O2O2O!g-- %  #4	?33%''DGd 3!!%%''((OE!*17799*-4u<Ee||(-%(ZZU */DJJ  * 7 7 7).DJJJ7 $DM??511 3 $QRR,= = =#'8D#4//-2T
 DMMa  0"d HHJJJ 

    1a 	 ggiiDG HHTNNNHs$   !B6 6#CC,I!I%$I%r?   c           
         | j         dv r^dt          j        vrPdt          d<   dt          d<   dt          d<   d	t          d
<   d	t          d<   dt          d<   dt          d<   dt          d<   | j         dv rt          j        dk    rBt                              d          s(ddl}|                    t                     dt          d<   t          ddd
ddddd          \  }}}}}}}}	dt          j
        v rat          j
        d         }
t          j        dk    r=dt          j
        vr/|                    |          r|
|t          |          d         z   }|
}dt          j
        v rt          j
        d         }dt          j
        v rt          j
        d         }dt          j
        v rt          j
        d         }n|dz   }dt          j
        v r|dz   t          j
        d         z   }d
t          j
        v r0|dz   t          j
        d
         z   }|dz   t          j
        d
         z   }dt          j
        v rH|dz   t          j
        d         z   }|dz   t          j
        d         z   }|dz   t          j
        d         z   }dt          j
        v rt          j
        d         }dt          j
        v r|dz   t          j
        d         z   }n|dz   |	z   }|dz   |z   }|                     |||dz   |z   ||||           || _        dS dS )zDo 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.
    )cygwinmingw32r(   gccCCzg++CXXz%-fwrapv -O3 -Wall -Wstrict-prototypesOPTr?   rA   CCSHAREDz(gcc -shared -Wl,--enable-auto-image-baseLDSHAREDarARrcARFLAGS)unixrh   ri   darwinCUSTOMIZED_OSX_COMPILERr   NTrueSHLIB_SUFFIXCPPz -ErB    rC   )preprocessorcompilercompiler_socompiler_cxx	linker_so
linker_exearchiver)compiler_typer.   r/   r5   platformr+   _osx_supportcustomize_compilerr   r)   r*   r,   lenset_executablesshared_lib_extension)r|   r   cccxxcflagsccsharedldsharedshlib_suffixrp   ar_flagsnewcccppr   cc_cmds                 r    r   r      s    !666
 ##!&L"'L"IL%'L"')L$'QL$!%L&*L#!>>><8##  ##$=>> A####//===:@67 D%&
ND)U U 	JS&(HlB 2:Jt$E((""*44 ++B// 5 !8CGGHH#55BBJ*U#C##z*-HBJ*U#CCu*C
""#~
9(==Hrz!!c\BJx$88F#~
8(<<H##)bj44Cc\BJz$::F#~
:(>>H2:D!B
""Cx"*Y"77HHCx(*HcF"  x/ 	! 	 	 	 )5%%%} ?>r!   c                    || rt           pt          }t          rt          rU| rt          S t
          j                            t          d          d          }t
          j        	                    |          S dt                      z   t          z   }t
          j                            |d|          S t
          j        dk    rzt          rSt
          j                            |d          t
          j        j        z   t
          j                            |d          z   S t
          j                            |d          S t          dt
          j        z            )	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srcdirIncludepythonincluder'   PCzFI don't know where Python installs its C header files on platform '%s')BASE_EXEC_PREFIXBASE_PREFIXr4   python_buildproject_baser)   pathjoinr   normpathr   build_flagsr-   pathsepr   )plat_specificprefixincdir
python_dirs       r    get_python_incr   '  s    ~3#3B{ * 
	0  0##nX&>&>	JJw''/// 2 4 44{B
w||FIz:::	D 	0 GLL33bgoEGLL../ 0w||FI...$!#)* * 	*r!   c                    |#|r| rt           pt          }n| rt          pt          }t          rg| s|rt
          j        }nd}t          j        	                    ||dt                      z             }|r|S t          j        	                    |d          S t          j        dk    rC|r t          j        	                    |d          S t          j        	                    |dd          S t          dt          j        z            )aS  Return 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'.
    Nlibr   zsite-packagesr'   Libz?I don't know where Python installs its library on platform '%s')r   r   EXEC_PREFIXPREFIXr4   r.   
platlibdirr)   r   r   r   r-   r   )r   standard_libr   libdir	libpythons        r    get_python_libr   O  s    ~ 	="7'7F;FF"2{<fF * 	L 	 ^FF FGLL!),>,@,@!@B B	 	<7<<	?;;;	D 	@7<<...7<<???$!#)* * 	*r!   r3   )r   N)r   r   N)4__doc___impr)   rH   r.   warnings	functoolsr   r>   r   	sysconfigr   r   r   r   r   r   r	   r   r
   r   r   r   r   sysconfig_init_posixr   r   r   r   r   r   r   r   r   r   r   r   r   r5   warnDeprecationWarning_python_buildr1   r4   r7   rf   r   abiflagsAttributeErrorr   r   r   r6   r!   r    <module>r      sk  	 	  				 				 



        * * * * * *                                         :    I   0 0 0 0 D999g*L993 3 3 lnn) ) )f f f f^ 	 #l 	 	 	 	D	T5 T5 T5n%* %* %* %*P** ** ** ** ** **s   #	B- -B54B5