Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/lib/python/distutils/sysconfig.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�
��c	@s�dZdZddkZddkZddkZddkZddklZeii	ei
�Zeii	ei�Z
eiieiiei��Zeiiedd�Zeiie�Z[d�Zddd	�Zdddd
�Zd�Zd�Zd
�Zdd�Zeid�Zeid�Z eid�Z!dd�Z"d�Z#da$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*dS(s�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>
s>$Id: sysconfig.py 52234 2006-10-08 17:50:26Z ronald.oussoren $i�N(tDistutilsPlatformErrortModulestSetupcCstid S(s�Return a string containing the major and minor Python version,
    leaving off the patchlevel.  Sample return values could be '1.5'
    or '2.2'.
    i(tsystversion(((s&/sys/lib/python/distutils/sysconfig.pytget_python_version%sicCs�|d
jo|otpt}ntidjo�to�tiitiit	i
��}|o
|}nNtii|d�}tii|�p%tiitii|�d�}n|Sntii|dd�Sn�tidjotii|d�Sn�tidjo8|otii|dd�Sq�tii|d�Sn;tidjotii|d�Snt
d	ti��d
S(s�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.prefix or
    sys.exec_prefix -- i.e., ignore 'plat_specific'.
    tposixtIncludetincludetpythontnttmactMactos2sFI don't know where Python installs its C header files on platform '%s'N(tNonetEXEC_PREFIXtPREFIXtostnametpython_buildtpathtdirnametabspathRt
executabletjointexistsR(t
plat_specifictprefixtbasetinc_dir((s&/sys/lib/python/distutils/sysconfig.pytget_python_inc-s.
!
%cCs�|d
jo|otpt}ntidjo,|}|o|Sq�tii|d�SnFtidjoP|otii|d�Sq�t�djo|Sq�tiitdd�Sn�tidjoz|o;|otii|dd�SqGtii|dd�Sq�|otii|d�Sq�tii|dd�Sn\tidjo8|otiitd�Sq�tiitdd�Sntd	ti��d
S(sIReturn 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.prefix or
    sys.exec_prefix -- i.e., ignore 'plat_specific'.
    Rs
site-packagesR
tLibs2.2Rslib-dynloadR
s?I don't know where Python installs its library on platform '%s'N(	RRRRRRRRR(Rtstandard_libRt	libpython((s&/sys/lib/python/distutils/sysconfig.pytget_python_libUs8
c

Cs�|idjo�tddddddd�\}}}}}}}tiid�otid}ntiid�otid}ntiid�otid}ntiid	�otid	}n|d
}tiid�o|dtid}ntiid�o.|dtid}|dtid}ntiid
�oC|dtid
}|dtid
}|dtid
}n|d|}	|id|d|	d|	d|d|d|d|�||_ndS(s�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.
    tunixtCCtCXXtOPTtCFLAGStCCSHAREDtLDSHAREDtSOtCPPs -EtLDFLAGSt tCPPFLAGStpreprocessortcompilertcompiler_sotcompiler_cxxt	linker_sot
linker_exeN(t
compiler_typetget_config_varsRtenvironthas_keytset_executablestshared_lib_extension(
R0tcctcxxtopttcflagstccsharedtldsharedtso_exttcpptcc_cmd((s&/sys/lib/python/distutils/sysconfig.pytcustomize_compiler�s<$
	cCsSto
t}ntdd�}t�djo
d}nd}tii||�S(s2Return full pathname of installed pyconfig.h file.Ris2.2sconfig.hs
pyconfig.h(Rt
argv0_pathRRRRR(Rtconfig_h((s&/sys/lib/python/distutils/sysconfig.pytget_config_h_filename�s

cCsXto&tiitiiti�d�Sntdddd�}tii|dd�S(sAReturn full pathname of installed Makefile from the Python build.tMakefileRiR tconfig(RRRRRRRR"(tlib_dir((s&/sys/lib/python/distutils/sysconfig.pytget_makefile_filename�s&cCs�|djo
h}ntid�}tid�}x�|i�}|pPn|i|�}|oL|idd�\}}yt|�}Wntj
onX|||<q8|i|�}|od||id�<q8q8|S(s�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.
    s"#define ([A-Z][A-Za-z0-9_]+) (.*)
s&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
iiiN(Rtretcompiletreadlinetmatchtgrouptintt
ValueError(tfptgt	define_rxtundef_rxtlinetmtntv((s&/sys/lib/python/distutils/sysconfig.pytparse_config_h�s$

s"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)s\$\(([A-Za-z][A-Za-z0-9_]*)\)s\${([A-Za-z][A-Za-z0-9_]*)}c
Cs�ddkl}||dddddd�}|d
jo
h}nh}h}x�|i�}|d
joPnti|�}|ov|idd�\}}	ti|	�}	d|	jo|	||<q�t	|	�}	Wnt
j
onX|	||<qTqTx{|osxl|i�D]^}
||
}ti
|�p
ti
|�}|o!|id�}t}|i|�ot||�}
nM|i|�o
t}n3tii|�oti|}
nd	||<}
|o�||i�}||i� |
|}d|jo|||
<qkyt	|�}Wn&t
j
oti|�||
<nX|||
<||
=qvq||
=qWqW|i�|i|�|S(s�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.
    i�(tTextFiletstrip_commentsitskip_blankst
join_linesit$tN(tdistutils.text_fileR\RRNt_variable_rxRORPtstringtstripRQRRtkeyst_findvar1_rxtsearcht_findvar2_rxtTrueR8tstrtFalseRR7tendtstarttclosetupdate(tfnRTR\RStdonetnotdoneRWRXRYRZRtvaluetfoundtitemtafter((s&/sys/lib/python/distutils/sysconfig.pytparse_makefile�s`











cCsrxkti|�p
ti|�}|oA|i�\}}|d|!|i|id��||}qPq|S(s�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'.
    ii(RgRhRitspantgetRP(tstvarsRXtbegRm((s&/sys/lib/python/distutils/sysconfig.pytexpand_makefile_vars;s/cCs�h}yt�}t||�WnPtj
oD}d|}t|d�o|d|i}nt|��nXyd}tt|�|�WnPtj
oD}d|}t|d�o|d|i}nt|��nXti	djo�|i
d�o�|d}tidd�}|djo|}ti
d|�q�tt|id��tt|id��jo d	||f}t|��q�nto|d
|d<nt�djo�i	d
jo^tdd�}tii|dd�}tii|dd�}d||d|f|d<q�ti	djontdd�}ti|d�d}	tii|	�}
tii|d|
�}d|tt�f|d<q�n|adS(s7Initialize the module as appropriate for POSIX systems.s.invalid Python installation: unable to open %ststrerrors (%s)s/sys/src/cmd/python/pyconfig.htdarwintMACOSX_DEPLOYMENT_TARGETRat.sF$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" during configuret	BLDSHAREDR)s2.1taix4R iRIt	ld_so_aixs
python.exps%s %s -bI:%sR$tbeosis%s -L%s/lib -lpython%sN(RKRxtIOErrorthasattrRRR[tfileRtplatformR8RtgetenvtputenvtmapRQtsplitRRR"RRRdtbasenameRt_config_vars(RTtfilenametmsgtmy_msgt
cfg_targett
cur_targett
python_libR�t
python_exptlinkerscript_pathtlinkerscript_nametlinkerscript((s&/sys/lib/python/distutils/sysconfig.pyt_init_posixVsX	

 

1
	cCsih}tdddd�|d<tdddd�|d<tdd�|d<d|d	<d
|d<|adS(
s+Initialize the module as appropriate for NTRiR itLIBDESTt
BINLIBDESTt	INCLUDEPYs.pydR*s.exetEXEN(R"RR�(RT((s&/sys/lib/python/distutils/sysconfig.pyt_init_nt�s

cCs�h}tdddd�|d<tdddd�|d<tdd�|d<dd	k}t|d
�pd|d<nd
|i|d<tiitd�|d<tiitdd�|d<d|d<|a	d	S(s:Initialize the module as appropriate for Macintosh systemsRiR iR�R�R�i�Ntruntimemodels.ppc.slbR*s.%s.slbRtinstall_libRtinstall_platlibt:tsrcdir(
R"RtMacOSR�R�RRRRR�(RTR�((s&/sys/lib/python/distutils/sysconfig.pyt	_init_mac�s
cCsih}tdddd�|d<tdddd�|d<tdd�|d<d|d	<d
|d<|adS(
s-Initialize the module as appropriate for OS/2RiR iR�R�R�s.pydR*s.exeR�N(R"RR�(RT((s&/sys/lib/python/distutils/sysconfig.pyt	_init_os2�s

cGs7tdjo�t�idti�}|o|�nhattd<ttd<ti	djo�ti
�d}t|id�d�}|djoSxPdD]D}t|}t
idd|�}t
idd|�}|t|<q�Wq�q�|o5g}x$|D]}|iti|��qW|SntSdS(s�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 and Mac OS 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.
    t_init_Rtexec_prefixR�iR�iiR,t
BASECFLAGSR't	PY_CFLAGSR�s
-arch\s+\w+\sR-s-isysroot [^ 	]*N(sLDFLAGSR�sCFLAGSR�s	BLDSHARED(R�RtglobalsRzRRRRRR�tunameRQR�RLtsubtappend(targstfunctkernel_versiont
major_versiontkeytflagstvalsR((s&/sys/lib/python/distutils/sysconfig.pyR6�s2




cCst�i|�S(s�Return the value of a single variable using the dictionary
    returned by 'get_config_vars()'.  Equivalent to
    get_config_vars().get(name)
    (R6Rz(R((s&/sys/lib/python/distutils/sysconfig.pytget_config_vars(+t__doc__t__revision__RRLRdRtdistutils.errorsRRtnormpathRRR�RRRRRERtlandmarktisfileRRRRR"RDRGRKR[RMRcRgRiRxR~R�R�R�R�R�R6R�(((s&/sys/lib/python/distutils/sysconfig.pys<module>
s>!	(;	+		G		P				3

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.