ronnie
2022-10-14 1504bb53e29d3d46222c0b3ea994fc494b48e153
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
K\¬Qc @sëdZddlZddlZddlZddddgZd$Zd%ZdZdd„Z    d„Z
d„Z da d„Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd „Zd!„Zd"„Zd#„ZdS(&sShared OS X support functions.iÿÿÿÿNtcompiler_fixuptcustomize_config_varstcustomize_compilertget_platform_osxtCFLAGStLDFLAGStCPPFLAGSt
BASECFLAGSt    BLDSHAREDtLDSHAREDtCCtCXXt    PY_CFLAGSt
PY_LDFLAGSt PY_CPPFLAGStPY_CORE_CFLAGSt_OSX_SUPPORT_INITIAL_cCs×|dkrtjd}n|jtjƒ}tjj|ƒ\}}tjdksdtj    dkr}|dkr}|d}ntjj
|ƒsÏx9|D]1}tjj ||ƒ}tjj
|ƒr–|Sq–WdS|SdS(sÚTries to find 'executable' in the directories listed in 'path'.
 
    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    tPATHtwin32tos2s.exeN( tNonetostenvirontsplittpathseptpathtsplitexttsystplatformtnametisfiletjoin(t
executableRtpathstbasetexttptf((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt_find_executables *  cCs³ddl}yddl}|jƒ}Wn-tk
rWtdtjƒfdƒ}nX|j|ƒF}d||jf}tj    |ƒs¥|j
ƒj dƒj ƒSdSWdQXdS(s/Output from succesful command execution or NoneiÿÿÿÿNs/tmp/_osx_support.%ssw+bs%s 2>/dev/null >'%s'sutf-8(t
contextlibttempfiletNamedTemporaryFilet ImportErrortopenRtgetpidtclosingRtsystemtreadtdecodetstripR(t commandstringR'R(tfptcmd((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt _read_output7s   cCs#t|ƒp"td|fƒp"dS(s0Find a build tool on current path or using xcruns/usr/bin/xcrun -find %st(R&R5(ttoolname((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt_find_build_toolJs cCs›tdkr—daytdƒ}Wntk
r5q—Xztjd|jƒƒ}Wd|jƒX|dk    r—dj|j    dƒj
dƒd ƒaq—ntS(s*Return the OS X system version as a stringR6s0/System/Library/CoreServices/SystemVersion.plists=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>Nt.ii( t_SYSTEM_VERSIONRR+tIOErrortretsearchR/tcloseRtgroupR(R%tm((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt_get_system_versionSs
       +cCs4x-t|ƒD]}|jtƒr ||=q q WdS(s-Remove original unmodified values for testingN(tlistt
startswitht_INITPRE(t _config_varstk((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt_remove_original_valuesqscCsM|j|dƒ}||kr?t||kr?||t|<n|||<dS(s@Save modified and original unmodified value of configuration varR6N(tgetRD(REtcvtnewvaluetoldvalue((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt_save_modified_valuexscCsitƒ}|rOy#td„|jdƒDƒƒ}WqOtk
rKd}qOXn|ret|dkƒStS(s=Returns True if universal builds are supported on this systemcss|]}t|ƒVqdS(N(tint(t.0ti((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pys    <genexpr>ŠsR9R6i
i(i
i(RAttupleRt
ValueErrortbooltFalse(t osx_version((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt_supports_universal_builds€s    #  cCs>dtjkr|S|djƒd}}t|ƒsFtdƒ}nXtjj|ƒjdƒržtd|j    ddƒfƒ}d|kržtdƒ}qžn|s³t
d    ƒ‚n||kr:xxt D]m}||krÆ|tjkrÆ||jƒ}|d
kr    |n|d |d<t ||d j |ƒƒqÆqÆWn|S( s7Find appropriate C compiler for extension module buildsR
itclangtgccs'%s' --versiont's'"'"'sllvm-gccsCannot locate working compilerR s++t (RRRR&R8RtbasenameRCR5treplacet SystemErrort_COMPILER_CONFIG_VARSRLR(REtcctoldcctdataRItcv_split((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt_find_appropriate_compilers(      #cCswxptD]h}||kr|tjkr||}tjdd|ƒ}tjdd|ƒ}t|||ƒqqW|S(s5Remove all universal build arguments from config varss -arch\s+\w+\sRYs-isysroot [^     ]*(t_UNIVERSAL_CONFIG_VARSRRR<tsubRL(RERItflags((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt_remove_universal_flagsÎs 
cCsÍdtjkr|Stjd|dƒd k    rÉtjd|djddƒfƒ}|d?dkrÉx^tD]S}||krl|tjkrl||}tjd    d
|ƒ}t    |||ƒqlqlWqÉn|S( s-Remove any unsupported archs from config varsR
s -arch\s+ppcRs)'%s' -arch ppc -x c /dev/null 2>/dev/nullRXs'"'"'iiÿs-arch\s+ppc\w*\sRYN(
RRR<R=RR.R[RcRdRL(REtstatusRIRe((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt_remove_unsupported_archsÜs      
cCsdtjkrŒtjd}xmtD]b}||kr#d||kr#||}tjdd|ƒ}|d|}t|||ƒq#q#Wn|S(s2Allow override of all archs with ARCHFLAGS env vart    ARCHFLAGSs-archs -arch\s+\w+\sRY(RRRcR<RdRL(REtarchRIRe((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt_override_all_archsþs  
cCs¹|jddƒ}tjd|ƒ}|dk    rµ|jdƒ}tjj|ƒsµx^tD]S}||krX|tj    krX||}tj
dd|ƒ}t |||ƒqXqXWqµn|S(s+Remove references to any SDKs not availableRR6s-isysroot\s+(\S+)is-isysroot\s+\S+(?:\s|$)RYN( RHR<R=RR?RRtexistsRcRRdRL(REtcflagsR@tsdkRIRe((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt_check_for_unavailable_sdks   
cCsÆt}}t|ƒ}tƒs,t}}nd|k}d|k}|sYdtjkrŸxCtr›y!|jdƒ}|||d5Wq\tk
r—Pq\Xq\WndtjkrÏ| rÏ|tjdjƒ}n|rxCtry!|jdƒ}|||d5WqØtk
rPqØXqØWnd
}d|krM|jdƒ}||d}n,d|kry|jdƒ}||d}n|rÂtj
j |ƒ rÂddl m }|jd|ƒ|jd    ƒn|S( se
    This function will strip '-isysroot PATH' and '-arch ARCH' from the
    compile flags if the user has specified one them in extra_compile_flags.
 
    This is needed because '-arch ARCH' adds another architecture to the
    build, without a way to remove an architecture. Furthermore GCC will
    barf if multiple '-isysroot' arguments are present.
    s-archs    -isysrootRiiiiÿÿÿÿ(tlogs4Compiling with an SDK that doesn't seem to exist: %ss$Please check your Xcode installationN(RSRBRUtTrueRRtindexRQRRRtisdirt    distutilsRptwarn(t compiler_sotcc_argst    stripArcht stripSysrootRrtsysroottidxRp((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyR*sF    
                          cCs.tƒst|ƒnt|ƒt|ƒ|S(söCustomize Python build configuration variables.
 
    Called internally from sysconfig with a mutable mapping
    containing name/value pairs parsed from the configured
    makefile used to build this interpreter.  Returns
    the mapping updated as needed to reflect the environment
    in which the interpreter is running; in the case of
    a Python from a binary installer, the installed
    environment may be very different from the build
    environment, i.e. different OS levels, different
    built tools, different available CPU architectures.
 
    This customization is performed whenever
    distutils.sysconfig.get_config_vars() is first
    called.  It may be used in environments where no
    compilers are present, i.e. when installing pure
    Python dists.  Customization of compiler paths
    and detection of unavailable archs is deferred
    until the first extention module build is
    requested (in distutils.sysconfig.customize_compiler).
 
    Currently called from distutils.sysconfig
    (RURfRkRo(RE((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyRjs
     
 
cCs"t|ƒt|ƒt|ƒ|S(sÅCustomize compiler path and configuration variables.
 
    This customization is performed when the first
    extension module build is requested
    in distutils.sysconfig.customize_compiler).
    (RbRhRk(RE((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyR“s    
 
 
cCsµ|jddƒ}tƒp|}|p*|}|r¨|}d}|jtd|jddƒƒ}|ddkrQd|jƒkrQd}tjd    |ƒ}ttt|ƒƒƒ}t    |ƒd
krÒ|d }q¥|dkrçd}q¥|dkrüd}q¥|dkrd}q¥|dkr&d}q¥|dkr;d}q¥t
d|fƒ‚q¨|d krxt j dkr¥d}q¥q¨|dkr¨t j d krœd}q¥d }q¨n|||fS(!s Filter values for get_platform()tMACOSX_DEPLOYMENT_TARGETR6tmacosxRR9s10.4.s-archtfats -arch\s+(\S+)iiti386tppctx86_64tinteltfat3tppc64tfat64t    universals%Don't know machine value for archs=%rii tPowerPCtPower_Macintosh(si386sppc(si386sx86_64(si386sppcsx86_64(sppc64sx86_64(si386sppcsppc64sx86_64I(sPowerPCsPower_MacintoshI( RHRARDR1R<tfindallRPtsortedtsettlenRQRtmaxint(REtosnametreleasetmachinetmacvert
macreleaseRmtarchs((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyR§sF
                                    ( sCFLAGSsLDFLAGSsCPPFLAGSs
BASECFLAGSs    BLDSHAREDsLDSHAREDsCCsCXXs    PY_CFLAGSs
PY_LDFLAGSs PY_CPPFLAGSsPY_CORE_CFLAGS(s    BLDSHAREDsLDSHAREDsCCsCXX(t__doc__RR<Rt__all__RcR]RDRR&R5R8R:RARGRLRURbRfRhRkRoRRRR(((sT/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/_osx_support.pyt<module>s<                                    >        "            @    )