ó +HYc@s²ddlZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z ddlmZdefd „ƒYZdS( iÿÿÿÿN(t MSVCCompiler(t UnixCCompiler(tMingw32CCompiler(tcustomize_compileri(tutilst CCompilercBszeZdZd ZdZejejd d„Z d„Z d„Z d„Z d„Z d„Zd„Zd„Zd „ZRS( tcCs:|dkr‹|dkr]|jdƒdksB|jdƒdkrKd}q]tjjƒ}n|dkrš|dkrštd|ƒ‚qšntjjƒ}|dkrÈdd lm}|jƒ|_ ntjj d |ƒ|_ t |j ƒt |j t ƒrT|j jd gkr#g|j _n|j jdkrT|j j d g|j _qTn|jƒríd tjd|D]6}|j d ƒrq|j|ƒqL|jd |ƒqLWxN|D]F}|jd|ƒtj j |ƒr|jd ƒ|j|ƒqqWdS( Nt.Rs -Wl,-rpath,.tdarwins-Wl,--no-as-neededs-Ls -Wl,-rpath,s-L.s.las-ls-rpath( R!Rt add_librarytadd_library_dirR"tnametadd_runtime_library_dirtappendtsystplatformtpathtisabstendswith( R'targstlibtoolt librariestextra_librariestlibpathstlibrarytlibpatht library_path((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pytget_internal_link_flagsps:         cCs^xW|D]O}|s&|jj|ƒq|jdƒrE|j|ƒq|jd|ƒqWdS(Ns.las-l(RR-R6R1(R'R7R8R9R<((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pytget_external_link_flags£s  c Cs¶dg}|j|ƒ\}}}dg}|j|ƒ|j|ƒ|jƒr‡|jd ƒ|jd ƒ|jdƒ|jdƒn|jjd|d|d |d |d |ƒdS(Ns-CR+t_USE_DECLSPECS_FOR_SALt_CRT_SECURE_NO_WARNINGSt_CRT_NONSTDC_NO_WARNINGStSAL_NO_ATTRIBUTE_DECLARATIONStsourcet output_filetmacrost include_dirstextra_postargs(RAN(RBN(RCN(RDN(t_set_cpp_optionstextendR!R1RRt preprocess( R'REtoutputt cpp_optionsRIt include_pathsRGtpostargsRH((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyRL±s        cCsÚg}g}dj|ƒ}|jtjd|jtjƒƒ}|j|ƒ\} } } x|D]} |j| ƒq^Wt|jtƒrBtj j dƒ} | rBxt t j | ƒƒD]ƒ\}}|jdƒrµ|jdƒ}|dkr |d|!||df}n|ddf}|| kr8| j|ƒq8qµqµWqBn|jd krh| rh|jd ƒn|j|jƒ|j| ƒ|j| ƒ|jjd |d | d |d|dt||d|jtjƒ!ƒƒS(NRitCFLAGSs-Dt=iÿÿÿÿiitgccs-WalltsourcesRGRHRIt output_dir(R&trfindR"tsepRJR1RRRR#Rt enumeratetshlextsplitt startswithtfindRR$R%RKtcompiletstr(R'tpkg_config_cflagst cpp_includesREt init_sectionsRItincludest source_strt tmpdir_idxRORGt extra_argstincludetcflagstitcflagtstridxtmacroset((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyR]Ês<$ "      c Cskg}g}g}g}x|D]}|j|ƒqW|jjd|jjd|d|d|d|ƒdS(Nt target_desctobjectstoutput_filenamet extra_preargsRI(R1Rtlinkt EXECUTABLE( R'RMRmtlib_argsRoRIt library_dirsR9targ((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyRpôs c Cság}g}|jƒrVtjjdƒ}|jdƒ}|jdƒ|jdƒn tj|ƒ}|r¿tjdkr¢|jtj tjjddƒƒƒn|j |ƒ|jdƒn|j tjjd d ƒd gƒt j |j d gd t jƒ}|jƒ\}} xK|jdƒjƒD]4} | jdƒr*| tdƒjtjƒ}q*q*Wg} g} x>|D]6} t}d| d| d| d| d| g}xè|D]à}|rÁPn|jdƒrÝ|d}nx±|D]©}|rôPntjj||ƒ}tjj|ƒrä|jƒr%tjddƒ\}}tj|ƒd|g}t j||g|d t jƒ}t|dƒ~}xt|jƒjƒD]`} d| kr¡| jƒ}x?|D]4}|jdƒrÆ| j|ddƒt}PqÆqÆWq¡q¡WWdQX|jƒtj |ƒqt j ||gd t jƒ}|jƒ\}} x4|jdƒjƒD]} | j| ƒt}PqlWqäqäWq±W|su| j| ƒququWt| ƒdkrÝt!dd j| ƒƒ‚n| S(!NtLIBt;s dumpbin.exes-symbolsRtSHELLssh.exes--mode=executetDLLTOOLs dlltool.exes --identifys-print-search-dirststdouttasciis libraries: s lib%s.dll.aslib%s.as%s.dll.as%s.as%s.libRRitprefixsg-ir-win32-resolve-lib-s-out:trt__IMPORT_DESCRIPTOR_is.dllis4ERROR: can't resolve libraries to shared libraries: s, ("R!R"R#RRZR1Rtget_libtool_commandR/twhichRKt subprocesstPopenR$tPIPEt communicatetdecodet splitlinesR[tlentpathseptFalseR4R&texiststtempfiletmkstemptclosetcalltopentreadtTruetunlinkR(R'R9toptionsR7t libsearchR=R8tproctotetlinetshlibst not_resolvedtlibtfoundt candidatestltctimplibttmp_fdt tmp_filenamet output_flagt tmp_fileobjt line_tokenstitem((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pytresolve_windows_libssŒ  ( " #               cCst|jtƒrtStSdS(N(RRRRRˆ(R'((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyR!hsc Cs'g}g}g}x|D]ý}tj|ƒ}|jdƒrW|j|tdƒƒq|jdƒrÎ|tdƒ}|jdƒ}|dkr |} d} n|| } ||d} |j| | fƒq|jdƒrú|j|tdƒfƒq|d kr|j|ƒqqW|||fS(Ns-Is-DRRiÿÿÿÿis-Us-g3s-ggdb3s-gstabs3s-gcoff3s-gxcoff3s-gvms3(s-g3s-ggdb3s-gstabs3s-gcoff3s-gxcoff3s-gvms3(Rtcflag_real_include_pathR[R1R†R\R( R'R’RbRGt other_optionsR•toptiontmacrot macro_indext macro_namet macro_value((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyRJos*     N(t__name__t __module__R$RRR%R"R#R/R*R?R@RLR]RpR¦R!RJ(((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyR%s B 3   *  d (R"RYR€RŠR2Rtdistutils.msvccompilerRtdistutils.unixccompilerRtdistutils.cygwinccompilerRtdistutils.sysconfigRRRtobjectR(((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyts