%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/xcode_emulation.pyc

�
4�fQc@s�dZddlZddlZddlZddlZddlZddlZddlm	Z	de
fd��YZde
fd��YZd�Z
d	�Zd
�Zd�Zed�Zd
�Zd�Zd�Zed�Zed�ZdS(s~
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
i����N(tGypErrort
XcodeSettingscBs�eZdZiZd�Zd�Zd�Zd-d�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d �Z$d!�Z%d"�Z&d#�Z'd$�Z(d%�Z)d&�Z*d-d'�Z+d(�Z,d)�Z-e.d*�Z/d+�Z0d,�Z1RS(.s9A class that understands the gyp 'xcode_settings' object.cCsq||_i|_|d}x3|j�D]%\}}|jdi�|j|<q)Wd|_tjd�|_dS(Ntconfigurationstxcode_settingss^lib([^/]+)\.(a|dylib)$(	tspecRt	iteritemstgettNonet
confignametretcompilet
library_re(tselfRtconfigsRtconfig((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt__init__s		
	cCs|jst�|j|jS(N(RtAssertionErrorR(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt	_Settings+scCs|j�j||�|kS(N(RR(Rttest_keytcond_keytdefault((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_Test/scCsZ||j�kr6|j|t|j�|��n |rV|j|t|��ndS(N(Rtappendtstr(RtlstRt
format_strR((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_Appendf2s$cCs"||j�krd|GHndS(Ns/Warning: Ignoring not yet implemented key "%s".(R(RR((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_WarnUnimplemented8scCst|jjdd��dkS(Nt
mac_bundlei(tintRR(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt	_IsBundle<scCs%|j�st�|jddd�S(sPReturns the framework version of the current target. Only valid for
    bundles.tFRAMEWORK_VERSIONRtA(RRtGetPerTargetSetting(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetFrameworkVersion?scCs�|j�st�|jddkrpidd6dd6|jd}|jdd|�}d|jjd	|�S|jdd
kr�dSts�td|jd|jd
f��dS(s[Returns the bundle extension (.app, .framework, .plugin, etc).  Only
    valid for bundles.ttypetloadable_moduletshared_librarytbundlet	frameworktWRAPPER_EXTENSIONRt.tproduct_extensiont
executables.apps*Don't know extension for '%s', target '%s'ttarget_nameN(sloadable_modulesshared_library(RRRR!RtFalse(Rtdefault_wrapper_extensiontwrapper_extension((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetWrapperExtensionEscCs|jjd|jd�S(sReturns PRODUCT_NAME.tproduct_nameR,(RR(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetProductNameWscCs$|j�r|j�S|j�SdS(sReturns FULL_PRODUCT_NAME.N(RtGetWrapperNamet_GetStandaloneBinaryPath(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetFullProductName[s
cCs&|j�st�|j�|j�S(s`Returns the directory name of the bundle represented by this target.
    Only valid for bundles.(RRR2R0(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pyR3bscCsd|j�st�|jddkrGtjj|j�d|j��Stjj|j�d�SdS(s�Returns the qualified path to the bundle's contents folder. E.g.
    Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.R#R%tVersionstContentsN(RRRtostpathtjoinR3R"(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetBundleContentsFolderPathhs
	cCs+|j�st�tjj|j�d�S(s}Returns the qualified path to the bundle's resource folder. E.g.
    Chromium.app/Contents/Resources. Only valid for bundles.t	Resources(RRR8R9R:R;(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetBundleResourceFoldersscCs^|j�st�|jddkr>tjj|j�d�Stjj|j�dd�SdS(syReturns the qualified path to the bundle's plist file. E.g.
    Chromium.app/Contents/Info.plist. Only valid for bundles.R#R+R$s
Info.plistR<N(s
executablesloadable_module(RRRR8R9R:R;(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetBundlePlistPathys
cCs_|j�r0idd6dd6dd6|jdSidd6d	d6d	d6d
d6|jdSdS(
s(Returns the PRODUCT_TYPE of this target.s"com.apple.product-type.applicationR+scom.apple.product-type.bundleR$s com.apple.product-type.frameworkR%R#scom.apple.product-type.tools&com.apple.product-type.library.dynamics%com.apple.product-type.library.statictstatic_libraryN(RR(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetProductType�scCsO|j�r$|jddkr$dSidd6dd6dd6d	d
6|jdS(s'Returns the MACH_O_TYPE of this target.R#R+tt
mh_executet	staticlibR?tmh_dylibR%t	mh_bundleR$(RR(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetMachOType�s cCs~|j�st�|jddkr4|j�}n1|jddkretjj|j�d�}ntjj||j��S(sReturns the name of the bundle binary of by this target.
    E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.R#R%R+R$tMacOS(s
executablesloadable_module(RRRR;R8R9R:tGetExecutableName(RR9((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_GetBundleBinaryPath�scCsId|jkrd|jdSidd6dd6dd6d	d
6|jdS(NR*R)RAR+s.aR?s.dylibR%s.soR$R#(R(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_GetStandaloneExecutableSuffix�scCs:|jjdidd6dd6dd6dd6|jd�S(	Ntproduct_prefixRAR+tlibR?R%R$R#(RR(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_GetStandaloneExecutablePrefix�scCs�|j�st�|jddks=td|jd��|jd}|jddkr}|d d	kr�|d}q�n3|jddkr�|d d	kr�|d}q�n|j�}|jjd
|�}|j�}|||S(
swReturns the name of the non-bundle binary represented by this target.
    E.g. hello_world. Only valid for non-bundles.R#R+R%R?R$sUnexpected type %sR,iRLR1(s
executablesshared_librarysstatic_librarysloadable_module(sloadable_modulesshared_library(RRRRMRRJ(Rttargett
target_prefixt
target_ext((s(./tools/gyp/pylib/gyp/xcode_emulation.pyR4�s

cCs4|j�r&|jjd|jd�S|j�SdS(sXReturns the executable name of the bundle represented by this target.
    E.g. Chromium.R1R,N(RRRR4(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pyRH�scCs$|j�r|j�S|j�SdS(ssReturns the directory name of the bundle represented by this target. E.g.
    Chromium.app/Contents/MacOS/Chromium.N(RRIR4(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetExecutablePath�s
cCs�tjddd||gdtjdtj�}|j�d}|jdkrytjj|d�t	d|j��n|j
d�S(	Nt
xcodebuilds-versions-sdktstdouttstderris
sError %d running xcodebuild(t
subprocesstPopentPIPEtSTDOUTtcommunicatet
returncodetsysRTtwriteRtrstrip(Rtsdktinfoitemtjobtout((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_GetSdkVersionInfoItem�s	cCsK|jddd�}|tjkr@|j|d�tj|<ntj|S(NtSDKROOTRtmacosxtPath(R!Rt_sdk_path_cacheRb(Rtsdk_root((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_SdkPath�s
cCs�|j|dd�d|j�kr~tjj|j��}|j�jd�rh|j|dd�q~|j|dd�ndS(NtMACOSX_DEPLOYMENT_TARGETs-mmacosx-version-min=%stIPHONEOS_DEPLOYMENT_TARGETtiphonesimulators-mios-simulator-version-min=%ss-miphoneos-version-min=%s(RRR8R9tbasenameRhtlowert
startswith(RRtsdk_path_basename((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_AppendPlatformVersionMinFlags�s
c	Cs7||_g}|j�}d|j�krA|jd|�n|jdddd�ri|jd�n|jdddd�r�|jd	�n|jd
ddd�r�|jd�nd|j�kr�|j�ddkr�|jd
�q�n|jdddd�r|jd�n|j|dddd�|jdddd�r�|j�jdd�}|dkr�|jd�q�|dkr�td��q�|dkr�|jd�q�td|��n|jdddd�r�|jd�n|jdddd�r|jd�n|jdddd�rC|jd �n|j|�|jd!ddd�rx|j	d!�n|j	d"�|j	d#�|j	d$�|j	d%�|j�jd&d'g�}t
|�d(kr�|j	d&�d'g}n|jd)|d*�|d*d9kr�|jd,ddd�r?|jd-�n|jd.ddd�rg|jd/�n|jd0ddd�r�|jd1�n|jd2ddd�r�|jd3�q�n||j�jd4g�7}|jd5|j}|jd6g�}x+|D]#}|jd7|jd8|��qWd:|_|S(;sMReturns flags that need to be added to .c, .cc, .m, and .mm
    compilations.Rcs-isysroot %stCLANG_WARN_CONSTANT_CONVERSIONtYESRtNOs-Wconstant-conversiontGCC_CHAR_IS_UNSIGNED_CHARs-funsigned-chartGCC_CW_ASM_SYNTAXs-fasm-blockstGCC_DYNAMIC_NO_PICs-mdynamic-no-pictGCC_ENABLE_PASCAL_STRINGSs-mpascal-stringstGCC_OPTIMIZATION_LEVELs-O%ststGCC_GENERATE_DEBUGGING_SYMBOLStDEBUG_INFORMATION_FORMATtdwarfs	-gdwarf-2tstabss(stabs debug format is not supported yet.sdwarf-with-dsymsUnknown debug format %stGCC_SYMBOLS_PRIVATE_EXTERNs-fvisibility=hiddentGCC_TREAT_WARNINGS_AS_ERRORSs-WerrortGCC_WARN_ABOUT_MISSING_NEWLINEs
-Wnewline-eoftCOPY_PHASE_STRIPtGCC_DEBUGGING_SYMBOLStGCC_ENABLE_OBJC_EXCEPTIONStMACH_O_TYPEtPRODUCT_TYPEtARCHSti386is-arch itx86_64tGCC_ENABLE_SSE3_EXTENSIONSs-msse3t)GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONSs-mssse3tGCC_ENABLE_SSE41_EXTENSIONSs-msse4.1tGCC_ENABLE_SSE42_EXTENSIONSs-msse4.2tWARNING_CFLAGSRtmac_framework_dirss-Fs
$(SDKROOT)(R�R�N(RRhRRRRRtNotImplementedErrorRpRtlenRtreplaceR(	RRtcflagsRgt
dbg_formattarchsRtframework_dirst	directory((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt	GetCflags�sz	





	
!	cCsK||_g}|j|dd�||j�jdg�7}d|_|S(s?Returns flags that need to be added to .c, and .m compilations.tGCC_C_LANGUAGE_STANDARDs-std=%stOTHER_CFLAGSN(RRRRR(RRtcflags_c((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt
GetCflagsC^s		cCs�||_g}|j�jd�}|r>|jd|�n|j|dd�|jdddd�ry|jd	�n|jd
ddd�r�|jd�n|jdddd�r�|jd
�n|jdddd�r�|jd�n|jdddd�r|jd�ng}xp|j�jddg�D]S}|dkrVd}n|dkr�||j�jdg�7}q;|j|�q;W||7}d|_|S(sAReturns flags that need to be added to .cc, and .mm compilations.tCLANG_CXX_LANGUAGE_STANDARDs-std=%stCLANG_CXX_LIBRARYs
-stdlib=%stGCC_ENABLE_CPP_RTTIRsRRrs	-fno-rttitGCC_ENABLE_CPP_EXCEPTIONSs-fno-exceptionstGCC_INLINES_ARE_PRIVATE_EXTERNs-fvisibility-inlines-hiddentGCC_THREADSAFE_STATICSs-fno-threadsafe-staticst%GCC_WARN_ABOUT_INVALID_OFFSETOF_MACROs-Wno-invalid-offsetoftOTHER_CPLUSPLUSFLAGSs$(inherited)s
$inheriteds${inherited}s
$OTHER_CFLAGSs$(OTHER_CFLAGS)s${OTHER_CFLAGS}R�(s
$inheriteds$(inherited)s${inherited}(s
$OTHER_CFLAGSs$(OTHER_CFLAGS)s${OTHER_CFLAGS}N(RRRRRRR(RRt	cflags_cctclang_cxx_language_standardt
other_ccflagstflag((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetCflagsCCgs6		"	
	cCsT|j�jdd�}|dkr4|jd�n|dkrP|jd�ndS(NtGCC_ENABLE_OBJC_GCtunsupportedt	supporteds	-fobjc-gctrequireds-fobjc-gc-only(RRR(Rtflagst	gc_policy((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt$_AddObjectiveCGarbageCollectionFlags�s
cCs)||_g}|j|�d|_|S(s7Returns flags that need to be added to .m compilations.N(RR�R(RRtcflags_objc((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt
GetCflagsObjC�s
	
	cCsQ||_g}|j|�|jdddd�rD|jd�nd|_|S(s8Returns flags that need to be added to .mm compilations.tGCC_OBJC_CALL_CXX_CDTORSRrRRss-fobjc-call-cxx-cdtorsN(RR�RRR(RRtcflags_objcc((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetCflagsObjCC�s	
	cCsa|jddkr6|jddks2|j�r6dS|jdd|j�rTdnd�}|S(	s/Return DYLIB_INSTALL_NAME_BASE for this target.R#R%R$tDYLIB_INSTALL_NAME_BASERs/Library/Frameworkss/usr/local/libN(RRRR!(Rtinstall_base((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetInstallNameBase�scCsqd|krmd|}}|jd�rC|jdd�\}}ntjj|�}tjj||�}n|S(s(Do :standardizepath processing for path.t/RAt@i(RntsplitR8R9tnormpathR:(RR9tprefixtrest((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_StandardizePath�s
cCs/|jddkr6|jddks2|j�r6dSd}|jdd|�}d|kr+|d|fks�td	|jd
|f��|jd|j|j���}|j�r�|jd|j��}|jd
|j	��}n$d|ks�t�d
|kst�|jd|j
��}n|S(s-Return LD_DYLIB_INSTALL_NAME for this target.R#R%R$s=$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)tLD_DYLIB_INSTALL_NAMERt$sJ$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(WRAPPER_NAME)/$(PRODUCT_NAME)s\Variables in LD_DYLIB_INSTALL_NAME are not generally supported yet in target '%s' (got '%s')R,s*$(DYLIB_INSTALL_NAME_BASE:standardizepath)s$(WRAPPER_NAME)s$(PRODUCT_NAME)s$(EXECUTABLE_PATH)N(RRRR!RR�R�R�R3R2RQ(Rtdefault_install_nametinstall_name((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetInstallName�s0c	Cs�d}d}d|gd|gd|gd|||gg}xy|D]q}tjddj|��}|j|�}|rC||jd	� ||jd	��||jd	�}qCqCW|jd
�r�d
||td
��}n|S(suChecks if ldflag contains a filename and if so remaps it from
    gyp-directory-relative to build-directory-relative.s(\S+)s\S+s-exported_symbols_lists-unexported_symbols_lists-reexported_symbols_lists-sectcreates	(?:-Wl,)?s[ ,]is-L(	R	R
R:tmatchtstarttgrouptendRnR�(	Rtldflagtgyp_to_build_pathtLINKER_FILEtWORDtlinker_flagstflag_patterntregextm((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_MapLinkerFlagFilename�s			
#c
Cs�||_g}x9|j�jdg�D]}|j|j||��q(W|jdddd�rs|jd�n|jdddd�r�|jd�n|j|d	d
�|j|dd�|j|�d
|j�kr�|jd|j��nx7|j�jdg�D]}|jd||��qWd|j�krj|jd"||j�d��n|j�jddg�}t	|�dkr�|j
d�dg}n|jd|d�|jd|�|j�}|r|jd|jdd��nx1|j�jdg�D]}	|jd|	�q!W|j
d|j}
|
jdg�}x1|D])}|jd |jd!|j���qiWd#|_|S($s�Returns flags that need to be passed to the linker.

    Args:
        configname: The name of the configuration to get ld flags for.
        product_dir: The directory where products such static and dynamic
            libraries are placed. This is added to the library search path.
        gyp_to_build_path: A function that converts paths relative to the
            current gyp file to paths relative to the build direcotry.
    t
OTHER_LDFLAGStDEAD_CODE_STRIPPINGRrRRss-Wl,-dead_stript
PREBINDINGs-Wl,-prebindtDYLIB_COMPATIBILITY_VERSIONs-compatibility_version %stDYLIB_CURRENT_VERSIONs-current_version %sRcs
-isysroot tLIBRARY_SEARCH_PATHSs-Lt
ORDER_FILEs-Wl,-order_file s-Wl,R�R�is-arch is-install_name t s\ tLD_RUNPATH_SEARCH_PATHSs-Wl,-rpath,RR�s-Fs
$(SDKROOT)s-Wl,-order_file -Wl,N(RRRRR�RRRpRhR�RR�R�RR(
RRtproduct_dirR�tldflagsR�tlibrary_pathR�R�trpathRR�R�((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt
GetLdflagssL
	



 
'	cCsL||_g}x-|j�jdg�D]}|j|�q(Wd|_|S(s�Returns flags that need to be passed to the static linker.

    Args:
        configname: The name of the configuration to get ld flags for.
    R�N(RRRRR(RRtlibtoolflagstlibtoolflag((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetLibtoolflagsGs		cCs�t}i}x�t|jj��D]x}|rJt|j|�}t}q"xM|j|j�D]8\}}||kr|q^q^|||kr^||=q^q^Wq"W|S(s~Gets a list of all the per-target settings. This will only fetch keys
    whose values are the same across all configurations.(tTruetsortedRtkeystdictR-R(Rt
first_passtresultRtkeytvalue((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetPerTargetSettingsWs	 cCs�t}d}x~t|jj��D]g}|rP|j|j|d�}t}q"||j|j|d�ks"td|tdf��q"W|dkr�|S|S(s�Tries to get xcode_settings.setting from spec. Assumes that the setting
       has the same value in all configurations and throws otherwise.sHExpected per-target setting for '%s', got per-config setting (target %s)R,N(	R�RR�RR�RR-RR(RtsettingRR�R�R((s(./tools/gyp/pylib/gyp/xcode_emulation.pyR!hs	"c	Cs*||_g}|jdddd�r|jdddd�rd}|j�rZd}n|jdd	krvd
}n|j�jd|�}idd
6d
d6dd6|}|j�jdd�}|r�|dt|�7}n|s|jd|jd�n|jd||f�nd|_|S(s�Returns a list of shell commands that contain the shell commands
    neccessary to strip this target's binary. These should be run as postbuilds
    before the actual postbuilds run.tDEPLOYMENT_POSTPROCESSINGRrRRstSTRIP_INSTALLED_PRODUCTt	debuggings
non-globalR#R+talltSTRIP_STYLERAs-xs-St
STRIPFLAGSR�secho STRIP\(%s\)R,sstrip %s %sN(	RRRRRRt_NormalizeEnvVarReferencesRR(	RRt
output_binarytquietR�tdefault_strip_styletstrip_styletstrip_flagstexplicit_strip_flags((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_GetStripPostbuildsys.				cCs�||_g}|jdddd�r�|jdddd�r�|jddkr�|ss|jd	|jd
�n|jd||df�nd
|_|S(s�Returns a list of shell commands that contain the shell commands
    neccessary to massage this target's debug information. These should be run
    as postbuilds before the actual postbuilds run.RzRrRR{sdwarf-with-dsymR|R#R?secho DSYMUTIL\(%s\)R,sdsymutil %s -o %ss.dSYMN(RRRRR(RRtoutputR�R�R�((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_GetDebugInfoPostbuilds�s		cCs)|j||||�|j|||�S(s�Returns a list of shell commands that contain the shell commands
    to run as postbuilds for this target, before the actual postbuilds.(R�R�(RRR�R�R�((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetTargetPostbuilds�scCs�|jd�r8dtjjtjj|��d}n4|jj|�}|rfd|jd�}n|}|jd|j	��S(Ns
.frameworks-framework is-lis
$(SDKROOT)(
tendswithR8R9tsplitextRlRR�R�R�Rh(RtlibrarytlR�((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_AdjustLibrary�s)cCs&g|D]}|j|�^q}|S(s�Transforms entries like 'Cocoa.framework' in libraries into entries like
    '-framework Cocoa', 'libcrypto.dylib' into '-lcrypto', etc.
    (R(Rt	librariesR�((s(./tools/gyp/pylib/gyp/xcode_emulation.pytAdjustLibraries�s"N(2t__name__t
__module__t__doc__RfRRRRRRRR"R0R2R5R3R;R=R>R@RFRIRJRMR4RHRQRbRhRpR�R�R�R�R�R�R�R�R�R�R�R�R�R!R�R�R-R�RR(((s(./tools/gyp/pylib/gyp/xcode_emulation.pyRs\													
			
	
	
				
			`			)		
	
			&		C			"		tMacPrefixHeadercBs;eZdZd�Zd�Zd�Zd�Zd�ZRS(s�A class that helps with emulating Xcode's GCC_PREFIX_HEADER feature.

  This feature consists of several pieces:
  * If GCC_PREFIX_HEADER is present, all compilations in that project get an
    additional |-include path_to_prefix_header| cflag.
  * If GCC_PRECOMPILE_PREFIX_HEADER is present too, then the prefix header is
    instead compiled, and all other compilations in the project get an
    additional |-include path_to_compiled_header| instead.
    + Compiled prefix headers have the extension gch. There is one gch file for
      every language used in the project (c, cc, m, mm), since gch files for
      different languages aren't compatible.
    + gch files themselves are built with the target's normal cflags, but they
      obviously don't get the |-include| flag. Instead, they need a -x flag that
      describes their language.
    + All o files in the target need to depend on the gch file, to make sure
      it's built before any o file is built.

  This class helps with some of these tasks, but it needs help from the build
  system for writing dependencies to the gch files, for writing build commands
  for the gch files, and for figuring out the location of the gch files.
  cCs�d	|_t|_|rK|jd�|_|jddd�dk|_ni|_|jr�|jr�x6ddddgD]}||j|�|j|<qyWn||j�|_nd	S(
sIf xcode_settings is None, all methods on this class are no-ops.

    Args:
        gyp_path_to_build_path: A function that takes a gyp-relative path,
            and returns a path relative to the build directory.
        gyp_path_to_build_output: A function that takes a gyp-relative path and
            a language code ('c', 'cc', 'm', or 'mm'), and that returns a path
            to where the output of precompiling that path for that language
            should be placed (without the trailing '.gch').
    tGCC_PREFIX_HEADERtGCC_PRECOMPILE_PREFIX_HEADERRRstctccR�tmmN(RtheaderR-tcompile_headersR!tcompiled_headers(RRtgyp_path_to_build_pathtgyp_path_to_build_outputtlang((s(./tools/gyp/pylib/gyp/xcode_emulation.pyR�s					cCsC|jr'||jkr'd|j|S|jr;d|jSdSdS(sAGets the cflags to include the prefix header for language |lang|.s-include %sRAN(RRR
(RR((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt
GetInclude�s
	cCs|jst�|j|dS(sFReturns the actual file name of the prefix header for language |lang|.s.gch(RRR(RR((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_GchscCs�|js|jrgSg}x�t||�D]�\}}tjj|�d}idd6dd6dd6dd6dd	6d
d6j|d�}|r.|j|||j	|�f�q.q.W|S(
sGiven a list of source files and the corresponding object files, returns
    a list of (source, object, gch) tuples, where |gch| is the build-directory
    relative path to the gch file each object file depends on.  |compilable[i]|
    has to be the source file belonging to |objs[i]|.iR
s.cRs.cpps.ccs.cxxR�s.mRs.mmN(
R
RtzipR8R9R�RRRR(RtsourcestobjsR�tsourcetobjtextR((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetObjDependencies	s
&cCs�|js|jrgS|jd�dd|jf|jd�dd|jf|jd�dd|jf|jd�dd|jfgS(	s�Returns [(path_to_gch, language_flag, language, header)].
    |path_to_gch| and |header| are relative to the build directory.
    R
s-x c-headerRs
-x c++-headerR�s-x objective-c-headerRs-x objective-c++-header(R
RR(R((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetPchBuildCommandss(RRRRRRRR(((s(./tools/gyp/pylib/gyp/xcode_emulation.pyR�s					cCsg|jdi�}xN|dj�D]<}d|kr#|j�}|j|d�||d<q#q#WdS(s�Merges the global xcode_settings dictionary into each configuration of the
  target represented by spec. For keys that are both in the global and the local
  xcode_settings dict, the local key gets precendence.
  RRN(Rtvaluestcopytupdate(tglobal_dictRtglobal_xcode_settingsRtnew_settings((s(./tools/gyp/pylib/gyp/xcode_emulation.pytMergeGlobalXcodeSettingsToSpec,scCs[t|jdd��dko'|dk}|rW|ddksWtd|d��n|S(s�Returns if |spec| should be treated as a bundle.

  Bundles are directories with a certain subdirectory structure, instead of
  just a single file. Bundle rules do not produce a binary but also package
  resources into that directory.RitmacR#tnones6mac_bundle targets cannot have type none (target "%s")R,(RRR(tflavorRt
is_mac_bundle((s(./tools/gyp/pylib/gyp/xcode_emulation.pytIsMacBundle<s*ccs�tjj||j��}x�|D]�}|}d|ksJtd|��tjj|�}tjj|d�}|djd�r�tjj||d�}ntjj||d�}|jd�r�|dd!d}n||fVq"Wd	S(
svYields (output, resource) pairs for every resource in |resources|.
  Only call this for mac bundle targets.

  Args:
      product_dir: Path to the directory containing the output bundle,
          relative to the build directory.
      xcode_settings: The XcodeSettings of the current target.
      resources: A list of bundle resources, relative to the build directory.
  R�s/Spaces in resource filenames not supported (%s)iis.lprojs.xibi����tnibN(R8R9R:R=RR�R�(R�Rt	resourcestdesttresR�t	res_partstlproj_parts((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetMacBundleResourcesJs


cCs�|jd�}|s%d
d
gifSd|ksAtd|��||�}|jddd�dkr�tj|jddd	��}ng}tjj||j��}|j	�}||||fS(s(Returns (info_plist, dest_plist, defines, extra_env), where:
  * |info_plist| is the sourc plist path, relative to the
    build directory,
  * |dest_plist| is the destination plist path, relative to the
    build directory,
  * |defines| is a list of preprocessor defines (empty if the plist
    shouldn't be preprocessed,
  * |extra_env| is a dict of env variables that should be exported when
    invoking |mac_tool copy-info-plist|.

  Only call this for mac bundle targets.

  Args:
      product_dir: Path to the directory containing the output bundle,
          relative to the build directory.
      xcode_settings: The XcodeSettings of the current target.
      gyp_to_build_path: A function that converts paths relative to the
          current gyp file to paths relative to the build direcotry.
  tINFOPLIST_FILER�s1Spaces in Info.plist filenames not supported (%s)tINFOPLIST_PREPROCESSRRsRrt"INFOPLIST_PREPROCESSOR_DEFINITIONSRAN(
R!RRtshlexR�R8R9R:R>R�(R�RRt
info_plisttdefinest
dest_plistt	extra_env((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetMacInfoPlistos
cCs�|s
iS|j}i|d6|d6|j�d6|d6dd6|d6dd	6}|jd
�rr|j�|d
<n
d|d
<|ddkr�|j�|d<|j�|d<|j�|d<|j�}|r�||d<n|j�|d<n|j	�r=|j
�|d<|j�|d<|j�|d<|j
�|d<n|j�}|r\||d<n|j�}	|	r{|	|d<n|s�i}n>x;|D]3}
t||
t�s�dj||
�||
<q�q�W|j|�x"|D]}
t||
�||
<q�W|S(s�Return the environment variables that Xcode would set. See
  http://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-SW153
  for a full list.

  Args:
      xcode_settings: An XcodeSettings object. If this is None, this function
          returns an empty dict.
      built_products_dir: Absolute path to the built products dir.
      srcroot: Absolute path to the source root.
      configuration: The build configuration name.
      additional_settings: An optional dict with more values to add to the
          result.
  tBUILT_PRODUCTS_DIRt
CONFIGURATIONtPRODUCT_NAMEtSRCROOTs
${SRCROOT}tSOURCE_ROOTtTARGET_BUILD_DIRs	${TMPDIR}tTEMP_DIRRcRAR#R+R?R%R$tEXECUTABLE_NAMEtEXECUTABLE_PATHtFULL_PRODUCT_NAMER�R�tCONTENTS_FOLDER_PATHt!UNLOCALIZED_RESOURCES_FOLDER_PATHtINFOPLIST_PATHtWRAPPER_NAMER�R�R�(s
executablesstatic_librarysshared_librarysloadable_module(RR2R!RhRHRQR5RFR@RR;R=R>R3R�R�t
isinstanceRR:RR�(Rtbuilt_products_dirtsrcroott
configurationtadditional_settingsRtenvtmach_o_typeR�tinstall_name_basetk((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_GetXcodeEnv�sV	


	


	


cCs~tjdd|�}tjd|�}xP|D]H}|\}}d|ks\td|��|j|d|d�}q.W|S(s�Takes a string containing variable references in the form ${FOO}, $(FOO),
  or $FOO, and returns a string with all variable references in the form ${FOO}.
  s\$([a-zA-Z_][a-zA-Z0-9_]*)s${\1}s(\$\(([a-zA-Z0-9\-_]+)\))s$(s#$($(FOO)) variables not supported: s${t}(R	tsubtfindallRR�(RtmatchesR�t
to_replacetvariable((s(./tools/gyp/pylib/gyp/xcode_emulation.pyR��s
cCskxdt|�D]V\}}|jd|d|�}|jd|d|�}|jd||�}q
W|S(sExpands ${VARIABLES}, $(VARIABLES), and $VARIABLES in string per the
  expansions list. If the variable expands to something that references
  another variable, this variable is expanded as well if it's in env --
  until no variables present in env are left.s${RQs$(t)R�(treversedR�(tstringt
expansionsROtv((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt
ExpandEnvVars�s
cs�tjd����fd�}y-tjj�j�|�}|j�|SWn2tjjk
r�}tdt	|j
���nXdS(sTakes a dict |env| whose values are strings that can refer to other keys,
  for example env['foo'] = '$(bar) and $(baz)'. Returns a list L of all keys of
  env such that key2 is after key1 in L if env[key2] refers to env[key1].

  Throws an Exception in case of dependency cycles.
  s\$\{([a-zA-Z0-9\-_]+)\}csitg�j�|�D]}|�kr|^q�}x*|D]"}d|ks?td|��q?W|S(Ns${s Nested variables not supported: (tsetRSR(tnodeR[RTtdependee(RLR�(s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetEdgess8
 s6Xcode environment variables are cyclically dependent: N(R	R
tgyptcommontTopologicallySortedR�treverset
CycleErrorRRtnodes(RLR`torderte((RLR�s(./tools/gyp/pylib/gyp/xcode_emulation.pyt_TopologicallySortedEnvVarKeys	s

cCs?t|||||�}gt|�D]}|||f^q%S(N(RPRi(RRHRIRJRKRLR�((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetSortedXcodeEnv+s	cCslg}x_|jdg�D]K}|sG|jd|d|df�n|jtjj|d��qW|S(s_Returns the list of postbuilds explicitly defined on |spec|, in a form
  executable by a shell.t
postbuildssecho POSTBUILD\(%s\) %sR,tpostbuild_nametaction(RRRaRbtEncodePOSIXShellList(RR�Rkt	postbuild((s(./tools/gyp/pylib/gyp/xcode_emulation.pytGetSpecPostbuildCommands2s	!(Rt
gyp.commonRatos.pathR8R	R3RUR[RtobjectRRR#R(R/R8RRPR�R\RiRjR-Rp(((s(./tools/gyp/pylib/gyp/xcode_emulation.pyt<module>s*���c			%	0M			#

Zerion Mini Shell 1.0