ó îŠXc@s¦ddlZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z ddl mZdefd „ƒ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 ƒri|j|ƒqD|jd |ƒqDWxN|D]F}|jd|ƒtj j |ƒr…|jd ƒ|j|ƒq…q…WdS( 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 librariestlibpathstlibrarytlibpatht library_path((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pytget_internal_link_flagsos:           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(R@N(RAN(RBN(RCN(t_set_cpp_optionstextendR!R1RRt preprocess( R'RDtoutputt cpp_optionsRHt include_pathsRFtpostargsRG((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyRK°s        cCs×g}g}dj|ƒ}|jtjd|jtjƒƒ}|j|ƒ\} } } x|D]} |j| ƒq^Wt|jtƒr?tj j dƒ} | r?xšt | j ƒƒD]ƒ\}}|j dƒr²|jdƒ}|dkr|d|!||df}n|ddf}|| kr5| j|ƒq5q²q²Wq?n|jd kre| re|jd ƒn|j|jƒ|j| ƒ|j| ƒ|jjd |d | d |d|dt||d|jtjƒ!ƒƒS(NRitCFLAGSs-Dt=iÿÿÿÿiitgccs-WalltsourcesRFRGRHt output_dir(R&trfindR"tsepRIR1RRRR#Rt enumeratetsplitt startswithtfindRR$R%RJtcompiletstr(R'tpkg_config_cflagst cpp_includesRDt init_sectionsRHtincludest source_strt tmpdir_idxRNRFt 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_preargsRH(R1Rtlinkt EXECUTABLE( R'RLRktlib_argsRmRHt library_dirsR9targ((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyRnó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.libRQitprefixsg-ir-win32-resolve-lib-s-out:trt__IMPORT_DESCRIPTOR_is.dllis4ERROR: can't resolve libraries to shared libraries: s, ("R!R"R#RRXR1Rtget_libtool_commandR/twhichRJt subprocesstPopenR$tPIPEt communicatetdecodet splitlinesRYtlentpathseptFalseR4R&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(RRRRŽR†(R'((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyR!gsc 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-DRQiÿÿÿÿis-Us-g3s-ggdb3s-gstabs3s-gcoff3s-gxcoff3s-gvms3(s-g3s-ggdb3s-gstabs3s-gcoff3s-gxcoff3s-gvms3(Rtcflag_real_include_pathRYR1R„RZR( R'RR`RFt other_optionsR“toptiontmacrot macro_indext macro_namet macro_value((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyRIns*     N(t__name__t __module__R$RRR%R"R#R/R*R>R?RKR[RnR¤R!RI(((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyR$s B 3   *  d (R"R~RˆR2Rtdistutils.msvccompilerRtdistutils.unixccompilerRtdistutils.cygwinccompilerRtdistutils.sysconfigRRRtobjectR(((ss/home/vagrant/ruby-gnome2.win64/gobject-introspection/vendor/local/lib/gobject-introspection/giscanner/ccompiler.pyts