m &UIc@sdZdZdkZdkZdkZdkZdklZeii ei Z eii ei Z eiieiieiZeiieddZeiieZ[[dZdddZdddd Zd Zd Zd Zdd ZeidZeidZ eidZ!ddZ"dZ#da$dZ%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: sysconfig.py 52231 2006-10-08 17:41:25Z ronald.oussoren $N(sDistutilsPlatformErrortModulestSetupcCs tid 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'. iN(tsystversion(((t0/data/zmath/lib/python2.4/distutils/sysconfig.pytget_python_version%sicCs|d jo|otpt}ntidjototii tii t i }|o |}nNtii|d}tii|p%tiitii |d}n|Sntii|ddt id Sntidjotii|dSntidjo8|otii|ddSqtii|dSn;tid jotii|dSntd tid 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'. tposixtIncludetincludetpythonitnttmactMactos2sFI don't know where Python installs its C header files on platform '%s'N(tprefixtNonet plat_specifict EXEC_PREFIXtPREFIXtostnamet python_buildtpathtdirnametabspathRt executabletbasetinc_dirtjointexistsRtDistutilsPlatformError(RRRR((Rtget_python_inc-s,  ! %%cCs|d jo|otpt}ntidjoEtii|ddt }|o|Sqtii|dSnFtidjoP|otii|dSqt i djo|SqtiitddSntidjoz|o;|otii|dd Sq`tii|ddSq|otii|dSqtii|ddSn\tid jo8|otiitdSqtiitddSntd tid 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'. RtlibR s site-packagesR tLibs2.2R s lib-dynloadR s?I don't know where Python installs its library on platform '%s'N(RRRRRRRRRRt libpythont standard_libRRR(RR#RR"((Rtget_python_libTs8   c Cs|idjotddddddd\}}}}} }}t i i dot i d}nt i i dot i d}nt i i dot i d}nt i i d ot i d }n |d }t i i d o|d t i d }n|o|d |}nt i i d o.|d t i d }|d t i d }nt i i doC|d t i d}|d t i d}|d t i d}n|d |}|id|d|d|d | d|d|d|||_ndS(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. tunixtCCtCXXtOPTt BASECFLAGStCCSHAREDtLDSHAREDtSOtCPPs -EtLDFLAGSt tCFLAGStCPPFLAGSt preprocessortcompilert compiler_sot compiler_cxxt linker_sot linker_exeN(R3t compiler_typetget_config_varstcctcxxtoptt basecflagstccsharedtldsharedtso_extRtenvironthas_keytcpptcc_cmdtset_executablestshared_lib_extension( R3R<RDR=R:R;RCR?R@R>((Rtcustomize_compilers>3   cCsVto ti}ntdd}tidjo d}nd}tii ||S(s2Return full pathname of installed pyconfig.h file.Ris2.2sconfig.hs pyconfig.hN( RRtcurdirRRRRtconfig_hRR(RRI((Rtget_config_h_filenames  cCsXto&tiitiitidSntdddd}tii|ddS(sAReturn full pathname of installed Makefile from the Python build.tMakefileRiR#tconfigN( RRRRRRRR$tlib_dir(RM((Rtget_makefile_filenames &cCs|djo h}ntid}tid}x|i}|pPn|i |}|oL|i dd\}}yt|}Wntj onX|||     ! ': ,    L  D    2