tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
[\¬Qc@sdZdZddlZddlZddlZddlmZmZmZm    Z    m
Z
ddl m Z m Z ddlmZdZy@ddlZdZeZejZejZejZejZWn~ek
rDyLddlZddlZdZeZejZejZejZejZWnek
r@ejd    ƒnXnXerlejej ej!ej"fZ#nd
„Z$d „Z%d „Z&d fd„ƒYZ'd„Z(d„Z)d„Z*de fd„ƒYZ+e(ƒdkrej,dƒe+Z-ddl.m+Z+ddl.m'Z'ndS(s‚distutils.msvccompiler
 
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
s$Id$iÿÿÿÿN(tDistutilsExecErrortDistutilsPlatformErrort CompileErrortLibErrort    LinkError(t    CCompilertgen_lib_options(tlogiisŽWarning: Can't read registry to find the necessary compiler setting
Make sure that Python modules _winreg, win32api or win32con are installed.cCs}yt||ƒ}Wntk
r'dSXg}d}xByt||ƒ}Wntk
r^PnX|j|ƒ|d}q7|S(sReturn list of registry keys.iiN(t RegOpenKeyExtRegErrortNonet
RegEnumKeytappend(tbasetkeythandletLtitk((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyt    read_keys;s    cCs›yt||ƒ}Wntk
r'dSXi}d}x`yt||ƒ\}}}Wntk
rgPnX|jƒ}t|ƒ|t|ƒ<|d}q7|S(sXReturn dict of registry keys and values.
 
    All names are converted to lowercase.
    iiN(RR    R
t RegEnumValuetlowert convert_mbcs(R RRtdRtnametvaluettype((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyt read_valuesMs    cCsIt|ddƒ}|dk    rEy|dƒ}WqEtk
rAqEXn|S(Ntencodetmbcs(tgetattrR
t UnicodeError(tstenc((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyRbs  t MacroExpandercBs,eZd„Zd„Zd„Zd„ZRS(cCsi|_|j|ƒdS(N(tmacrost load_macros(tselftversion((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyt__init__ms    cCsCx<tD]4}t||ƒ}|r|||jd|<PqqWdS(Ns$(%s)(tHKEYSRR#(R%tmacrotpathRR R((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyt    set_macroqs
 c    Cs%d|}|jd|ddƒ|jd|ddƒd}|jd|d    ƒy9|d
krv|jd |d ƒn|jd |d ƒWntk
r¦td‚nXd}xqtD]i}yt||ƒ}Wntk
rãq´nXt|dƒ}t|d||fƒ}|d|jd<q´WdS(Ns%Software\Microsoft\VisualStudio\%0.1ft VCInstallDirs    \Setup\VCt
productdirt VSInstallDirs    \Setup\VSs Software\Microsoft\.NETFrameworkt FrameworkDirt installrootg@tFrameworkSDKDirssdkinstallrootv1.1tsdkinstallrootsPython was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.s.Software\Microsoft\NET Framework Setup\Productis%s\%sR&s$(FrameworkVersion)(    R+tKeyErrorRR(RR    R RR#(    R%R&tvsbasetnettpR thRR((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyR$xs*
 
  cCs9x2|jjƒD]!\}}tj|||ƒ}qW|S(N(R#titemststringtreplace(R%R Rtv((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pytsub”s(t__name__t
__module__R'R+R$R<(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyR"ks            cCs²d}tjtj|ƒ}|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(R9tfindtsysR&tlentsplittintR
(tprefixRR trestt majorVersiont minorVersion((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pytget_build_version™s       cCs[d}tjtj|ƒ}|dkr+dStjtjd|ƒ}tj|t|ƒ|!S(saReturn the processor architecture.
 
    Possible results are "Intel", "Itanium", or "AMD64".
    s bit (iÿÿÿÿtIntelt)(R9R@RAR&RB(RERtj((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pytget_build_architecture°s  cCsIg}x<|D]4}tjj|ƒ}||kr |j|ƒq q W|S(snReturn a list of normalized paths with duplicates removed.
 
    The current order of paths is maintained.
    (tosR*tnormpathR (tpathst reduced_pathsR6tnp((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pytnormalize_and_reduce_paths½s   t MSVCCompilerc BsDeZdZdZiZdgZdddgZdgZdgZeeeeZ    dZ
d    Z d
Z d Z d ZZd Zdddd„Zd„Zddd„Zdddddddd„Zdddd„Zddddddddddd„
Zd„Zd„Zd„Zdd„Zd„Zdd„Zd„ZRS(swConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.tmsvcs.cs.ccs.cpps.cxxs.rcs.mcs.ress.objs.libs.dlls%s%ss.exeicCs§tj||||ƒtƒ|_tƒ|_|jdkr†|jdkrjd|_t|jƒ|_n    d|_d|j|_    nd|jd|_    t
|_ dS(NRJisSoftware\Microsoft\VisualStudiosSoftware\Microsoft\DevstudiosVisual Studio version %ssMicrosoft SDK compiler %si( RR'RIt_MSVCCompiler__versionRMt_MSVCCompiler__archt_MSVCCompiler__rootR"t_MSVCCompiler__macrost_MSVCCompiler__producttFalset initialized(R%tverbosetdry_runtforce((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyR'ês          c    Cs…g|_dtjkrfdtjkrf|jdƒrfd|_d|_d|_d|_d|_n®|j    dƒ|_t
|jƒd    kr t d
|j ‚n|jdƒ|_|jdƒ|_|jdƒ|_|jdƒ|_|jdƒ|_|j d ƒ|j d ƒy8x1tjtjdd ƒD]}|jj|ƒq1WWntk
r_nXt|jƒ|_tj|jd ƒtjd<d|_|jdkrâddddddg|_dddddddg|_n9ddddddg|_dddddddg|_dddg|_|jdkrTddddg|_ndddddg|_dg|_t|_dS( NtDISTUTILS_USE_SDKtMSSdkscl.exeslink.exeslib.exesrc.exesmc.exeR*isxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.tlibtincludet;RJs/nologos/Oxs/MDs/W3s/GXs/DNDEBUGs/Ods/MDds/Z7s/D_DEBUGs/GS-s/DLLs/INCREMENTAL:NOis/INCREMENTAL:nos/DEBUGs    /pdb:None(t_MSVCCompiler__pathsRNtenvirontfind_exetcctlinkerRbtrctmctget_msvc_pathsRBRRZtset_path_env_varR9RCR R3RStjoinR
tpreprocess_optionsRWtcompile_optionstcompile_options_debugtldflags_sharedRVtldflags_shared_debugtldflags_statictTrueR\(R%R6((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyt
initializeüsT    -                             tcCs>|dkrd}ng}x|D]}tjj|ƒ\}}tjj|ƒd}|tjj|ƒ}||jkrŽtd|ƒ‚n|r©tjj|ƒ}n||j    krÞ|j
tjj |||j ƒƒq"||j kr|j
tjj |||j ƒƒq"|j
tjj |||jƒƒq"W|S(NRwisDon't know how to compile %s(R
RNR*tsplitextt
splitdrivetisabstsrc_extensionsRtbasenamet_rc_extensionsR Rnt res_extensiont_mc_extensionst obj_extension(R%tsource_filenamest    strip_dirt
output_dirt    obj_namestsrc_nameR text((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pytobject_filenames<s(     c    CsÙ|js|jƒn|j||||||ƒ\}}    }}
} |pLg} | jdƒ|ru| j|jƒn| j|jƒxM|    D]E} y| | \}}Wntk
r¼qŒnX|rØtj    j
|ƒ}n||j krôd|}n‡||j krd|}nk||j kr}|}d| }y)|j|jg|
|g|gƒWqŒtk
rv}t|‚qŒXqŒnþ||jkretj    j|ƒ}tj    j| ƒ}y|j|jgd|d|g|gƒtj    jtj    j|ƒƒ\}}tj    j||dƒ}|j|jgd| g|gƒWqŒtk
r^}t|‚qŒXqŒntd|| fƒ‚d    | }y-|j|jg| |
||g|ƒWqŒtk
rÐ}t|‚qŒXqŒW|    S(
Ns/cs/Tcs/Tps/fos-hs-rs.rcs"Don't know how to compile %s to %ss/Fo(R\Rvt_setup_compileR textendRqRpR3RNR*tabspatht _c_extensionst_cpp_extensionsR}tspawnRjRRRtdirnameRkRxR|RnRh(R%tsourcesRƒR#t include_dirstdebugt extra_preargstextra_postargstdependstobjectstpp_optstbuildt compile_optstobjtsrcR†t    input_optt
output_opttmsgth_dirtrc_dirR t_trc_file((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pytcompile]sj           
# $$# 
 c    CsÀ|js|jƒn|j||ƒ\}}|j|d|ƒ}|j||ƒr¬|d|g}|rony|j|jg|ƒWq¼tk
