Ńņ \ŠKc@sdZddkZddkZddkZddkZddkZddkZddkZddkZ ddk l Z ddkl Z l Z ddklZlZlZddklZddklZddklZlZeid ƒZeid ƒZd e iifd „ƒYZd „Z d„Z!d„Z"d„Z#d„Z$d„Z%hZ&ei'djolyEddk(Z(e)e(dƒoe(i*e&d.a exists for gcc. If not, build it. # 2. Force windows to use gcc (we're struggling with MSVC and g77 support) # 3. Force windows to use g77 i’’’’N(t StrictVersion(tgen_preprocess_optionstgen_lib_options(tDistutilsExecErrort CompileErrortUnknownFileError(t UnixCCompiler(tget_build_version(tmsvc_runtime_librarytget_build_architectures\[Ordinal/Name Pointer\] Tables$^\s+\[([\s*[0-9]*)\] ([a-zA-Z0-9_]*)tMingw32CCompilercBsPeZdZdZdddd„Zddddddd„Zddd„ZRS(sH A modified MingW32 compiler compatible with an MSVC built Python. tmingw32ic Cs½tiii||||ƒ|idjo…ddk}tiddgdt dti ƒ}|i i ƒ}|i i ƒ|id|ƒ}|ot|idƒƒ|_q±n|idjo d }nd }|id jo d |_n|idjo d |_ntƒtƒd jo&|iddddddddƒnf|idjo3|idddddddd|i|fƒn#|iddddddddƒd g|_dS(Ni’’’’tgccs -dumpversiontshelltstdouts (\d+\.\d+)is2.91.57s--entry _DllMain@12ttdllwrapsg++tAMD64tcompilers/gcc -g -DDEBUG -DMS_WIN64 -mno-cygwin -O0 -Wallt compiler_sosCgcc -g -DDEBUG -DMS_WIN64 -mno-cygwin -O0 -Wall -Wstrict-prototypest linker_exesgcc -g -mno-cygwint linker_sosgcc -g -mno-cygwin -shareds3.0.0sgcc -mno-cygwin -O2 -ws0gcc -mno-cygwin -mdll -O2 -w -Wstrict-prototypessg++ -mno-cygwins%s -mno-cygwin -mdll -static %ssgcc -mno-cygwin -O2 -Walls-gcc -mno-cygwin -O2 -Wall -Wstrict-prototypessg++ -mno-cygwin -shared(t distutilstcygwinccompilertCygwinCCompilert__init__t gcc_versiontNonetret subprocesstPopentTruetPIPERtreadtclosetsearchRtgroupt linker_dlltlinkertbuild_import_libraryR tset_executablest compiler_cxx( tselftverbosetdry_runtforceRtpt out_stringtresultt entry_point((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pyR0sJ           cCs©tƒ}|o"|p g}n|i|ƒn||||||||d| | | | | f}|idjotiii}n ti}|||i i i ŒdS(Ns3.0.0( RtappendRRRRRtlinkRtim_funct func_codet co_argcount(R*t target_desctobjectstoutput_filenamet output_dirt librariest library_dirstruntime_library_dirstexport_symbolstdebugt extra_preargstextra_postargst build_tempt target_langtruntime_librarytargstfunc((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pyR3‡s0    Rc Cs9|djo d}ng}x|D] }tiitii|ƒƒ\}}tii|ƒ\}}|o|d}n||iddgjotd||f‚n|otii|ƒ}n|djp |djo+|i tii ||||i ƒƒq$|i tii |||i ƒƒq$W|S(NRis.rcs.ress"unknown file type '%s' (from '%s')( Rtostpathtsplitexttnormcaset splitdrivetsrc_extensionsRtbasenameR2tjoint obj_extension( R*tsource_filenamest strip_dirR:t obj_namestsrc_nametbasetexttdrv((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pytobject_filenames±s* $N(t__name__t __module__t__doc__t compiler_typeRRR3RW(((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pyR )s \ c Cs g}tid D]}|t|ƒq~\}}}d||f}d|GHg}|itiitidƒƒy'|itiitiddƒƒWnt j onXx;|D]3}tii||ƒ}tii |ƒo|Sq¹Wt d||fƒ‚dS(Nispython%d%d.dllsLooking for %stlibt SYSTEMROOTtsystem32s%s not found in %s( tsyst version_infotintR2RGRHRNtprefixtenvirontKeyErrortexistst ValueError( t_[1]titmajtmintmicrotdllnametlib_dirstdtdll((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pytfind_python_dllŌs7 ' cCs.tidd|gdtiƒ}|iiƒS(Ns objdump.exes-pR(RRR Rt readlines(Rotst((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pyt dump_tableės!c CsŽt|ƒ}x3tt|ƒƒD]}ti||ƒoPqqW|t|ƒjotdƒ‚ng}xqt|dt|ƒƒD]V}ti||ƒ}|o5|it|i dƒi ƒƒ|i dƒfƒq…Pq…Wt|ƒdjot i d|ƒnt |dƒ}|idtii|ƒƒ|idƒ|id ƒ|id ƒx#|D]}|id |dƒqaW|iƒd S( sŠGiven a dll file location, get all its exported symbols and dump them into the given def file. The .def file will be overwrittensSymbol table not foundiiisNo symbols found in %stwsLIBRARY %s s,;CODE PRELOAD MOVEABLE DISCARDABLE s;DATA PRELOAD SINGLE s EXPORTS s%s N(Rstrangetlent_STARTtmatchRft_TABLER2RaR$tstriptlogtwarntopentwriteRGRHRMR"( RotdfiletdumpRhtsymstjtmRnts((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pyt generate_defļs2  5   cCs\tidjodStƒ}|djotƒS|djotƒStd|ƒ‚dS(NtntRtIntelsUnhandled arch %s(RGtnameR t_build_import_library_amd64t_build_import_library_x86Rf(tarch((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pyR's   cCsątƒ}dttid ƒ}tiitid|ƒ}tii|ƒot i d|ƒdSdttid ƒ}tiitid|ƒ}t i d||fƒt ||ƒdd|d |g}t i|ƒdS( Nslibpython%d%d.aitlibss)Skip building import library: "%s" existsspython%d%d.defs4Building import library (arch=AMD64): "%s" (from %s)tdlltools-ds-l(RpttupleR_R`RGRHRNRbtisfileR{R?tinfoR…RR(tdll_filetout_nametout_filetdef_nametdef_filetcmd((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pyR‰s   c Cs½dttid ƒ}tiitid|ƒ}dttid ƒ}tiitid|ƒ}tii|ƒpti d|ƒdStii|ƒoti d|ƒdSti d|ƒd d k l }d ttid ƒ}tiitid|ƒ}d |i|f}|i|ƒ}|i|ƒ\} } |i| | |it|d ƒƒdttid ƒ} | ||f} d| } ti| ƒ}|oti dƒndS(s; Build the import libraries for Mingw32-gcc on Windows spython%d%d.libiRŒslibpython%d%d.as+Cannot build import library: "%s" not foundNs)Skip building import library: "%s" existss(Building import library (ARCH=x86): "%s"i’’’’(tlib2defspython%d%d.defs%s %sRtspython%d%d.dlls-dlltool --dllname %s --def %s --output-lib %ss:Failed to build import library for gcc. Linking will fail.(RŽR_R`RGRHRNRbRR{R|R?Rtnumpy.distutilsR—t DEFAULT_NMtgetnmtparse_nmt output_deft DEF_HEADERR}tsystem(tlib_nametlib_fileR’R“R—R”R•tnm_cmdt nm_outputtdlisttflisttdll_nameRER–tstatus((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pyRŠ1s2" twin32tCRT_ASSEMBLY_VERSIONt90s 9.0.21022.8s 8.0.50727.42t80s9Cannot import msvcrt: using manifest will not be possiblecCskytt|d|ƒ}Wn)tj otd||fƒ‚nXd}|h|d6|d6|d6S(sUGiven a major and minor version of the MSVCR, returns the corresponding XML file.i s)Version %d,%d of MSVCRT not supported yetsS tfullverRiRj(t_MSVCRVER_TO_FULLVERtstrRdRf(RiRjR«ttemplate((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pytmsvc_manifest_xmlwsRocCsL|djo d}n(|djo d}ntd|ƒ‚d||fS(sOReturn the rc file used to generate the res file which will be embedded as manifest for given manifest file name, of given type ('dll' or 'exe'). Parameters ---------- name: str name of the manifest file to embed type: str ('dll', 'exe') type of the binary which will embed the manifestRoitexeisType %s not supporteds&#include "winuser.h" %d RT_MANIFEST %s(Rf(Rˆttypetrctype((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pyt manifest_rc—s    cCs[tƒ}|oGt|dd!ƒ}|t|ƒjptdt|ƒ|f‚qWndS(s6msver is the ms runtime version used for the MANIFEST.iisKDiscrepancy between linked msvcr (%d) and the one about to be embedded (%d)N(RRaRf(tmsvertmsvcvRi((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pyt!check_embedded_msvcr_match_linked¬s cCs5tii|idgdƒƒ}tii|ƒdS(Ntyotci(RGRHRMt_gen_temp_sourcefileRI(tconfigRT((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pytconfigtest_name¹s!cCs$t|ƒ}|ii}||dS(Ns .manifest(R»Rt exe_extension(Rŗtroottexext((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pyt manifest_name½s  cCst|ƒ}|dS(Ns.rc(R»(RŗR½((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pytrc_nameĆs cCsŖtƒ}|dj o|djot|ƒt|ƒ}t||dƒ}t||ƒ}tt|ƒdƒ}|iit|ƒƒ|i |ƒ|i ƒq¦ndS(Nii Rt( tget_build_msvc_versionRR¶RaRÆR}Ræt temp_filesR2R~R"(RŗR“tmatmitmanxmltman((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pytgenerate_manifestČs      (4RZRGRR_R{Rtnumpy.distutils.ccompilertnumpytdistutils.cygwinccompilerRtdistutils.versionRRRtdistutils.errorsRRRtdistutils.unixccompilerRtdistutils.msvccompilerRRĮtnumpy.distutils.misc_utilRR tcompileRwRyRRR RpRsR…R'R‰RŠR¬tplatformtmsvcrtthasattrRØt ImportErrorR|RÆR³R¶R»RæRĄRĒ(((sF/usr/lib64/python2.6/site-packages/numpy/distutils/mingw32ccompiler.pyt sP        «   "  5