Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/distutils/
Upload File :
Current File : //usr/lib/python2.7/distutils/sysconfig.pyc


|_c@sxdZdZddlZddlZddlZddlZddlmZejj	ej
Zejj	ejZ
ejjejjejZejdkrdedjkrejjejjeejjZnejdkr>ded	jkr>ejjejjeejjejjZnejdkrd
edjkrejjejjeejjejjZndZeZd
ZdddZddddZdadZdZdZddZ ej!dZ"ej!dZ#ej!dZ$ddZ%dZ&da'dZ(dZ)dZ*dZ+dZ,dS(sProvide 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$iN(tDistutilsPlatformErrortnttpcbuildis\pc\vis\pcbuild\amd64icCs=x6dD].}tjjtjjtd|rtSqWtS(Ns
Setup.distsSetup.localtModules(s
Setup.distsSetup.local(tostpathtisfiletjointproject_basetTruetFalse(tfn((s)/usr/lib/python2.7/distutils/sysconfig.pyt
_python_build-s
$cCstjd S(sReturn 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)/usr/lib/python2.7/distutils/sysconfig.pytget_python_version5sicCs%|dkr!|rtpt}ntjdkrtrtjjtj	}|rZ|}n<tjj
tjj|td}tjj|d}|Stjj|ddt
tjrdpdStjdkrtjj|dStjd	krtjj|dStd
tjdS(sReturn 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'.
    tposixtsrcdirtIncludetincludetpythont_dtRtos2sFI don't know where Python installs its C header files on platform '%s'N(tNonetEXEC_PREFIXtPREFIXRtnametpython_buildRtdirnameR
t
executabletabspathRtget_config_varRtpydebugR(t
plat_specifictprefixtbuildirtinc_dirR((s)/usr/lib/python2.7/distutils/sysconfig.pytget_python_inc=s&	0cCsq|ptjj|dk}|dkr@|r7tp:t}ntjdkrtjj|ddt}|rx|S|rdtj	krdt
jkrtjj|dStjj|d	Sntjd
kr|rtjj|dStdkr|Stjj|dd	SnTtjd
krZ|rAtjj|dStjj|dd	SntdtjdS(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'.
    s/usrs
/usr/localRtlibRtPYTHONUSERBASEtreal_prefixs
dist-packagess
site-packagesRtLibs2.2Rs?I don't know where Python installs its library on platform '%s'N(s/usrs
/usr/local(
RRtnormpathRRRRRRtenvironR
t__dict__R(R"tstandard_libR#tis_default_prefixt	libpython((s)/usr/lib/python2.7/distutils/sysconfig.pytget_python_libcs0$cCs|jdkrtdddddddd	d
dd\}}}}}}}}}	}
}d'}dtjkrtjd}ntjd
kr4|dkr4td'kr"ddlm	}
ddl
m}m}|ddt
d|d|}|j|jdkrt
a|
jdq"tantr4d}q4n|rtjd
kr~d	tjkr~|j|r~||t|}n|}ndtjkrtjd}nd	tjkrtjd	}ndtjkrtjd}n
|d}dtjkr|dtjd}ndtjkr4tjd}ndtjkrStjd}ndjd|||fD}dtjkrdjd||tjd|fD}|dtjd}ndtjkr|dtjd}|dtjd}|dtjd}ndtjkr8tjd}
ndtjkr_|
dtjd}n|
d|}|d|}|jd |d!|d"|d|d#|d$|d%|d&||	|_nd'S((sDo 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.
    tunixtCCtCXXtOPTtCFLAGStEXTRA_CFLAGSt
