,bc@sdZdZddlZddlZddlZddlZddlZddlmZej j ej Z ej j ej Zej jej jejZejdkrdedjkrej jej jeej jZnejdkrJded jkrJej jej jeej jej jZnejdkrd ed jkrej jej jeej jej jZnd ejkrej j ejd Znd ZeZdZdddZddddZdZdZdZ ddZ!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: s$Id$iN(tDistutilsPlatformErrortnttpcbuildis\pc\vis\pcbuild\amd64it_PYTHON_PROJECT_BASEcCs=x6dD].}tjjtjjtd|rtSqWtS(Ns Setup.dists Setup.localtModules(s Setup.dists Setup.local(tostpathtisfiletjoint project_basetTruetFalse(tfn((s)/usr/lib/python2.7/distutils/sysconfig.pyt _python_build3s $cCs tjd 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_version;sicCs-tjdkrtrytjjtj}|r9|}n<tjjtjj|t d}tjj|d}|S|d k rtjj|ddt tj rdpdS|rt dSt d SnWtjd krtjj|dStjd krtjj|dSt d tjd S(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_dtt CONFINCLUDEPYt INCLUDEPYRtos2sFI don't know where Python installs its C header files on platform '%s'N(Rtnamet python_buildRtdirnameRt executabletabspathRtget_config_vartNoneRtpydebugR(t plat_specifictprefixtbuildirtinc_dirR((s)/usr/lib/python2.7/distutils/sysconfig.pytget_python_incCs,   !  cCsq| ptjj|dk}|dkr@|r7tp:t}ntjdkrtjj|ddt}|rx|S|rdtj krdt j krtjj|dStjj|d Sntjd kr|rtjj|d Std kr|Stjj|d d SnTtjd krZ|rAtjj|d Stjj|d d 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/localRtlibRtPYTHONUSERBASEt real_prefixs dist-packagess site-packagesRtLibs2.2Rs?I don't know where Python installs its library on platform '%s'N(s/usrs /usr/local( RRtnormpathR!t EXEC_PREFIXtPREFIXRRRtenvironRt__dict__R(R#t standard_libR$tis_default_prefixt libpython((s)/usr/lib/python2.7/distutils/sysconfig.pytget_python_libns0  $cCs0|jdkr,tjdkrStdsSddl}|jtdtdscss!|]}|rt|VqdS(N(RI(RJRK((s)/usr/lib/python2.7/distutils/sysconfig.pys scss!|]}|rt|VqdS(N(RI(RJRK((s)/usr/lib/python2.7/distutils/sysconfig.pys stCPPFLAGSt preprocessortcompilert compiler_sot compiler_cxxt linker_sot linker_exetarchiver(t compiler_typeRtplatformR t _osx_supporttcustomize_compilert _config_varstget_config_varsRR/t startswithtlentfnmatchtfiltertreplaceRtset_executablestshared_lib_extension(RNRVtcctcxxtopttcflagst extra_cflagst basecflagstccsharedtldsharedtso_exttartar_flagstconfigure_cppflagstconfigure_cflagstconfigure_ldflagstnewcctcppRStcc_cmd((s)/usr/lib/python2.7/distutils/sysconfig.pyRWs   9   ",% cCsvtr6tjdkr-tjjtd}qEt}ntdd}tdkr]d}nd}tjj||S(s2Return full pathname of installed pyconfig.h file.RtPCR#is2.2sconfig.hs pyconfig.h(RRRRRR R'R(R&tconfig_h((s)/usr/lib/python2.7/distutils/sysconfig.pytget_config_h_filenames  cCsGtrtjjtdStdddd}tjjtddS(sAReturn full pathname of installed Makefile from the Python build.tMakefileR#iR1tLIBPL(RRRRR R4R (tlib_dir((s)/usr/lib/python2.7/distutils/sysconfig.pytget_makefile_filenamescCs|dkri}ntjd}tjd}x|j}|sLPn|j|}|r|jdd\}}yt|}Wntk rnX||| sP     !%*%%   +2 ^    q    &