r¨}t|‚q¼Xnt    j
d|ƒdS(NRƒs/OUT:sskipping %s (up-to-date)( R\Rvt_fix_object_argstlibrary_filenamet
_need_linkRRbRRRR‘(    R%R•toutput_libnameRƒR‘t target_langtoutput_filenametlib_argsR((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pytcreate_static_lib¶s     cCsW|js|jƒn|j||ƒ\}}|j|||ƒ\}}}|rl|jdt|ƒƒnt||||ƒ}|dk    r¥tj    j
||ƒ}n|j ||ƒrC|t j krì|    rÜ|jd}q|jd}n|    rþ|j}n    |j}g}x%|pgD]}|jd|ƒqW||||d|g}|dk    rÄtj    jtj    j|ƒƒ\}}tj    j
tj    j|dƒ|j|ƒƒ}|jd|ƒn|
r×|
|d*n| rí|j| ƒn|jtj    j|ƒƒy|j|jg|ƒWqStk
r?}t|‚qSXntjd|ƒdS(Ns5I don't know what to do with 'runtime_library_dirs': is/EXPORT:s/OUT:is/IMPLIB:sskipping %s (up-to-date)(R\RvR£t _fix_lib_argstwarntstrRR
RNR*RnR¥Rt
EXECUTABLERsRrR RxR|RŽR¤R‰tmkpathRRiRRRR‘(R%t target_descR•R¨Rƒt    librariest library_dirstruntime_library_dirstexport_symbolsR‘R’R“t
build_tempR§tlib_optstldflagst export_optstsymtld_argstdll_nametdll_extt implib_fileR((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pytlinkÐsR                             cCsd|S(Ns    /LIBPATH:((R%tdir((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pytlibrary_dir_option$scCs td‚dS(Ns<don't know how to set runtime library search path for MSVC++(R(R%R¿((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pytruntime_library_dir_option'scCs |j|ƒS(N(R¤(R%Rb((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pytlibrary_option+scCs€|r|d|g}n    |g}xW|D]K}xB|D]:}tjj||j|ƒƒ}tjj|ƒr6|Sq6Wq)WdSdS(Nt_d(RNR*RnR¤texistsR
(R%tdirsRbR‘t    try_namesR¿Rtlibfile((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pytfind_library_file/s       cCsªxH|jD]=}tjjtjj|ƒ|ƒ}tjj|ƒr
|Sq
WxXtjtjddƒD]=}tjjtjj|ƒ|ƒ}tjj|ƒre|SqeW|S(sŒReturn path to an MSVC executable program.
 
        Tries to find the program in several places: first, one of the
        MSVC program search paths from the registry; next, the directories
        in the PATH environment variable.  If any of those work, return an
        absolute path that is known to exist.  If none of them work, just
        return the original program name, 'exe'.
        tPathRd(    ReRNR*RnRŠtisfileR9RCRf(R%texeR6tfn((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyRgCs
! !tx86cCsts
gS|d}|jdkr<d|j|jf}nd|j|f}xitD]a}t||ƒ}|rV|jdkr tj|jj||ƒdƒStj||dƒSqVqVW|jdkr x>tD]3}t|d|jƒd    k    rÑ|j
dƒPqÑqÑWngS(
sÐGet a list of devstudio directories (include, lib or path).
 
        Return a list of strings.  The list will be empty if unable to
        access the registry or appropriate registry keys not found.
        s dirsis6%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directoriess?%s\6.0\Build System\Components\Platforms\Win32 (%s)\DirectoriesRdis%s\6.0s´It seems you have Visual Studio 6 installed, but the expected registry settings are not present.
You must at least run the Visual Studio GUI once so that these entries are created.N( t _can_read_regRVRXR(RR9RCRYR<R
R¬(R%R*tplatformRR R((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyRlZs(
     cCsS|dkr|jdƒ}n|j|ƒ}|rOtj|dƒtj|<ndS(s¡Set environment variable 'name' to an MSVC path type value.
 
        This is equivalent to a SET command prior to execution of spawned
        commands.
        RbtlibraryRdN(RlR9RnRNRf(R%RR6((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyRms
 N(R=R>t__doc__t compiler_typet executablesR‹RŒR}RR{R~R€tstatic_lib_extensiontshared_lib_extensiontstatic_lib_formattshared_lib_formatt exe_extensionR'RvR‡R
R¢RªR¾RÀRÁRÂRÈRgRlRm(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyRTÌsP            
    B  Z  G                  %g @s3Importing new compiler from distutils.msvc9compiler(RT(R"(/RÑt __revision__RARNR9tdistutils.errorsRRRRRtdistutils.ccompilerRRt    distutilsRRÎt_winregthkey_modt    OpenKeyExRtEnumKeyR t    EnumValueRterrorR    t ImportErrortwin32apitwin32continfot
HKEY_USERStHKEY_CURRENT_USERtHKEY_LOCAL_MACHINEtHKEY_CLASSES_ROOTR(RRRR"RIRMRSRTR‘tOldMSVCCompilertdistutils.msvc9compiler(((s^/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/distutils/msvccompiler.pyt<module>s`   (                                                .            ÿÃ