%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/usr/src/node-v0.10.4/tools/gyp/pylib/gyp/
Upload File :
Create Path :
Current File : //proc/self/root/usr/src/node-v0.10.4/tools/gyp/pylib/gyp/input.pyc

�
4�fQc@s}ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlZddl	Z	ddl
ZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZdd	l
mZd
ddgZd
dgZdddddddgZgaed�Zejd�Zd�Z ddddd
ddddd d!d"d#d$d%dd&d'd(d)d*d+d,d-gZ!ga"dd.dd
d/dd0dd&d(d+gZ#e$a%e$a&e'd1�Z(d2�Z)d3�Z*d4�Z+d5�Z,d6�Z-d7�Z.d8�Z/d9�Z0d:e1fd;��YZ2d<e3fd=��YZ4d>�Z5ed?�Z6id@dA6dBdC6dDdE6Z7dF�Z8ejdG�Z9dH�Z:ejdI�Z;ejdJ�Z<ejdK�Z=iZ>dL�Z?dMZ@dNZAdOZBdP�ZCdQ�ZDdR�ZEdS�ZFe'dT�ZGdU�ZHdV�ZIdW�ZJdX�ZKdY�ZLdZ�ZMd[�ZNd\�ZOd]e3fd^��YZPd_�ZQd`�ZRda�ZSdb�ZTejdc�ZUdd�ZVe$eWde�ZXdf�ZYdg�ZZdh�Z[di�Z\dj�Z]dk�Z^dl�Z_dm�Z`dn�Zado�Zbdp�Zcdq�Zddr�Zeds�ZfdS(ti����(tConst(tDict(tDiscard(tList(tModule(tNode(tStmtN(tGypErrort
executabletshared_librarytloadable_moduletdependenciestexport_dependent_settingstdestinationtfilestinclude_dirstinputst	librariestoutputstsourcess=+?!s_(dir|file|path)s?$cCs:x|dtkr |d }qW|tkp9tj|�S(Ni����(tis_path_section_charsett
path_sectionstis_path_section_match_retsearch(tsection((s./tools/gyp/pylib/gyp/input.pyt
IsPathSection4stactionstconfigurationstcopiestdefault_configurationtdependencies_originaltlink_languagest
postbuildstproduct_dirtproduct_extensiontproduct_nametproduct_prefixtrulestrun_aststandalone_static_librarytsuppress_wildcardttarget_namettoolsetttoolsetsttypetvariantst	variablestall_dependent_settingstdirect_dependent_settingst
link_settingscCsg|dkrg}n||kr%|S|j|�x.||jdg�D]}t|||�qIW|S(sReturn a list of all build files included into build_file_path.

  The returned list will contain build_file_path as well as all other files
  that it included, either directly or indirectly.  Note that the list may
  contain files that were included into a conditional section that evaluated
  to false and was not merged into build_file_path's dict.

  aux_data is a dict containing a key for each build file or included build
  file.  Those keys provide access to dicts whose "included" keys contain
  lists of all other files included by the build file.

  included should be left at its default None value by external callers.  It
  is used for recursion.

  The returned list will not contain any duplicate entries.  Each build file
  in the list will be relative to the current directory.
  tincludedN(tNonetappendtgettGetIncludedBuildFiles(tbuild_file_pathtaux_dataR2tincluded_build_file((s./tools/gyp/pylib/gyp/input.pyR6vs	
cCs�tj|�}t|t�s$t�|j�}|ddksFt�t|dt�s_t�|dj�}t|dt�s�t�|dj�}t	|�dks�t�t
|dg�S(s�Return the eval of a gyp file.

  The gyp file is restricted to dictionaries and lists only, and
  repeated keys are not allowed.

  Note that this is slower than eval() is.
  iiN(tcompilertparset
isinstanceRtAssertionErrortgetChildrenR3RRtlent	CheckNode(t
file_contentstasttc1tc2tc3((s./tools/gyp/pylib/gyp/input.pytCheckedEval�s	c
Cs�t|t�r�|j�}i}x�tdt|�d�D]�}t||t�sYt�||j�d}||kr�td|dtt|�d�ddj	|�d��nt
|�}|j|�t||d|�||<q:W|St|t
�rl|j�}g}xOt|�D]A\}}	t
|�}|jt|��|jt|	|��q#W|St|t�r�|j�dStd	dj	|�d
t|��dS(NiisKey 's' repeated at level is with key path 't.t'sUnknown AST node at key path 's': (R<RR>trangeR?RR=RtreprtjointlistR4R@Rt	enumeratet	TypeError(
tnodetkeypathtctdicttntkeytkptchildrentindextchild((s./tools/gyp/pylib/gyp/input.pyR@�s2=
c
Csj||kr||Stjj|�r;t|�j�}ntd|tj�f��d}y2|rut|�}nt	|idd6d�}WnKt
k
r�}	||	_�n-tk
r�}	t
jj|	d|��nX|||<i||<yE|rt|||||||�nt|||||d|�Wn-tk
re}	t
jj|	d|��nX|S(Ns%s not found (cwd: %s)t__builtins__swhile reading swhile reading includes of (tostpathtexiststopentreadRtgetcwdR3RFtevaltSyntaxErrortfilenamet	ExceptiontgyptcommontExceptionAppendtLoadBuildFileIncludesIntoDict(
R7tdataR8R.tincludest	is_targettchecktbuild_file_contentstbuild_file_datate((s./tools/gyp/pylib/gyp/input.pytLoadOneBuildFile�s<
	

cCs�g}|dkr"|j|�nd|kr�xL|dD]@}tjjtjjtjj|�|��}	|j|	�q9W|d=nx�|D]}}d||kr�g||d<n||dj|�tj	tj
d|�t|t||||dt
|�||�q�Wxs|j�D]e\}
}|jtkrVt|||||d|�q|jtkrt||||||�qqWdS(NRiR2sLoading Included File: '%s'(R3textendRZR[tnormpathRKtdirnameR4RdtDebugOutputtDEBUG_INCLUDESt
MergeDictsRotFalset	iteritemst	__class__RRRgRLtLoadBuildFileIncludesIntoList(tsubdicttsubdict_pathRhR8R.RiRkt
includes_listtincludetrelative_includetktv((s./tools/gyp/pylib/gyp/input.pyRg�s0-

	
c	Csnxg|D]_}|jtkr;t|||||d|�q|jtkrt||||||�qqWdS(N(RxRRRgR3RLRy(tsublisttsublist_pathRhR8R.Rktitem((s./tools/gyp/pylib/gyp/input.pyRys
c	Csfd|kr
|d}g}x�|D]�}d|krTd|krT|j|�q#ntrr|jddg�}n	dg}d|kr�|d=nt|�dkr#x8|dD],}tj|�}||d<|j|�q�W|d|d<|j|�q#q#W||d<nd|krbxF|dD]7}t|t�r$x|dD]}t|�qDWq$q$WndS(NttargetsR*R+ttargetiit
conditions(	R4tmultiple_toolsetsR5R?tcopytdeepcopyR<RLtProcessToolsetsInDict(	Rhttarget_listtnew_target_listR�R+tbuildt
new_targett	conditiontcondition_dict((s./tools/gyp/pylib/gyp/input.pyR�)s2


	


c
Cs|rYtjj|tjj|��}|dkr@d|d<qY|jdd�|d<ntrttjj|�}n||dkr�t	S|dj
|�tjtjd|�t
|||||t|�}	||	d<d	|	kr�t|d
��nt||�}
g|	d	<x@|
D]8}tjj|tjj|��}|	d	j|�qWt|	�t|	t||�t|	�d|	krd|	kr�td
|��nd}
xf|
t|	d�kr|	d|
}tj|	d�}t||||�||	d|
<|
d7}
q�W|	d=ng}d|	kr�x_|	dD]P}d|krRq:nx5|dD])}|jtjj||d�d�q]Wq:Wn|r�xn|D]Y}y#t||||||||�Wq�tk
r�}tjj|d|��q�Xq�Wn
||fSdS(NtRGtDEPTHs\t/ttarget_build_filessLoading Target Build File '%s't_DEPTHtincluded_filess$ must not contain included_files keyttarget_defaultsR�s'Unable to find targets in build file %siiRs while loading dependencies of %s(RdRetRelativePathRZR[Rrtreplacetabsolute_build_file_pathstabspathRvtaddRsRtRotTrueRR6R4R�t#ProcessVariablesAndConditionsInDicttPHASE_EARLYR?R�R�Rut
ResolveTargetR3tLoadTargetBuildFileRcRf(R7RhR8R.RitdepthRktload_dependenciestdRmR2t
included_filetincluded_relativeRWtold_target_dicttnew_target_dictRttarget_dictt
dependencyRn((s./tools/gyp/pylib/gyp/input.pyR�Mst!







	

(
	c	CsKytjtjtj�x'|j�D]\}}	|	t�|<q&Wt|�}
t|�}t|||||||t�}|s�|S|\}}
i}x=|D]5}|dkr�q�n||
kr�||||<q�q�Wi}x+|D]#}||kr�||||<q�q�W||||
fSWn'tk
rF}t	j
dI|IJdSXdS(s�Wrapper around LoadTargetBuildFile for parallel processing.

     This wrapper is used when LoadTargetBuildFile is executed in
     a worker process.
  R�sException: N(tsignaltSIGINTtSIG_IGNRwtglobalstsetR�RvRctsyststderrR3(tglobal_flagsR7RhR8R.RiR�RkRTtvaluet	data_keyst
aux_data_keystresultRtdata_outtaux_data_outRn((s./tools/gyp/pylib/gyp/input.pytCallLoadTargetBuildFile�s:
	

tParallelProcessingErrorcBseZRS((t__name__t
__module__(((s./tools/gyp/pylib/gyp/input.pyR��st
ParallelStatecBs eZdZd�Zd�ZRS(sClass to keep track of state when processing input files in parallel.

  If build files are loaded in parallel, use this to keep track of
  state during farming out and processing parallel jobs. It's stored
  in a global so that the callback function can have access to it.
  cCsOd|_d|_d|_d|_d|_t�|_g|_t	|_
dS(Ni(R3tpoolR�RhR8tpendingR�t	scheduledRRvterror(tself((s./tools/gyp/pylib/gyp/input.pyt__init__�s						cCs|jj�|s:t|_|jj�|jj�dS|\}}}}|jdj|�x|D]}|||j|<qgWx|D]}|||j|<q�Wx@|D]8}||j	kr�|j	j|�|j
j|�q�q�W|jd8_|jj�|jj�dS(sJHandle the results of running LoadTargetBuildFile in another process.
    NR�i(
R�tacquireR�R�tnotifytreleaseRhR�R8R�RR4R�(R�R�tbuild_file_path0tdata0t	aux_data0t
dependencies0RTtnew_dependency((s./tools/gyp/pylib/gyp/input.pytLoadTargetBuildFileCallbacks&
	





(R�R�t__doc__R�R�(((s./tools/gyp/pylib/gyp/input.pyR��s	c
Cs�t�}tj�|_|g|_t|g�|_d|_||_||_	y+|jj
�x|jsv|jrz|jr�tj
dIJPn|js�|jj�qdn|jj�}|jd7_i}	|d|	d<i}
it�dd6t�dd6t�dd6t�dd6}|js@tjd	�|_n|jjtd
|||	|
||||fd|j�qdWWn&tk
r�}|jj�|�nX|jj�|jr�tj�ndS(Nis�
Note: an error occurred while running gyp using multiprocessing.
For more verbose output, set GYP_PARALLEL=0 in your environment.
If the error only occurs when GYP_PARALLEL=1, please report a bug!iR�Rtnon_configuration_keysR�R�itargstcallback(R�t	threadingt	ConditionR�RR�R�R�RhR8R�R�R�R�twaittpopR�R�tmultiprocessingtPooltapply_asyncR�R�tKeyboardInterruptt	terminateR�texit(
R7RhR8R.RiR�Rktparallel_stateR�tdata_intaux_data_inR�Rn((s./tools/gyp/pylib/gyp/input.pytLoadTargetBuildFileParallel)sR				
		
		


	s{[(t{t}t[t]t(t)cCs�g}d}x�t|�D]�\}}|tkrV|j|�|dkr�|}q�q|tkr|sldS|j�t|kr�dS|s�||dfSqqWdS(Ni����i(i����i����(i����i����(i����i����(RMt	LBRACKETSR4tBRACKETSR�(t	input_strtstacktstartRWtchar((s./tools/gyp/pylib/gyp/input.pytFindEnclosingBracketGroupfs
s(0|-?[1-9][0-9]*)$cCst|t�otj|�S(s|Returns True if |string| is in its canonical integer form.

  The canonical form is such that str(int(string)) == string.
  (R<tstrtcanonical_int_retmatch(tstring((s./tools/gyp/pylib/gyp/input.pytIsStrCanonicalInt{ssy(?P<replace>(?P<type><(?:(?:!?@?)|\|)?)(?P<command_string>[-a-zA-Z0-9_.]+)?\((?P<is_array>\s*\[?)(?P<content>.*?)(\]?)\))sy(?P<replace>(?P<type>>(?:(?:!?@?)|\|)?)(?P<command_string>[-a-zA-Z0-9_.]+)?\((?P<is_array>\s*\[?)(?P<content>.*?)(\]?)\))s|(?P<replace>(?P<type>[\^](?:(?:!?@?)|\|)?)(?P<command_string>[-a-zA-Z0-9_.]+)?\((?P<is_array>\s*\[?)(?P<content>.*?)(\]?)\))cCsdtjdkr`t|�tkrHtjdd|d�g|d}q`tjdd|�}n|S(Ntwin32s^cat stype ii(R�tplatformR,RLtretsub(tcmd((s./tools/gyp/pylib/gyp/input.pytFixupPlatformCommand�s
'iiic+Cs�|tkrt}d}nB|tkr6t}d}n'|tkrQt}d}nts]t�t|�}t	|�rt
|�S||kr�|St|j|��}|s�|S|}|j
�x�|D]�}	|	j�}
tjtjd|
�d|
dk}|
d}d|
dk}
|	jd	�}|	jd	�}t||�\}}||}|||!}||d
}|d
}|||!}|
r�tj|�}t||�t||||�}nt||||�}|j�}d|
dko�||k}|s
|
r4tjj|�}|dkr4d}q4n|
r�t|�tkrU|}n|jd
�}|d}|}tjj |�s�tjj!||�}ntj"j#|�}x#|d
D]}|j$d|�q�W|j%�nt|r
t&}|
drt'|�}t}nt|�}t(j)|d�}|dkr�tjtjd||�d}|dkrtj*�} tj+|�zvt,j|�}!yt-|!d�}"Wn-t.k
r�}#t/d|!d|#f��nXt|"j0|!d
��j1�}Wdtj+| �X|dks�t�n�|r7t/d||f��n�t2|�}t3j4|d|dt3j5dt3j5dt3j5d|�}$|$j6d�\}%}&|$j7�dks�|&r�t8j9j$|&�t/d||$j:f��n|%j1�}|t(|<qWtjtjd||�|}nJ||krM|dd%kr2g}qWt/d|d|��n
||}t;|t�r�xd|D]\}'|ddkrmt;|'t�rmt;|'t
�rmt/d |d!d"|'j<j=��qmqmWt>||||�nEt;|t�r(t;|t
�r(t/d |d!d#|j<j=��n|r_t;|t�rG|}q�t,jt|��}nLd}(t;|t�r�tj"j?|�}(n|}(|| t|(�||}|}q�Wtjtjd$|�t;|t�r2|r�t;|dt�r�qGg})x*|D]"}'|)j@t|'|||��qW|)}nt||||�}t;|t�r�xbtAdtB|��D]-}*t	||*�rlt
||*�||*<qlqlWnt	|�r�t
|�}n|S(&Nt<t>t^sMatches: %rt!R,tcommand_stringt|R�it@R�t is%s
tis_arrays(Executing command '%s' in directory '%s't
pymod_do_mains,Error importing pymod_do_mainmodule (%s): %ss$Unknown command string '%s' in '%s'.tshelltstdoutR�tstdintcwds%Call to '%s' returned exit status %d.s2Had cache value for command '%s' in directory '%s'i����R�sUndefined variable s in s	Variable s- must expand to a string or list of strings; slist contains a sfound a sFound output %r, recursing.(R�R�(CR�tearly_variable_ret
PHASE_LATEtlate_variable_retPHASE_LATELATEtlatelate_variable_reRvR=R�R�tintRLtfinditertreverset	groupdictRdRstDEBUG_VARIABLESR�tendR�R�R�tProcessListFiltersInDicttExpandVariableststripRZR[RrR3R,tsplittisabsRKRetWriteOnDifftwritetcloseR�R`tcached_command_resultsR5R_tchdirtshlext
__import__tImportErrorRtDoMaintrstripR�t
subprocesstPopentPIPEtcommunicateR�R�R�t
returncodeR<RxR�t#ProcessVariablesAndConditionsInListtEncodePOSIXShellListR4txrangeR?(+tinputtphaseR.t
build_filetvariable_retexpansion_symbolR�tmatchestoutputtmatch_groupR�trun_commandR�t	file_listt
replace_starttreplace_endtc_starttc_endtreplacementtcontents_starttcontents_endtcontentstprocessed_variablestexpand_to_listtbuild_file_dirt
contents_listR[tftit	use_shellt	cache_keytcached_valuetoldwdtparsed_contentst	py_moduleRntptp_stdouttp_stderrR�tencoded_replacementt
new_outputRW((s./tools/gyp/pylib/gyp/input.pyR�s,			


	





		


	


#				

	
	

 
"
	

	c	Cs�|tkrd}n1|tkr*d}n|tkr:dStsFt�||krVdS||}||=x|D]}t|t�s�t|d��nt|�dkr�t|�dkr�t|d|ddt	t|����n|dd!\}}d}	t|�dkr!|d}	nt||||�}
t|
t	�rpt|
t�rpt
d	d
tjj�ny>t|
dd�}t|idd
6|�r�|}n|	}Wn�tk
r}
tdt	|
jd�|
j||
jf|
j|
j|
j|
j�}|�n<tk
rK}
tjj|
d|
|f�t|
��nX|dkrnt||||�t||||�qnqnWdS(NR�ttarget_conditionss must be a listiiR�is must be length 2 or 3, not s7Variable expansion in this context permits str and int sonly, found s<string>R`RYs9%s while evaluating condition '%s' in %s at character %d.s%while evaluating condition '%s' in %s(R�RRRvR=R<RLRR?R�R3RR
t
ValueErrortexpandedRxR�tcompileR`RaR�ttexttoffsetRbtlinenot	NameErrorRdReRfR�Ru(tthe_dictR(R.R)tconditions_keytconditions_listR�t	cond_exprt	true_dictt
false_dicttcond_expr_expandedtast_codet
merge_dictRntsyntax_error((s./tools/gyp/pylib/gyp/input.pytProcessConditionsInDict�sZ		

$,
		
#		
cCs_xX|j�D]J\}}t|t�sFt|t�sFt|t�r
||d|<q
q
WdS(Nt_(RwR<R�R
RL(R.RRRTR�((s./tools/gyp/pylib/gyp/input.pytLoadAutomaticVariablesFromDict0scCs�x�|jdi�j�D]�\}}t|t�r[t|t�r[t|t�r[qn|jd�r�|d }||kr�qn|dkr�||kr�||}q�n|}|||<qWdS(NR.t%i����(R5RwR<R�R
RLtendswith(R.RRtthe_dict_keyRTR�t
variable_name((s./tools/gyp/pylib/gyp/input.pytLoadVariablesFromVariablesDict9s% 
c	Cs:|j�}t||�d|krmx(|dj�D]\}}|||<q6Wt|d|||d�nt|||�x�|j�D]�\}}|dkr�t|t�r�t||||�}t|t�rt|t�rt	dd|j
jd|�n|||<q�q�W|j�}t||�t|||�t||||�|j�}t||�t|||�x�|j�D]�\}}|dks�t|t�r�q�nt|t
�r�t|||||�q�t|t�rt||||�q�t|t�s�td|j
jd|�q�q�WdS(s�Handle all variable and command expansion and conditional evaluation.

  This function is the public entry point for all variable expansions and
  conditional evaluations.  The variables_in dictionary will not be modified
  by this function.
  R.s7Variable expansion in this context permits str and int sonly, found s for s
Unknown type N(R�R^RwR�RcR<R�RR
RKRxR�R\RRRLR$RN(	RRR(tvariables_inR)RaR.RTR�RL((s./tools/gyp/pylib/gyp/input.pyR�VsD

 
"


cCsUd}xH|t|�krP||}t|t�rJt||||�n�t|t�rot||||�n�t|t�rt||||�}t|t�s�t|t�r�|||<qCt|t�r�||||d+|t|�7}q	qCt	dd|j
jd|�n-t|t�sCtd|j
jd|�n|d}q	WdS(Niis7Variable expansion in this context permits strings and slists only, found s at s
Unknown type s
 at index (
R?R<RRR�RLR$R�RR
RKRxR�RN(tthe_listR(R.R)RWR�RL((s./tools/gyp/pylib/gyp/input.pyR$�s,


cCs�i}x||dD]p}xg||jdg�D]O}tjj||d|d�}||krstd|��n|||<q.WqW|S(syBuilds a dict mapping fully-qualified target names to their target dicts.

  |data| is a dict mapping loaded build files by pathname relative to the
  current directory.  Values in |data| are build file contents.  For each
  |data| value with a "targets" key, the value of the "targets" key is taken
  as a list containing target dicts.  Each target's fully-qualified name is
  constructed from the pathname of the build file (|data| key) and its
  "target_name" property.  These fully-qualified names are used as the keys
  in the returned dict.  These keys provide access to the target dicts,
  the dicts in the "targets" lists.
  R�R�R)R*s!Duplicate target definitions for (R5RdRetQualifiedTargetR(RhR�R)R�R)((s./tools/gyp/pylib/gyp/input.pytBuildTargetsDict�s

cCsCgtD]}dD]}||^qq}x|j�D]\}}tjj|�}|d}x�|D]�}|j|g�}	x�tdt|	��D]�}
tjj||	|
|�\}}}
t	s�|}
ntjj
|||
�}||	|
<|dkr�||dkr�td|d|d	|d
��q�q�WqfWq7WdS(
s�Make dependency links fully-qualified relative to the current directory.

  |targets| is a dict mapping fully-qualified target names to their target
  dicts.  For each target in this dict, keys known to contain dependency
  links are examined, and any dependencies referenced will be rewritten
  so that they are fully-qualified and relative to the current directory.
  All rewritten dependencies are suitable for use as keys to |targets| or a
  similar dict.
  R�R�R�R*iRsFound s in s of s, but not in dependenciesN(R�R�R�(tdependency_sectionsRwRdRet	BuildFileR5R&R?R�R�RfR(R�tdeptoptall_dependency_sectionsR�R�ttarget_build_fileR*tdependency_keyRRWtdep_filet
dep_targettdep_toolsetR�((s./tools/gyp/pylib/gyp/input.pytQualifyDependenciess*


			
c
Cs�x�|j�D]�\}}|d}tjj|�}x�tD]�}|j|g�}d}xb|t|�kr�tjj||�\}	}
}|
dkr�|dkr�|d}q]n|	|kr�td|d|d��n||=|d}||	d}x�|D]�}
t	|
jd	t
��r+qn|
d
}|
dkrS|
|krSqn|
d}|dkr{||kr{qntjj|	||�}|d}|j||�qW|d}q]Wq<Wq
WdS(s�Expands dependencies specified as build_file:*.

  For each target in |targets|, examines sections containing links to other
  targets.  If any such section contains a link of the form build_file:*, it
  is taken as a wildcard link, and is expanded to list each target in
  build_file.  The |data| dict provides access to build file dicts.

  Any target that does not wish to be included by wildcard can provide an
  optional "suppress_wildcard" key in its target dict.  When present and
  true, a wildcard dependency link will not include such targets.

  All dependency names, including the keys to |targets| and the values in each
  dependency list, must be qualified when this function is called.
  R*it*isFound wildcard in s of s referring to same build fileR�R(R)N(
RwRdReRiRhR5R?tParseQualifiedTargetRR
RvRftinsert(R�RhR�R�R*RmRnRRWtdependency_build_filetdependency_targettdependency_toolsettdependency_target_dictstdependency_target_dicttdependency_target_nametdependency_target_toolsetR�((s./tools/gyp/pylib/gyp/input.pytExpandWildcardDependencies)sD






	
cCs5i}g|D]$}||kr
|j||�^q
S(s=Removes duplicate elements from l, keeping the first element.(t
setdefault(tltseenRn((s./tools/gyp/pylib/gyp/input.pytUnifynscCs]xV|j�D]H\}}x9tD]1}|j|g�}|r t|�||<q q Wq
WdS(sRMakes sure every dependency appears only once in all targets's dependency
  lists.N(RwRhR5R�(R�R)R�RnR((s./tools/gyp/pylib/gyp/input.pytRemoveDuplicateDependenciests

cCs5i}g|D]$}||kr
|j||�^q
S(sRemoves item from l.(R~(RR�tresRn((s./tools/gyp/pylib/gyp/input.pytFilter~scCs�x�|j�D]�\}}x�tD]y}|j|g�}|r xX|D]M}||krE||jdi�jdd�r�t||�||<q�qEqEWq q Wq
WdS(sYRemove self dependencies from targets that have the prune_self_dependency
  variable set.R.tprune_self_dependencyiN(RwRhR5R�(R�R)R�RnRtt((s./tools/gyp/pylib/gyp/input.pytRemoveSelfDependencies�s

"tDependencyGraphNodecBsueZdZdefd��YZd�Zd�Zd
d�Zd
d�Z	d
d�Z
d
d�Zd
ed	�Z
RS(s�

  Attributes:
    ref: A reference to an object that this DependencyGraphNode represents.
    dependencies: List of DependencyGraphNodes on which this one depends.
    dependents: List of DependencyGraphNodes that depend on this one.
  tCircularExceptioncBseZRS((R�R�(((s./tools/gyp/pylib/gyp/input.pyR��scCs||_g|_g|_dS(N(trefRt
dependents(R�R�((s./tools/gyp/pylib/gyp/input.pyR��s		cCs�g}t|j�}x�|r�|j�}|j|j�xZ|jD]O}t}x*|jD]}|j|kr[t}Pq[q[W|rE|j|�qEqEWqW|S(N(	R�R�R�R4R�R�RRvR�(R�t	flat_listtin_degree_zerosROtnode_dependenttis_in_degree_zerotnode_dependent_dependency((s./tools/gyp/pylib/gyp/input.pyt
FlattenToList�s	cCs^|dkrg}nxB|jD]7}|jdkr|j|kr|j|j�qqW|S(s+Returns a list of just direct dependencies.N(R3RR�R4(R�RR�((s./tools/gyp/pylib/gyp/input.pytDirectDependencies�s	cCs�|dkrg}nd}x�|t|�kr�||}||}d}xG|jdg�D]3}||kr]|j|||�|d}q]q]W|d}qW|S(s^Given a list of direct dependencies, adds indirect dependencies that
    other dependencies have declared to export their settings.

    This method does not operate on self.  Rather, it operates on the list
    of dependencies in the |dependencies| argument.  For each dependency in
    that list, if any declares that it exports the settings of one of its
    own dependencies, those dependencies whose settings are "passed through"
    are added to the list.  As new items are added to the list, they too will
    be processed, so it is possible to import settings through multiple levels
    of dependencies.

    This method is not terribly useful on its own, it depends on being
    "primed" with a list of direct dependencies such as one provided by
    DirectDependencies.  DirectAndImportedDependencies is intended to be the
    public entry point.
    iiRN(R3R?R5Ru(R�R�RRWR�tdependency_dictt	add_indextimported_dependency((s./tools/gyp/pylib/gyp/input.pyt_AddImportedDependencies�s	

cCs|j|�}|j||�S(s�Returns a list of a target's direct dependencies and all indirect
    dependencies that a dependency has advertised settings should be exported
    through the dependency for.
    (R�R�(R�R�R((s./tools/gyp/pylib/gyp/input.pytDirectAndImportedDependenciesscCsk|dkrg}nxO|jD]D}|jdkr|j|kr|j|j�|j|�qqW|S(s>Returns a list of all of a target's dependencies, recursively.N(R3RR�R4tDeepDependencies(R�RR�((s./tools/gyp/pylib/gyp/input.pyR�
s	c	Csi|d	krg}n|jd	kr(|Sd||jkrJtd��nd||jkr{td||jd��n||jd}|tk}|r�|r�|S|dkr�||jjdt�r�|j|kr�|j|j�n|S|r|d
kr|S|j|kre|j|j�|s8|rex'|jD]}|j||t	�qBWqen|S(s�Returns a list of dependency targets that are linked into this target.

    This function has a split personality, depending on the setting of
    |initial|.  Outside callers should always leave |initial| at its default
    setting.

    When adding a target to the list of dependencies, this function will
    recurse into itself with |initial| set to False, to collect dependencies
    that are linked into the linkable target for which the list is being built.
    R)s&Missing 'target_name' field in target.R,s!Missing 'type' field in target %stnonetdependencies_traverseRR
N(s
executableR
(
R3R�Rtlinkable_typesR5R�R4RtLinkDependenciesRv(R�R�Rtinitialttarget_typetis_linkableR�((s./tools/gyp/pylib/gyp/input.pyR�s4	

N(R�R�R�RR�R�R�R3R�R�R�R�R�R�(((s./tools/gyp/pylib/gyp/input.pyR��s		*)	
cCswi}x9|j�D]+\}}||krt|�||<qqWtd�}x�|j�D]�\}}||}tjj|�}|jd�}|s�|g|_|jj	|�q[x\|D]T}|j|�}	|	s�t
d||f��n|jj	|	�|	jj	|�q�Wq[W|j�}
t|
�t|�krmtj
ddjt|
�t|�A���n||
gS(NRs8Dependency '%s' not found while trying to load target %ss@Some targets not reachable, cycle in dependency graph detected: R�(RwR�R3RdReRiR5RR�R4RR�R?R�RKR�(R�tdependency_nodesR�tspect	root_nodettarget_nodeRmRR�tdependency_nodeR�((s./tools/gyp/pylib/gyp/input.pytBuildDependencyList[s2

&cCs8i}xE|j�D]7}tjj|�}||krt|�||<qqWx|j�D]�\}}tjj|�}||}|jdg�}x�|D]�}ytjj|�}Wn-tk
r�}	tjj|	d|��nX||kr�q�n|j|�}
|
s"td|��n|
|j	kr�|j	j
|
�|
jj
|�q�q�Wq[Wtd�}xL|j
�D]>}t|j	�dkru|j	j
|�|jj
|�ququW|j�}t|�t|�kr4g}
x0|j�D]"}||kr�|
j
|�q�q�Wtjdddj|
��ndS(NRs,while computing dependencies of .gyp file %ssDependancy '%s' not foundis>Some files not reachable, cycle in .gyp file dependency graph s#detected involving some or all of: R�(titerkeysRdReRiR�RwR5RRfRR4R�R3t
itervaluesR?R�R�RK(R�R�R�R)R�tbuild_file_nodettarget_dependenciesR�RvRnR�R�R�t	bad_filestfile((s./tools/gyp/pylib/gyp/input.pyt#VerifyNoGYPFileCircularDependencies�sL

	cCs�x�|D]�}||}tjj|�}|dkrH||j�}nT|dkrj||j|�}n2|dkr�||j|�}ntd|��xS|D]K}||}	||	kr�q�ntjj|�}
t||	|||
�q�WqWdS(NR/R0R1sCDoDependentSettings doesn't know how to determine dependencies for (RdReRiR�R�R�RRu(RTR�R�R�R�R�R)RR�R�Rv((s./tools/gyp/pylib/gyp/input.pytDoDependentSettings�s$





c
Cs�x�|D]�}||}|d}|dkrd|kr?qn|jdg�|d<||j|�}d}x�|t|�kr�||}	||	}
|
ddkr�|
jdt�s�|
ddkr�|	|dkr�||=qr|d}qrWt|�dkr||d<q�|d=q|tkr||j|�}x]|D]U}	|	|krZqBnd|krsg|d<n|	|dkrB|dj|	�qBqBW|r�d|kr�gt|�D]}||dkr�|^q�|d<q�qqWdS(NR,tstatic_libraryRRithard_dependencyi(R5R�R?RvR�R�R4treversed(
R�R�R�tsort_dependenciesR�R�R�RRWR�R�tlink_dependenciesRj((s./tools/gyp/pylib/gyp/input.pytAdjustStaticLibraryDependencies�sD









s
["']?[-/$<>^]cCs�||kstj|�r|Stjjtjjtjjtjj	|�tjj	|��|��j
dd�}|ddkr�|d7}n|SdS(Ns\R�i����(texception_reR�RZR[RqRKRdReR�RrR�(tto_filetfro_fileR�tret((s./tools/gyp/pylib/gyp/input.pytMakePathRelative&s
cs�d���fd�}d}t�fd�|D��}x�|D]�}	t}
t|	t�skt|	t�r�|r�t|||	�}n|	}t|	t�s�|	jd�r!t}
q!nit|	t�r�i}t	||	||�n>t|	t
�rg}t||	||�ntd|	j
j�|rp|
sA||||�r�|j|��|�rm|j|�qmq�qAx#|
r�||kr�|j|�qsW|j||��|�r�|j|�n|d}qAWdS(NcSs|jS(N(t__hash__(tval((s./tools/gyp/pylib/gyp/input.pyt<lambda>Iscs �|�r||kS||kS(N((txtsR(tis_hashable(s./tools/gyp/pylib/gyp/input.pytis_in_set_or_listLs
ic3s!|]}�|�r|VqdS(N((t.0R�(R�(s./tools/gyp/pylib/gyp/input.pys	<genexpr>Ust-s/Attempt to merge list item of unsupported type i(R�RvR<R�R
R�t
startswithR�RRRuRLt
MergeListsRNRxR�R4R�tremoveRu(ttotfroR�R�tis_pathsR4R�t
prepend_indexthashable_to_setR�t	singletontto_item((R�s./tools/gyp/pylib/gyp/input.pyR�Fs@	
 

cCs;x4|j�D]&\}}||kr�t}t|t�sIt|t�r{t||t�plt||t�s�t}q�n|j||jkr�t}n|r�td|jjd||jjd|�q�nt|t�s�t|t�r)t	|�}|rt
|||�||<q3|||<q
t|t�rk||krQi||<nt|||||�q
t|t
�r|d}t}	|dkr�|d }
|
|
dg}g||
<n}|dkr�|d }
|
d|
dg}t}	nJ|dkr |d }
|
|
d|
dg}n|}
|
d|
dg}x5|D]-}||krAtd|d	|��qAqAW|
|kr�|dkr�q
nt||
t
�s�td|jjd||
jjd|
d
|d�q�n
g||
<t	|
�}
t||
||||
|	�q
td|jjd|�q
WdS(
Ns$Attempt to merge dict value of type s into incompatible type s	 for key i����t=t?t+sIncompatible list policies s and R�R�s0Attempt to merge dict value of unsupported type (RwRvR<R�R
R�RxRNR�RR�RRRuRLRR�(R�R�R�R�RR�t	bad_mergetis_pathtextR4t	list_basetlists_incompatibletlist_incompatibleR�((s./tools/gyp/pylib/gyp/input.pyRu�sf&	0





	

<
 cCs�||krdS|d|}x7|jdg�D]#}t||||||g�q1Wt||||�d|kr�|d=ndS(NRtinherit_fromtabstract(R5tMergeConfigWithInheritanceRu(tnew_configuration_dictR)R�t
configurationtvisitedtconfiguration_dicttparent((s./tools/gyp/pylib/gyp/input.pyR��s		
cCs�dddddg}tjj|�}d|krGiid6|d<nd|kr�g|dj�D]#}|d|jd	�sd|^qd}t|�d
|d<nx�|dj�D]�}|d|}|jd	�r�q�ntj|�}g}	xS|D]K}
|
d}||kr#|
d }n|
}|t	kr�|	j
|
�q�q�Wx|	D]
}
||
=qPWt||||g�||d|<q�WxC|dj�D]1}|d|}|jd	�r�|d|=q�q�Wg}	xS|D]K}
|
d}||kr|
d }n|
}|t	kr�|	j
|
�q�q�Wx|	D]
}
||
=q2Wxe|dj�D]S}|d|}
x<|
j�D].}
|
tkrut
d|
||f��ququWqTWdS(
NR�R�R�R�R�RtDefaultRR�ii����s:%s not allowed in the %s configuration, found in target %s(RdReRiR�R5tsortedtkeysR�R�R�R4R�tinvalid_configuration_keysR(R�R�tkey_suffixesR)R>tconcreteR�told_configuration_dictR�tdelete_keysRTtkey_exttkey_baseR�((s./tools/gyp/pylib/gyp/input.pytSetUpConfigurationss\#



	




cCs�g}g}x|j�D]�\}}|d}|dkrM|dkrMqnt|t�s~t|d|d|jj�n|d }||kr�|j|�qnt||t�s�t|d|d|jjdidd6dd6|�n||kr|j|�qqWx|D]
}||=qWxB|D]:}||}	tdt|	��}
|d}||kr�xO||D]C}x:td	t|	��D]#}
||	|
kr�d	|
|
<q�q�Wq|W||=n|d}||kr�x�||D]�}|\}}t	j
|�}|d
kr$d	}n2|dkr9d}ntd
|d|d|�xYtd	t|	��D]B}
|	|
}|
|
|kr�qln|j|�rl||
|
<qlqlWq�W||=n|d}||kr�t|d|d|��ng}xRtt|
�ddd�D]4}
|
|
d	kr|j
d	|	|
�|	|
=qqWt|�d	kr5|||<q5q5WxX|j�D]J\}}t|t�r�t||�q�t|t�r�t||�q�q�WdS(s�Process regular expression and exclusion-based filters on lists.

  An exclusion list is in a dict key named with a trailing "!", like
  "sources!".  Every item in such a list is removed from the associated
  main list, which in this example, would be "sources".  Removed items are
  placed into a "sources_excluded" list in the dict.

  Regular expression (regex) filters are contained in dict keys named with a
  trailing "/", such as "sources/" to operate on the "sources" list.  Regex
  filters in a dict take the form:
    'sources/': [ ['exclude', '_(linux|mac|win)\.cc$'],
                  ['include', '_mac\.cc$'] ],
  The first filter says to exclude all files ending in _linux.cc, _mac.cc, and
  _win.cc.  The second filter then includes all files ending in _mac.cc that
  are now or were once in the "sources" list.  Items matching an "exclude"
  filter are subject to the same processing as would occur if they were listed
  by name in an exclusion list (ending in "!").  Items matching an "include"
  filter are brought back into the main list if previously excluded by an
  exclusion list or exclusion regex filter.  Subsequent matching "exclude"
  patterns can still cause items to be excluded after matching an "include".
  i����R�R�s key s must be list, not s when applying t	exclusiontregexitexcludeR}isUnrecognized action s in t	_excludedsD must not be present prior  to applying exclusion/regex filters for N(i����(RwR<RLRKRxR�R4R?R&R�RMRRRuRRRtProcessListFiltersInList(tnameRRtlistst	del_listsRTR�t	operationtlist_keytdel_listRetlist_actionstexclude_keytexclude_itemRWt	regex_keyt
regex_itemtactiontpatternt
pattern_retaction_valuet	list_itemtexcluded_keyt
excluded_list((s./tools/gyp/pylib/gyp/input.pyR\s�








		


#cCsSxL|D]D}t|t�r,t||�qt|t�rt||�qqWdS(N(R<RRRRLR�(R�ReR�((s./tools/gyp/pylib/gyp/input.pyR��s

cCs�d
}|jdd�}||krItd||dj|�f��n|jd	d
�r�|dkr�td||f��ndS(s�Ensures the 'type' field on the target is one of the known types.

  Arguments:
    target: string, name of target.
    target_dict: dict, target spec.

  Raises an exception on error.
  RR
R�R	R�R,s>Target %s has an invalid target type '%s'.  Must be one of %s.R�R'is_Target %s has type %s but standalone_static_library flag is only valid for static_library type.N(s
executablesloadable_modulesstatic_libraryR	snone(R5R3RRK(R�R�tVALID_TARGET_TYPESR�((s./tools/gyp/pylib/gyp/input.pytValidateTargetType	s	
c
Cs|jdd�dkrdS|jdg�}i}xi|D]a}tjj|�\}}|dk}|sqq;ntjj|�}	|j|	g�j|�q;Wd
}
xL|j�D]>\}	}t	|�dkr�|
d|	dj
|�f7}
q�q�W|
rd||
dGHtd��ndS(NR,R�R	Rs.cs.ccs.cpps.cxxs.ms.mms.ss.SR�is	  %s: %s
R�s<static library %s has several files with the same basename:
s4Some build systems, e.g. MSVC08, cannot handle that.s6Duplicate basenames in sources section, see list above(sstatic_librarysshared_library(s.cs.ccs.cpps.cxxs.ms.mms.ss.S(R5R3RZR[tsplitexttbasenameR~R4RwR?RKR(R�R�R)Rt	basenamestsourceR�R�tis_compiled_fileRR�R((s./tools/gyp/pylib/gyp/input.pytValidateSourcesInTarget	s&
	$cCs�i}i}|jdg�}xz|D]r}|d}||krZtd||f��n|||<|d}||kr�tdd||||d|f��n|||<d|kr�td||f��n|d}	g}
d	g}|j|�x{|D]s}xj|j|g�D]V}
tjj|
�\}}|jd
�rT|d}n||	kr|
j|
�qqWqWt|
�dkr%|
|d<q%q%Wd
S(s]Ensures that the rules sections in target_dict are valid and consistent,
  and determines which sources they apply to.

  Arguments:
    target: string, name of target.
    target_dict: dict, target spec containing "rules" and "sources" lists.
    extra_sources_for_rules: a list of keys to scan for rule matches in
        addition to 'sources'.
  R%t	rule_names&rule %s exists in duplicate, target %st	extensions-extension %s associated with multiple rules, starget %s rules %s and %strule_sourcess7rule_sources must not exist in input, target %s rule %sRRGiiN(	R5RRpRZR[RR�R4R?(R�R�textra_sources_for_rulest
rule_namestrule_extensionsR%truleRtrule_extensionRR	tsource_keyst
source_keyRtsource_roottsource_extension((s./tools/gyp/pylib/gyp/input.pytValidateRulesInTarget4	sD






	


cCs&|jd�}|jd�}|s(dSt|t�sPtd||f��n|jd�}|s~td||f��nt|t�s�td||f��n|jd�}|r�t|t�r�td||f��n|jd	�}|r"t|t�r"td
||f��ndS(NR)R&s>The 'run_as' in target %s from file %s should be a dictionary.R�sEThe 'run_as' in target %s from file %s must have an 'action' section.sCThe 'action' for 'run_as' in target %s from file %s must be a list.tworking_directorysPThe 'working_directory' for 'run_as' in target %s in file %s should be a string.tenvironmentsNThe 'environment' for 'run_as' in target %s in file %s should be a dictionary.(R5R<RRRRLR�(R�R�R)R)R&R�RR((s./tools/gyp/pylib/gyp/input.pytValidateRunAsInTargetm	s,c	Cs�|jd�}|jdg�}x�|D]�}|jd�}|sVtd|��n|jdd
�}|d
kr�td|��n|jd�}|r(|dr(td	|��q(q(Wd
S(s0Validates the inputs to the actions in a target.R)Rtaction_namesKAnonymous action in target %s.  An action must have an 'action_name' field.Rs"Action in target %s has no inputs.R�is%Empty action as command in target %s.N(R5RR3(	R�R�R)R)RR�RRtaction_command((s./tools/gyp/pylib/gyp/input.pytValidateActionsInTarget�	s

cCs�x�|j�D]�\}}t|t�rAt|�}|||<n8t|t�r]t|�nt|t�ryt|�nt|t�r
||t|�<||=q
q
WdS(sGGiven dict the_dict, recursively converts all integers into strings.
  N(titemsR<R
R�RRtTurnIntIntoStrInDictRLtTurnIntIntoStrInList(RRRR�((s./tools/gyp/pylib/gyp/input.pyR�	s


cCs�x�tdt|��D]j}||}t|t�rHt|�||<qt|t�rdt|�qt|t�rt|�qqWdS(sGGiven list the_list, recursively converts all integers into strings.
  iN(	R&R?R<R
R�RRRRLR(ReRWR�((s./tools/gyp/pylib/gyp/input.pyR�	s

cCs�i}x�|D]�}|jdd�\}}tjj|�\}}|sRd}n|d|}||kr�td|||||f��n|||<q
WdS(s�Verify that no two targets in the same directory share the same name.

  Arguments:
    targets: A list of targets in the form 'path/to/file.gyp:target_name'.
  t:iRGsHDuplicate target name "%s" in directory "%s" used both in "%s" and "%s".N(trsplitRZR[RR(R�tusedR�R[R�tsubdirRdRT((s./tools/gyp/pylib/gyp/input.pytVerifyNoCollidingTargets�	s
	c
Cstatj|d�tatj|d�|d}|da|da|d}	it�d6}
i}x�|D]�}tj	j
|�}yU|r�tjdIJt
||
|||||�nt||
|||||t�Wqutk
r}
tjj|
d	|��quXquWt|
�}t|�t|�t||
�x�|j�D]�\}}i}xMtD]E}x<dD]4}||}||krv||||<||=qvqvWqiWt||�x|D]}||||<q�WqPWt|�|r�t|�nt|�\}}t|�xYd
ddgD]H}t||||�x,|D]$}|||krK|||=qKqKWq+W|}|dr�t ||||d�nx=|D]5}||}tjj!|�}t"|t#||�q�Wx%|D]}||}t$||�q�Wx%|D]}||}t||�qWx=|D]5}||}tjj!|�}t"|t%||�q8Wx�|D]�}||}tjj!|�}t&||�d|j'dd
�kr�t(|||�nt)|||	�t*|||�t+|||�qxWt,|
�|||
gS(NRR�tgenerator_handles_variantst)generator_wants_absolute_build_file_pathst$generator_supports_multiple_toolsetsR
R�sUsing parallel processing.swhile trying to load %sR�R�R�R/R0R1t4generator_wants_static_library_dependencies_adjustedt#generator_wants_sorted_dependenciestarmttarget_arch(R�R�R�(-tbase_path_sectionsRRptbase_non_configuration_keysR�R�R�R�RZR[RqR�R�R�R�R�RcRdReRfRgRrR�R}RwRhRR�R�R�R!R�R�RiR�RR�RRR5RRRRR(tbuild_filesR.RiR�tgenerator_input_infoRktcircular_checktparallelR"R
RhR8R)RnR�R)R�ttmp_dictR�RkRTR�R�t
settings_typeR�tgii((s./tools/gyp/pylib/gyp/input.pytLoad�	s�


	



























(gtcompiler.astRRRRRRRR:R�t
gyp.commonRdR�toptparsetos.pathRZR�RR�RR�R�ttimeRR�RhR)RR�RRMRRR*R�R�RvR�R�R3R6RFR@RoRgRyR�R�R�RcR�tobjectR�R�R�R�R�R�R�RRR	RR�R�RRRR\R^RcR�R$RgRrR}R�R�R�R�R�R�R�R�R�R�R�R�R�RuR�R�RR�RRRRRRRR!R2(((s./tools/gyp/pylib/gyp/input.pyt<module>s				!			+	(		$	p	35	;								�.	V			o	"		'	E		
		
�	(	7		M	 H	c		T	�				9				
	

Zerion Mini Shell 1.0