Rac@sdZddlmZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddlm Z eekZeaeaedZdefdYZdZd efd YZd efd YZd ZdZdZdZdZdZdZ dZ!edZ"dZ#dZ$dZ%edZ&e'dZ(dZ)dZ*dZ+dS(s~ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. i(tprint_functionN(tGypErrorcCs$i|d6}|r ||dd7Z?d8Z@ge=d9ZAd@d:ZBd@d;ZCd<ZDd=ZEd@d>ZFd?ZGRS(As9A class that understands the gyp 'xcode_settings' object.cCs||_t|_i|_|d}xe|jD]W\}}|jdi|j|<|j||j|jddr2t|_q2q2Wd|_ t j d|_ dS(Ntconfigurationstxcode_settingstIPHONEOS_DEPLOYMENT_TARGETs^lib([^/]+)\.(a|dylib)$( tspectFalsetisIOSR7titemstgett_ConvertConditionalKeystNonetTruet confignameR'R(t library_re(R R9tconfigsRAtconfig((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRs       cCs|j|}g|D]}|jdr|^q}xp|D]h}|jdr|jdr|jdd}||||s ( cCs|jst|j|jS(N(RAtAssertionErrorR7(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt _SettingsscCs|jj|||kS(N(RPR=(R ttest_keytcond_keyR ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_TestscCsZ||jkr6|j|t|j|n |rV|j|t|ndS(N(RPRtstr(R tlstRQt format_strR ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_Appendfs$cCs'||jkr#td|ndS(Ns/Warning: Ignoring not yet implemented key "%s".(RPR(R RQ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_WarnUnimplementedscCs8|jrdnd}|j|jd|}|dkS(NtbinarytxmltINFOPLIST_OUTPUT_FORMAT(R;R7R=(R RAR tformat((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytIsBinaryOutputFormats cCst|jjdddkS(Nt mac_bundlei(tintR9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt _IsBundlescCst|jjdddkS(Ntios_app_extensioni(R_R9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_IsIosAppExtensionscCst|jjdddkS(Ntios_watchkit_extensioni(R_R9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_IsIosWatchKitExtensionscCst|jjdddkS(Nt ios_watch_appi(R_R9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_IsIosWatchAppscCst|jjdddkS(Ntmac_xctest_bundlei(R_R9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt _IsXCTestscCs%|jst|jdddS(sPReturns the framework version of the current target. Only valid for bundles.tFRAMEWORK_VERSIONR tA(R`ROtGetPerTargetSetting(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetFrameworkVersionscCs|jst|jddkrpidd6dd6|jd}|jdd|}d|jjd |S|jdd kr|js|jrd|jjd d Sd|jjd d Sn*tstd |jd|jdfdS(s[Returns the bundle extension (.app, .framework, .plugin, etc). Only valid for bundles.ttypetloadable_moduletshared_librarytbundlet frameworktWRAPPER_EXTENSIONR t.tproduct_extensiont executabletappextapps*Don't know extension for '%s', target '%s't target_nameN(RnRo(R`ROR9RkR=RbRdR:(R tdefault_wrapper_extensiontwrapper_extension((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetWrapperExtensions cCs|jjd|jdS(sReturns PRODUCT_NAME.t product_nameRx(R9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetProductNamescCs$|jr|jS|jSdS(sReturns FULL_PRODUCT_NAME.N(R`tGetWrapperNamet_GetStandaloneBinaryPath(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetFullProductNames  cCs&|jst|j|jS(s`Returns the directory name of the bundle represented by this target. Only valid for bundles.(R`ROR}R{(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyR~scCsw|jr|jS|js%t|jddkrZtjj|jd|jStjj|jdSdS(sReturns the qualified path to the bundle's contents folder. E.g. Chromium.app/Contents or Foo.bundle/Versions/A. Only valid for bundles.RmRotVersionstContentsN( R;R~R`ROR9tostpathRJRl(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetBundleContentsFolderPaths   cCs>|jst|jr%|jStjj|jdS(s}Returns the qualified path to the bundle's resource folder. E.g. Chromium.app/Contents/Resources. Only valid for bundles.t Resources(R`ROR;RRRRJ(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetBundleResourceFolder,s  cCs^|jst|jddkr>tjj|jdStjj|jddSdS(syReturns the qualified path to the bundle's plist file. E.g. Chromium.app/Contents/Info.plist. Only valid for bundles.RmRuRns Info.plistRN(RuRn(R`ROR9RRRJR(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetBundlePlistPath4s cCs|jr3|js/td|jddS|jrf|jsbtd|jddS|jr|jstd|jddS|jridd 6d d 6d d 6|jdSidd 6dd 6dd 6dd6|jdSdS(s(Returns the PRODUCT_TYPE of this target.s6ios_app_extension flag requires mac_bundle (target %s)Rxs$com.apple.product-type.app-extensions;ios_watchkit_extension flag requires mac_bundle (target %s)s)com.apple.product-type.watchkit-extensions2ios_watch_app flag requires mac_bundle (target %s)s+com.apple.product-type.application.watchapps"com.apple.product-type.applicationRuscom.apple.product-type.bundleRns com.apple.product-type.frameworkRoRmscom.apple.product-type.tools&com.apple.product-type.library.dynamics%com.apple.product-type.library.statictstatic_libraryN(RbR`ROR9RdRf(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetProductType>s0     cCsO|j r$|jddkr$dSidd6dd6dd6d d 6|jdS( s'Returns the MACH_O_TYPE of this target.RmRuR t mh_executet staticlibRtmh_dylibRot mh_bundleRn(R`R9(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt GetMachOTypeZs cCs|jst|jddks.|jr=|j}n1|jddkrntjj|jd}ntjj||jS(sReturns the name of the bundle binary of by this target. E.g. Chromium.app/Contents/MacOS/Chromium. Only valid for bundles.RmRoRuRntMacOS(RuRn( R`ROR9R;RRRRJtGetExecutableName(R R((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetBundleBinaryPathfs cCsId|jkrd|jdSidd6dd6dd6d d 6|jd S( NRtRsR Rus.aRs.dylibRos.soRnRm(R9(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetStandaloneExecutableSuffixpscCs:|jjdidd6dd6dd6dd6|jdS( Ntproduct_prefixR RutlibRRoRnRm(R9R=(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetStandaloneExecutablePrefixzs cCs|j st|jdd ks=td|jd|jd}|jddkr}|d d kr|d}qn3|jdd kr|d d kr|d}qn|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.RmRuRoRRnsUnexpected type %sRxiRR|(RuRoRRn(RnRo(R`ROR9RR=R(R ttargett target_prefixt target_ext((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRs     cCs4|jr&|jjd|jdS|jSdS(sXReturns the executable name of the bundle represented by this target. E.g. Chromium.R|RxN(R`R9R=R(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRs cCs$|jr|jS|jSdS(ssReturns the directory name of the bundle represented by this target. E.g. Chromium.app/Contents/MacOS/Chromium.N(R`RR(R ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetExecutablePaths  cCsD|j|}t}|j|jd|jd|jdS(s:Returns the architectures this target should be built for.tARCHSt VALID_ARCHStSDKROOT(R7R4R#R=(R RAtconfig_settingstxcode_archs_default((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetActiveArchss     cCs+ytddd||gSWnnXdS(Nt xcodebuilds-versions-sdk(tGetStdoutQuiet(R tsdktinfoitem((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetSdkVersionInfoItemscCs.|dkr|j}n|jd|ddS(NRR R (R?RAtGetPerConfigSetting(R RA((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_SdkRoots  cCs/|j|}|jdr"|S|j|S(Nt/(Rt startswitht _XcodeSdkPath(R RAtsdk_root((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_SdkPathscCsR|tjkrG|j|d}|tj|<|rG|tj|g} x+| D]#} |jd:| jd?|qWd@|_|S(BsMReturns flags that need to be added to .c, .cc, .m, and .mm compilations.Rs -isysroot %stCLANG_WARN_CONSTANT_CONVERSIONtYESR tNOs-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_STRICT_ALIASINGs-fstrict-aliasings-fno-strict-aliasingtGCC_SYMBOLS_PRIVATE_EXTERNs-fvisibility=hiddentGCC_TREAT_WARNINGS_AS_ERRORSs-WerrortGCC_WARN_ABOUT_MISSING_NEWLINEs -Wnewline-eoftLLVM_LTOs-fltotCOPY_PHASE_STRIPtGCC_DEBUGGING_SYMBOLStGCC_ENABLE_OBJC_EXCEPTIONSt MACH_O_TYPEt PRODUCT_TYPEiRR*s-arch iR-tGCC_ENABLE_SSE3_EXTENSIONSs-msse3t)GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONSs-mssse3tGCC_ENABLE_SSE41_EXTENSIONSs-msse4.1tGCC_ENABLE_SSE42_EXTENSIONSs-msse4.2tWARNING_CFLAGSs-Fs/Developer/Library/Frameworks/R R6tmac_framework_dirss $(SDKROOT)N(R*R-(RARRPRRSRWR=tNotImplementedErrorRRXR?RORtlenRht_XcodePlatformPathR9treplace( R RARtcflagsRt dbg_formatRt platform_roottframework_rootRDtframework_dirst directory((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt GetCflagss                  ! cCsy||_g}|jjdddkr=|jdn|j|dd||jjdg7}d|_|S(s?Returns flags that need to be added to .c, and .m compilations.tGCC_C_LANGUAGE_STANDARDR tansis-ansis-std=%st OTHER_CFLAGSN(RARPR=RRWR?(R RAtcflags_c((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt GetCflagsCSs  cCs||_g}|jjd}|r>|jd|n|j|dd|jddddry|jd n|jd dddr|jd n|jd dddr|jd n|jddddr|jdn|jddddr|jdng}xp|jjddgD]S}|dkrVd}n|dkr||jjdg7}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_RTTIRR Rs -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(RARPR=RRWRSR?(R RAt cflags_cctclang_cxx_language_standardt other_ccflagstflag((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt GetCflagsCC_s6   "     cCsT|jjdd}|dkr4|jdn|dkrP|jdndS(NtGCC_ENABLE_OBJC_GCt unsupportedt supporteds -fobjc-gctrequireds-fobjc-gc-only(RPR=R(R tflagst gc_policy((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt$_AddObjectiveCGarbageCollectionFlagss   cCs,|jddddr(|jdndS(NtCLANG_ENABLE_OBJC_ARCRR Rs -fobjc-arc(RSR(R R((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_AddObjectiveCARCFlagsscCs,|jddddr(|jdndS(Nt*CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESISRR Rs!-Wobjc-missing-property-synthesis(RSR(R R((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt+_AddObjectiveCMissingPropertySynthesisFlagss cCsC||_g}|j||j||j|d|_|S(s7Returns flags that need to be added to .m compilations.N(RARRRR?(R RAt cflags_objc((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt GetCflagsObjCs     cCsk||_g}|j||j||j||jddddr^|jdnd|_|S(s8Returns flags that need to be added to .mm compilations.tGCC_OBJC_CALL_CXX_CDTORSRR Rs-fobjc-call-cxx-cdtorsN(RARRRRSRR?(R RAt cflags_objcc((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetCflagsObjCCs     cCsa|jddkr6|jddks2|jr6dS|jdd|jrTdnd}|S( s/Return DYLIB_INSTALL_NAME_BASE for this target.RmRoRntDYLIB_INSTALL_NAME_BASER s/Library/Frameworkss/usr/local/libN(R9R`R?Rk(R t install_base((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetInstallNameBasescCsqd|krmd|}}|jdrC|jdd\}}ntjj|}tjj||}n|S(s(Do :standardizepath processing for path.RR t@i(RRIRRtnormpathRJ(R Rtprefixtrest((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_StandardizePaths  cCs/|jddkr6|jddks2|jr6dSd}|jdd|}d|kr+|d|fkstd |jd |f|jd |j|j}|jr|jd |j}|jd |j }n$d |kstd |kst|jd|j }n|S(s-Return LD_DYLIB_INSTALL_NAME for this target.RmRoRns=$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)tLD_DYLIB_INSTALL_NAMER t$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')Rxs*$(DYLIB_INSTALL_NAME_BASE:standardizepath)s$(WRAPPER_NAME)s$(PRODUCT_NAME)s$(EXECUTABLE_PATH)N( R9R`R?RkRORRRR~R}R(R tdefault_install_namet install_name((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetInstallNames0  c Csd}d}d|gd|gd|gd|||gg}xy|D]q}tjddj|}|j|}|rC||jd  ||jd ||jd }qCqCW|jd rd ||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(RJRtstarttgrouptendRR( R tldflagtgyp_to_build_patht LINKER_FILEtWORDt linker_flagst flag_patterntregextm((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_MapLinkerFlagFilenames    #cCs||_g}x9|jjdgD]}|j|j||q(W|jddddrs|jdn|jddddr|jdn|j|d d |j|d d |j|d |jkr|jr|jd|jnx7|jjdgD]}|jd||qWd|jkrv|jd-||jdn|d.k r|g}n!|jst |j |j}t |dkr|j ddg}n|jd|d|jd||j} | rE|jddkrE|jd| jddnx1|jjdgD]} |jd| q^W|j} | sd } n|jd!|j} | jd"g} x+| D]#}|jd#|jd$| qW|jr$|j|}|r$|jd#|d%q$n|jp9|j}| r|r|jd&td'krx|j| d(n|jd)|jd*n|j|d+d,d.|_|S(/sReturns 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 directory. t OTHER_LDFLAGStDEAD_CODE_STRIPPINGRR Rs-Wl,-dead_stript PREBINDINGs -Wl,-prebindtDYLIB_COMPATIBILITY_VERSIONs-compatibility_version %stDYLIB_CURRENT_VERSIONs-current_version %sRs -isysroot tLIBRARY_SEARCH_PATHSs-Lt ORDER_FILEs-Wl,-order_file s-Wl,iRR*s-arch iRmRns-install_name RGs\ tLD_RUNPATH_SEARCH_PATHSs -Wl,-rpath,R R6Rs-Fs $(SDKROOT)s/Developer/Library/Frameworks/s -lpkstartt0900s?/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKits-fapplication-extensions:-Xlinker -rpath -Xlinker @executable_path/../../FrameworksRs -stdlib=%ss-Wl,-order_file -Wl,N(RARPR=RRRSRWRRR?RORRRXR R9RRhRRbRdR1(R RAt product_dirRRtldflagsRt library_pathRR trpathRRDRRRt is_extension((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt GetLdflagssr             !       cCsL||_g}x-|jjdgD]}|j|q(Wd|_|S(sReturns flags that need to be passed to the static linker. Args: configname: The name of the configuration to get ld flags for. RN(RARPR=RR?(R RAt libtoolflagst libtoolflag((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetLibtoolflagsfs   cCst}i}xt|jjD]x}|rJt|j|}t}q"xM|j|jD]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.(R@tsortedR7tkeystdictR:R<(R t first_passtresultRARLtvalue((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pytGetPerTargetSettingsvs   cCs:||jkr&|j|j||S|j||SdS(N(R7R=Rk(R tsettingRAR ((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRscCst}d}xt|jjD]j}|rP|j|j|d}t}q"||j|j|dks"td||jdfq"W|dkr|S|S(sTries 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)RxN( R@R?R*R7R+R=R:ROR9(R R1R t is_first_passR.RA((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRks " c Cs=||_g}|jddddr0|jddddr0d}|jddkrm|jrmd }n|jdd krd }n|jjd |}id d 6dd 6dd6|}|jjdd }|r|dt|7}n|s|jd|jdn|jd||fnd|_|S(sReturns a list of shell commands that contain the shell commands necessary to strip this target's binary. These should be run as postbuilds before the actual postbuilds run.tDEPLOYMENT_POSTPROCESSINGRR RtSTRIP_INSTALLED_PRODUCTt debuggingRmRns non-globalRutallt STRIP_STYLER s-xs-St STRIPFLAGSRGsecho STRIP\(%s\)Rxs strip %s %sN( RARSR9R`RPR=t_NormalizeEnvVarReferencesRR?( R RAt output_binarytquietR.tdefault_strip_stylet strip_stylet strip_flagstexplicit_strip_flags((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetStripPostbuildss.    cCs||_g}|jddddr|jddddr|jddkr|ss|jd |jd n|jd ||d fnd |_|S(sReturns a list of shell commands that contain the shell commands necessary to massage this target's debug information. These should be run as postbuilds before the actual postbuilds run.RRR Rsdwarf-with-dsymRRmRsecho DSYMUTIL\(%s\)Rxsdsymutil %s -o %ss.dSYMN(RARSR9RR?(R RAtoutputR:R;R.((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetDebugInfoPostbuildss  cCs)|j|||||j|||S(sReturns a list of shell commands that contain the shell commands to run as postbuilds for this target, before the actual postbuilds.(RBR@(R RARAR:R;((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetTargetPostbuildsscCs|jo|jddks gS|j|}|j|}|sFgSdg}t|t|j|j@}|rtddjt|ndt j jdd||j d d |j d d |j d d fgS( sReturn a shell command to codesign the iOS output binary so it can be deployed to a device. This should be run as the very last step of the build.RmRutOTHER_CODE_SIGN_FLAGSs9Warning: Some codesign keys not implemented, ignoring: %ss, s'%s code-sign-bundle "%s" "%s" "%s" "%s"s${TARGET_BUILD_DIR}s gyp-mac-tooltCODE_SIGN_RESOURCE_RULES_PATHR tCODE_SIGN_ENTITLEMENTStPROVISIONING_PROFILE( R;R9R7t_GetIOSCodeSignIdentityKeytsetR+RRJR*RRR=(R RAR:RKRLtunimpl((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyt_GetIOSPostbuildss   #cCs|jd}|sdS|tjkrtjdddddg}xx|jD]g}||krS|jd}tj}||ks|||kstd||tj|RPRSR?RWRXR]R`RbRdRfRhRlR{R}RR~RRRRRRRRRRRRRRRRRRRRRRRRRRRR RR&R)R0RRkR@RBR:RCRKRHRZRbRdRgRmRR}(((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyR5s                          y )    &  _     "         %tMacPrefixHeadercBsMeZdZdZdZddZdZddZddZ RS(sA 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. cCsd |_t|_|rK|jd|_|jddddk|_ni|_|jr|jrx6ddddgD]}||j||j|04s( tXCODE_VERSION_CACHERRRRRt CLTVersionRJRIR\(t version_listtversiontbuild((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyR1s(     0  cCsd}d}d}tjd}xW|||gD]F}y3tdd|g}tj||jdSWq1q1q1Xq1WdS( s7Returns the version of command-line tools from pkgutil.s"com.apple.pkg.DeveloperToolsCLILeoscom.apple.pkg.DeveloperToolsCLIs!com.apple.pkg.CLTools_Executablessversion: (?P.+)s/usr/sbin/pkgutils --pkg-infoRN(R'R(Rftsearcht groupdict(tSTANDALONE_PKG_IDtFROM_XCODE_PKG_IDtMAVERICKS_PKG_IDRRLRA((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRs cCstj|dtjdtj}|jd}trI|jd}n|jdkrxtd|j|dfn|jdS(sReturns the content of standard output returned by invoking |cmdlist|. Ignores the stderr. Raises |GypError| if the command return with a non-zero return code.tstdouttstderrisutf-8sError %d running %ss ( RPtPopentPIPEt communicatetPY3tdecodet returncodeRtrstrip(tcmdlisttjobtout((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyR)s! cCstj|dtj}|jd}tr@|jd}n|jdkrtjj |dt d|j|dfn|j dS(sReturns the content of standard output returned by invoking |cmdlist|. Raises |GypError| if the command return with a non-zero return code.Risutf-8s sError %d running %s( RPRRRRRRtsysRtwriteRR(RRR((sq/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/xcode_emulation.pyRf6s cCsg|jdi}xN|djD]<}d|kr#|j}|j|d||dx;|D]3} t|| tsdj|| || sN           8 1j *    ( 0 U  #