BASECFLAGStCCSHAREDtLDSHAREDtSOtARtARFLAGStdarwinsgcc-4.2i(tlog(tPopentPIPEs&! type gcc-4.2 && type clang && exit 2tshelltstdouttstderris&gcc-4.2 not found, using clang insteadtclangtCPPs -EtLDFLAGSt css!|]}|rt|VqdS(N(tstr(t.0tx((s)/usr/lib/python2.7/distutils/sysconfig.pys	<genexpr>scss!|]}|rt|VqdS(N(RI(RJRK((s)/usr/lib/python2.7/distutils/sysconfig.pys	<genexpr>stCPPFLAGStpreprocessortcompilertcompiler_sotcompiler_cxxt	linker_sot
linker_exetarchiverN(t
compiler_typetget_config_varsRRR,R
tplatformt
_USE_CLANGt	distutilsR?t
subprocessR@RAR	twaitt
returncodetwarnR
t
startswithtlenRtset_executablestshared_lib_extension(RNtcctcxxtopttcflagstextra_cflagst
basecflagstccsharedtldsharedtso_exttartar_flagstnewccR?R@RAtptcppRStcc_cmd((s)/usr/lib/python2.7/distutils/sysconfig.pytcustomize_compilers|*	
		
",	cCsvtr6tjdkr-tjjtd}qEt}ntdd}tdkr]d}nd}tjj||S(s2Return full pathname of installed pyconfig.h file.RtPCR"is2.2sconfig.hs
pyconfig.h(RRRRRRR&R(R%tconfig_h((s)/usr/lib/python2.7/distutils/sysconfig.pytget_config_h_filenames		cCsftr(tjjtjjtjdStdddd}tjj|dtjr[dp^ddS(sAReturn full pathname of installed Makefile from the Python build.tMakefileR"iR.tconfigRR(	RRRRRR
RR1R!(tlib_dir((s)/usr/lib/python2.7/distutils/sysconfig.pytget_makefile_filenames"cCs|dkri}ntjd}tjd}x|j}|sLPn|j|}|r|jdd\}}yt|}Wntk
rnX|||<q6|j|}|r6d||jd<q6q6|S(sParse 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)/usr/lib/python2.7/distutils/sysconfig.pytparse_config_hs(	

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_]*)}cCsddlm}||dddddd}|dkrCi}ni}i}x|j}|dkrnPntj|}|rR|jdd\}}	|	j}	|	jdd	}
d
|
kr|	||<qyt	|	}	Wn't
k
r|	jdd
||<qX|	||<qRqRt|j}d}x/t
|dkrext|D]}
||
}tj|ptj|}|dk	rG|jd}t}||krt||}n||krt}n|tjkrtj|}nr||kr\|
jdr,|
d|kr,d	}qjd||krEt}qjt|d|}nd	||<}|r^||j}||j ||}d
|kr|||
<qDyt	|}Wn!t
k
r|j||
<nX|||
<|j|
|
jdrD|
d|krD|
d}
|
|krA|||
<qAqDq^qV|||
<|j|
qVWq7Wx<|jD].\}}	t|	trs|	j||<qsqsW|j||S(sParse 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_linesis$$Rt$R6RGRLitPY_iN(sCFLAGSsLDFLAGSsCPPFLAGS(tdistutils.text_fileRRRzt_variable_rxR{R|tstriptreplaceR}R~tlisttkeysR^ttuplet_findvar1_rxtsearcht_findvar2_rxR	RIR
RR,R]tendtstarttremovetitemst
isinstancetupdate(RRRRtdonetnotdoneRRRRttmpvt	variablestrenamed_variablesRtvaluetfoundtitemtaftertk((s)/usr/lib/python2.7/distutils/sysconfig.pytparse_makefile's	


			






cCsoxhtj|ptj|}|rg|j\}}|d|!|j|jd||}qPq|S(sExpand 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(RRRtspantgetR|(tstvarsRtbegR((s)/usr/lib/python2.7/distutils/sysconfig.pytexpand_makefile_varss.c
Csi}yt}t||WnLtk
rn}d|}t|dr_|d|j}nt|nXy t}tt||WnLtk
r}d|}t|dr|d|j}nt|nXt	r|d|d<nt
dkrtjdkrpt
dd	}tjj|d
d}tjj|d
d}d
||d|f|d<qtjdkrt
dd	}tj|dd}tjj|}tjj|d
|}	d|	tt
f|d<qn|adS(s7Initialize the module as appropriate for POSIX systems.s.invalid Python installation: unable to open %ststrerrors (%s)t	BLDSHAREDR:s2.1taix4R.iRut	ld_so_aixs
python.exps%s %s -bI:%sR3tbeosis%s -L%s/lib -lpython%sN(RwRtIOErrorthasattrRRRsRtfileRRR
RVR1RRRtstringtsplittbasenameRt_config_vars(
Rtfilenametmsgtmy_msgt
python_libRt
python_exptlinkerscript_pathtlinkerscript_nametlinkerscript((s)/usr/lib/python2.7/distutils/sysconfig.pyt_init_posixsD	
	
	cCsi}tdddd|d<tdddd|d<tdd|d<d|d	<d
|d<tjdd
|d<tjjtjjtj	|d<|a
dS(s+Initialize the module as appropriate for NTR"iR.itLIBDESTt
BINLIBDESTt	INCLUDEPYs.pydR;s.exetEXEt.RtVERSIONtBINDIRN(R1R&RRRRRRR
RR(R((s)/usr/lib/python2.7/distutils/sysconfig.pyt_init_nts

%cCsii}tdddd|d<tdddd|d<tdd|d<d|d	<d
|d<|adS(
s-Initialize the module as appropriate for OS/2R"iR.iRRRs.pydR;s.exeRN(R1R&R(R((s)/usr/lib/python2.7/distutils/sysconfig.pyt	_init_os2s

cGstdkrtjdtj}|r5|niattd<ttd<tj	dkrtj
d}t|jdd}|dkrx9dD]D}t|}t
jdd|}t
jdd|}|t|<qWqdtjkrLtjd}xHdD]=}t|}t
jdd|}|d|}|t|<qWnt
jdtd}|dk	r|jd}tjj|sx:dD]/}t|}t
jdd|}|t|<qWqqqn|rg}	x$|D]}
|	jtj|
qW|	StSdS(sWith 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_R#texec_prefixR>iRiiRGR8R:R6t	PY_CFLAGSRs
-arch\s+\w+\sRHs-isysroot [^ 	]*t	ARCHFLAGSs-isysroot\s+(\S+)is-isysroot\s+\S+(\s|$)N(sLDFLAGSs
BASECFLAGSsLDSHAREDsCFLAGSs	PY_CFLAGSs	BLDSHARED(sLDFLAGSs
BASECFLAGSsLDSHAREDsCFLAGSs	PY_CFLAGSs	BLDSHARED(sLDFLAGSs
BASECFLAGSsLDSHAREDsCFLAGSs	PY_CFLAGSs	BLDSHARED(RRtglobalsRRRRRR
RVtunameR}RRxtsubR,RR|Rtexiststappend(targstfunctkernel_versiont
major_versiontkeytflagstarchRtsdktvalsR((s)/usr/lib/python2.7/distutils/sysconfig.pyRUsP











cCstj|S(sReturn the value of a single variable using the dictionary
    returned by 'get_config_vars()'.  Equivalent to
    get_config_vars().get(name)
    (RUR(R((s)/usr/lib/python2.7/distutils/sysconfig.pyR ts(-t__doc__t__revision__RRxRR
tdistutils.errorsRRR+R#RRRRRRRRtlowerRtpardirRRRRR&R1RWRpRsRwRRyRRRRRRRRRRUR (((s)/usr/lib/python2.7/distutils/sysconfig.pyt<module>
sL!%*%%			&0	V		q		@			]