Your IP : 216.73.216.213


Current Path : /opt/alt/alt-nodejs9/root/lib/python2.7/site-packages/gyp/
Upload File :
Current File : //opt/alt/alt-nodejs9/root/lib/python2.7/site-packages/gyp/win_tool.pyc

�
 Qc@s�dZddlmZmZddlZddlZddlZddlZejj	ejj
e��Zd�Z
defd��YZdefd��YZed	kr�eje
ejd
��ndS(suUtility functions for Windows builds.

These functions are executed via gyp-win-tool when using the ninja generator.
i����(twindlltwintypesNcCs8t�}|j|�}|dk	r4tj|�ndS(N(tWinTooltDispatchtNonetsystexit(targstexecutort	exit_code((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytmains	tLinkLockcBs eZdZd�Zd�ZRS(s�A flock-style lock to limit the number of concurrent links to one.

  Uses a session-local mutex based on the file's directory.
  cCs�dtjdd�jdd�}tjjtjd�tjd�tj|��|_|jsgt	�tjj
|jtjd��}|d	ks�t	d|tjj�f��dS(
NsLocal\%ss\t_t:iI����i�s%s, %s(ii�(tBASE_DIRtreplaceRtkernel32tCreateMutexWRtc_inttcreate_unicode_buffertmutextAssertionErrortWaitForSingleObjecttGetLastError(tselftnametresult((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyt	__enter__ s"		cCs*tjj|j�tjj|j�dS(N(RRtReleaseMutexRtCloseHandle(Rttypetvaluet	traceback((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyt__exit__/s(t__name__t
__module__t__doc__RR!(((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyRs	RcBsqeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
RS(s�This class performs all the Windows tooling steps. The methods can either
  be executed directly, or dispatched from an argument list.cCsOt|�dkr!td��nd|j|d�}t||�|d�S(s(Dispatches a string command to a method.isNot enough argumentssExec%si(tlent	Exceptiont_CommandifyNametgetattr(RRtmethod((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyR8scCs|j�jdd�S(s@Transforms a tool name like recursive-mirror to RecursiveMirror.t-t(ttitleR(Rtname_string((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyR'@scCsNt|�j�d jd�}g|D]}|jdd�^q&}t|�S(s@Gets the saved environment from a file for a given architecture.i����st=i(topentreadtsplittdict(Rtarchtpairstitemtkvs((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyt_GetEnvDs%cCst|d�j�dS(sSimple stamp command.twN(R/tclose(Rtpath((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyt	ExecStampMscCs}tjj|�rDtjj|�r4tj|�qDtj|�ntjj|�ritj||�ntj||�dS(s)Emulation of rm -rf out && cp -af in out.N(	tosR:texiststisdirtshutiltrmtreetunlinktcopytreetcopy2(Rtsourcetdest((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytExecRecursiveMirrorQscGs�t���|j|�}tj|dtd|dtjdtj�}|j�\}}x+|j�D]}|j	d�se|GHqeqeW|j
SWdQXdS(s�Filter diagnostic output from link that looks like:
    '   Creating library ui.dll.lib and object ui.dll.exp'
    This happens when there are exports from the dll or exe.
    tshelltenvtstdouttstderrs   Creating library N(RR7t
subprocesstPopentTruetPIPEtSTDOUTtcommunicatet
splitlinest
startswitht
returncode(RR3RRHtpopentoutRtline((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytExecLinkWrapper]s
c
Gs�|j|�}tj|dtd|dtjdtj�}|j�\}}x.|j�D] }|r[d|kr[|GHq[q[W|jS(s�Run manifest tool with environment set. Strip out undesirable warning
    (some XML blocks are recognized by the OS loader, but not the manifest
    tool).RGRHRIRJs#manifest authoring warning 81010002(	R7RKRLRMRNRORPRQRS(RR3RRHRTRURRV((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytExecManifestWrapperlsc	s�ddgt|	�d|d|d|d|d|d||g
}
|j|�}tj|
d	td
|dtjdtj�}|j�\}
}|
j�}d
�t	�fd�|D��}x2|D]*}|j
��r�||kr�|GHq�q�W|jS(sjFilter noisy filenames output from MIDL compile step that isn't
    quietable via command line flags.
    tmidls/nologos/outs/tlbs/hs/dlldatas/iids/proxyRGRHRIRJsProcessing c3s0|]&}|j��rtjj|�VqdS(N(RRR<R:tbasename(t.0tx(tprefix(sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pys	<genexpr>�s(tlistR7RKRLRMRNRORPRQtsetRRRS(RR3toutdirttlbthtdlldatatiidtproxytidltflagsRRHRTRURtlinest
processingRV((R]sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytExecMidlWrapperys&

c
Gs�|j|�}|dkrdStj|dtd|dtjdtj�}|j�\}}xR|j�D]D}|jd�rk|jd�rk|jd	�rk|rk|GHqkqkW|j	S(
s/Filter logo banner from invocations of asm.exe.senvironment.x64iRGRHRIRJs#Copyright (C) Microsoft CorporationsMicrosoft (R) Macro Assemblers
 Assembling: (
R7RKRLRMRNRORPRQRRRS(RR3RRHRTRURRV((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytExecAsmWrapper�sc
Gs�|j|�}tj|dtd|dtjdtj�}|j�\}}xB|j�D]4}|jd�r[|jd�r[|r[|GHq[q[W|j	S(sgFilter logo banner from invocations of rc.exe. Older versions of RC
    don't support the /nologo flag.RGRHRIRJs+Microsoft (R) Windows (R) Resource Compilers#Copyright (C) Microsoft Corporation(
R7RKRLRMRNRORPRQRRRS(RR3RRHRTRURRV((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyt
ExecRcWrapper�scGsi|j|�}t|�j�}|r1|dnd}tj|dtd|d|�}|j�|jS(s�Runs an action command line from a response file using the environment
    for |arch|. If |dir| is supplied, use that as the working directory.iRGRHtcwdN(	R7R/R0RRKRLRMtwaitRS(RR3trspfiletdirRHRRT((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pytExecActionWrapper�s!
(R"R#R$RR'R7R;RFRWRXRjRkRlRq(((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyR4s								
			t__main__i(R$tctypesRRR<R?RKRR:tdirnametabspatht__file__RR
tobjectRRR"Rtargv(((sJ//opt/alt/alt-nodejs9/root/usr/lib/python2.7/site-packages/gyp/win_tool.pyt<module>	s	