ó áű˛_c@s¤ddlZddlZejdkrEd„Zd„Zd„Znejdkr`d„Znejdkršejd kršdd lmZ d „Znçejdkrddl Z ddl Z ddl Z d „Z ejd krńd„Zn d„Zejjdƒs0ejjdƒs0ejjdƒrEd„Zd„Zqejd krld„Zed„Zqd„Zd„Znd„Zedkr eƒndS(i˙˙˙˙NtntcCsŻd}tjj|ƒ}|dkr(dS|t|ƒ}tj|jddƒ\}}t|d ƒd}t|dd!ƒd }|dkr—d }n|dkrŤ||Sd S( sĎReturn the version of MSVC that was used to build Python. For Python 2.3 and up, the version number is included in sys.version. For earlier versions, assume the compiler is MSVC 6. sMSC v.i˙˙˙˙it iiţ˙˙˙iig$@iN(tsystversiontfindtlentsplittinttNone(tprefixtitstrestt majorVersiont minorVersion((s#/usr/lib64/python2.7/ctypes/util.pyt_get_build_version s    cCswtƒ}|dkrdS|dkr.d}nd|d}ddl}|jƒdddkro|d 7}n|d S( s%Return the name of the VC runtime dllitmsvcrtsmsvcr%di i˙˙˙˙Nis_d.pydtds.dll(RRtimpt get_suffixes(RtclibnameR((s#/usr/lib64/python2.7/ctypes/util.pyt find_msvcrt s      cCsĄ|dkrtƒSx‡tjdjtjƒD]l}tjj||ƒ}tjj|ƒr^|S|jƒj dƒryq-n|d}tjj|ƒr-|Sq-WdS(NtctmtPATHs.dll(RR( RtostenvironRtpathseptpathtjointisfiletlowertendswithR(tnamet directorytfname((s#/usr/lib64/python2.7/ctypes/util.pyt find_library1s   tcecCs|S(N((R!((s#/usr/lib64/python2.7/ctypes/util.pyR$Gstposixtdarwin(t dyld_findcCs[d|d|d||fg}x3|D]+}yt|ƒSWq(tk rRq(q(Xq(WdS(Ns lib%s.dylibs%s.dylibs%s.framework/%s(t _dyld_findt ValueErrorR(R!tpossible((s#/usr/lib64/python2.7/ctypes/util.pyR$Ls   c Csűdtj|ƒ}tjƒ\}}tj|ƒd|d|}z3tj|ƒ}z|jƒ}Wd|jƒ}XWdytj|ƒWn+t k r¸}|j t j krš‚qšnXX|dkrŇt d‚ntj ||ƒ} | sîdS| jdƒS(Ns[^\(\)\s]*lib%s\.[^\(\)\s]*srif type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit 10; fi;$CC -Wl,-t -o s 2>&1 -li sgcc or cc command not foundi(tretescapettempfiletmkstempRtclosetpopentreadtunlinktOSErrorterrnotENOENTtsearchRtgroup( R!texprtfdouttccouttcmdtfttracetrvtetres((s#/usr/lib64/python2.7/ctypes/util.pyt _findLib_gcc[s(    tsunos5cCsj|s dSd|}tj|ƒ}z|jƒ}Wd|jƒXtjd|ƒ}|s]dS|jdƒS(Ns#/usr/ccs/bin/dump -Lpv 2>/dev/null s\[.*\]\sSONAME\s+([^\s]+)i(RRR1R2R0R,R7R8(R=R<tdataRA((s#/usr/lib64/python2.7/ctypes/util.pyt _get_sonamews  cCs­|s dSd|}tj|ƒ}|jƒ}|jƒ}|dkrWtjj|ƒStj|ƒ}z|jƒ}Wd|jƒXtjd|ƒ}|s dS|j dƒS(NsWif ! type objdump >/dev/null 2>&1; then exit 10; fi;objdump -p -j .dynamic 2>/dev/null i s\sSONAME\s+([^\s]+)i( RRR1R2R0RtbasenameR,R7R8(R=R<tdumpR?RDRA((s#/usr/lib64/python2.7/ctypes/util.pyRE…s"    tfreebsdtopenbsdt dragonflycCsf|jdƒ}g}y-x&|r@|jdt|jƒƒƒqWWntk rUnX|petjgS(Nt.i(RtinsertRtpopR*Rtmaxint(tlibnametpartstnums((s#/usr/lib64/python2.7/ctypes/util.pyt _num_version s $ cCstj|ƒ}d||f}tjdƒ}z|jƒ}Wd|jƒXtj||ƒ}|sttt|ƒƒS|j dd„ƒ|dS(Ns:-l%s\.\S+ => \S*/(lib%s\.\S+)s/sbin/ldconfig -r 2>/dev/nulltcmpcSstt|ƒt|ƒƒS(N(RSRR(txty((s#/usr/lib64/python2.7/ctypes/util.pytśsi˙˙˙˙( R,R-RR1R2R0tfindallRERBtsort(R!tenameR9R=RDRA((s#/usr/lib64/python2.7/ctypes/util.pyR$Ťs cCsĐtjjdƒsdS|r%d}nd}xKtj|ƒjƒD]4}|jƒ}|jdƒrA|jƒd}qAqAW|sƒdSxF|jdƒD]5}tjj |d|ƒ}tjj|ƒr“|Sq“WdS(Ns /usr/bin/crles*env LC_ALL=C /usr/bin/crle -64 2>/dev/nulls&env LC_ALL=C /usr/bin/crle 2>/dev/nullsDefault Library Path (ELF):it:slib%s.so( RRtexistsRR1t readlineststript startswithRR(R!tis64R<tlinetpathstdirtlibfile((s#/usr/lib64/python2.7/ctypes/util.pyt _findLib_crleťs   cCstt||ƒpt|ƒƒS(N(RERdRB(R!R_((s#/usr/lib64/python2.7/ctypes/util.pyR$Ósc Csöddl}|jdƒdkr8tjƒdd}ntjƒdd}idd6dd 6dd 6dd 6d d 6}|j|dƒ}dtj|ƒ|f}tjdƒ}z|jƒ}Wd|j ƒXtj ||ƒ}|sédS|j dƒS(Ni˙˙˙˙tlis-32s-64s libc6,x86-64s x86_64-64s libc6,64bitsppc64-64s sparc64-64ss390x-64s libc6,IA-64sia64-64tlibc6s\s+(lib%s\.[^\s]+)\s+\(%ss/sbin/ldconfig -p 2>/dev/nulli( tstructtcalcsizeRtunametgetR,R-R1R2R0R7RR8( R!Rgtmachinetmach_maptabi_typeR9R=RDRA((s#/usr/lib64/python2.7/ctypes/util.pyt_findSoname_ldconfigŘs(   cCst|ƒptt|ƒƒS(N(RnRERB(R!((s#/usr/lib64/python2.7/ctypes/util.pyR$óscCsëddlm}tjdkrC|jGH|jdƒGHtdƒGHntjdkrçtdƒGHtdƒGHtdƒGHtjd kr˝|j d ƒGH|j d ƒGH|j d ƒGH|j d ƒGHqç|j dƒGH|j dƒGHtdƒGHndS(Ni˙˙˙˙(tcdllRRR&RRtbz2R's libm.dylibslibcrypto.dylibslibSystem.dylibsSystem.framework/Systemslibm.sos libcrypt.sotcrypt( tctypesRoRR!RtloadR$Rtplatformt LoadLibrary(Ro((s#/usr/lib64/python2.7/ctypes/util.pyttestůs"   t__main__(RRR!RRR$Rttctypes.macholib.dyldR(R)R,R.R5RBRER^RRRdtFalseRnRvt__name__(((s#/usr/lib64/python2.7/ctypes/util.pyts8     $