Uc@sddlZddlZddlZddlZddlmZddlTddlmZddlm Z m Z m Z ddl m Z ddlmZddlmZdd lmZdd lmZmZmZmZmZddl ZejjZd Zd Zdd Z ee!de dddZ"ee!de"ddddddddZ#ee!de#dHdZ$ee!de$dZ%dZ&ee!de&ddZ'ee!de'ddddZ(e)dgdZ*ee!de*d Z+ee!d!e+dIe,d%gD]?Z4ej5j6d?e4d@Z7e7dk re8e7dAe2qqWe9Z:dBZ9e9e_9ddlZddl;Z;ej<dCe;j=Z>ej<dDZ?ej<dEZ@ej<dFZAdGZBeBe_BedS(SiN(tcopy(t*(t ccompiler(tDistutilsExecErrortDistutilsModuleErrortDistutilsPlatformError(tcustomize_compiler(t LooseVersion(tlog(t exec_command(t cyg2win32t is_sequencetmingw32t quote_argst msvc_on_amd64cCstdtjjdMingw32 port of GNU C Compiler for Win32(for MSC built Python)R s+Setting mingw32 as default compiler for nt.tnttsunos5t sunccompilertSunCCompiler32s!Sun Studio C Compiler for solaristsun32s.Setting sunos as default compiler for solaris.tlinuxc Cs|dkrtj}ny2|dkr6t|}nt|\}}}WnAtk rd|}|dk r|d|}nt|nXd|}yt|Wndtk r }t j dt ||d}yt|Wq tk r}t d|q XnXy!t j|} t| |} Wn(tk rXt dd||fnX| d||}t jd | |S( Ns5don't know how to compile C/C++ code on platform '%s's with '%s' compilersnumpy.distutils.s,%s in numpy.distutils; trying from distutilsis4can't compile C/C++ code: unable to load module '%s's4can't compile C/C++ code: unable to find class '%s' sin module '%s'snew_compiler returns %s(RR-R|tget_default_compilertcompiler_classtKeyErrorRt __import__t ImportErrorRR"tstrRRtmodulestvarsRZ( tplatRtverbosetdry_runRt module_namet class_nametlong_descriptionR*tmoduleR((s=/usr/lib/python2.7/site-packages/numpy/distutils/ccompiler.pyt new_compiler sD             cCswt|}t|}t||||}g}x=|D]5}t|rb|jt|q:|j|q:W|S(N(R t_distutils_gen_lib_optionsR textendR!R:(RRptruntime_library_dirsRotrtlib_optsRB((s=/usr/lib/python2.7/site-packages/numpy/distutils/ccompiler.pytgen_lib_options5s      Rtbcpptcygwinctemxctunixcs distutils.RRcCst|}t||S(N(R t!_distutils_gen_preprocess_options(RXRY((s=/usr/lib/python2.7/site-packages/numpy/distutils/ccompiler.pytgen_preprocess_optionsLs s [^\\\'\"%s ]*s'(?:[^'\\]|\\.)*'s"(?:[^"\\]|\\.)*"s\scCstj|}g}d}x|rtj||}|j}|t|kri|j|| Pn||tjkr|j|| tj||}d}n"||dkr|| ||d}|d}n||dkrt j||}n6||dkr&t j||}nt d|||dkrWt d||n|j\}}tj||d|d!r|| ||d|d!||}|jd}n |j}|t|kr|j|PqqW|S( Nis\it't"s!this can't happen (bad char '%c')s"bad string (mismatched %s quotes?)i(tstringtstript _wordchars_reRRRR:t whitespacetlstript _squote_ret _dquote_ret RuntimeErrorRRtspant _has_white_reR$(R(twordsRRRtbeg((s=/usr/lib/python2.7/site-packages/numpy/distutils/ccompiler.pyt split_quoted\sD     %  ((sintelccompilersIntelCCompilers(Intel C Compiler for 32-bit applications(sintelccompilersIntelItaniumCCompilers7Intel C Itanium Compiler for Itanium-based applications(slinux.*sintel(slinux.*sintele(smingw32ccompilersMingw32CCompilers>Mingw32 port of GNU C Compiler for Win32(for MSC built Python)(sntsmingw32((sntsmingw32(s sunccompilersSunCCompiler32s!Sun Studio C Compiler for solaris(slinuxssun32((slinuxssun32(CR#R-RRRtdistutils.ccompilerRRtdistutils.errorsRRRtdistutils.sysconfigRtdistutils.versionRtnumpy.distutilsRtnumpy.distutils.exec_commandR tnumpy.distutils.misc_utilR R R R RRt _init_posixRRRRR+t CCompilerRERhRRRRRtFalseRRRt_default_compilersRR"Rt_distutils_new_compilerRRt_ccRtgett_mRRRRRiRRRRRR(((s=/usr/lib/python2.7/site-packages/numpy/distutils/ccompiler.pyts     (     '. Q )  # =,5         %        1