• File: _osx_support.cpython-37.opt-2.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/proc/self/root/opt/alt/python37/lib64/python3.7/__pycache__/_osx_support.cpython-37.opt-2.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 7.66 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

YI~dL@sddlZddlZddlZddddgZdZdZdZd%d	d
ZddZd
dZ	da
ddZddZddZ
ddZddZddZddZddZdd Zd!dZd"dZd#dZd$dZdS)&Ncompiler_fixupcustomize_config_varscustomize_compilerget_platform_osx)
CFLAGSZLDFLAGSZCPPFLAGSZ
BASECFLAGS	BLDSHAREDLDSHAREDCCCXXZ	PY_CFLAGSZ
PY_LDFLAGSZPY_CPPFLAGSZPY_CORE_CFLAGSZPY_CORE_LDFLAGS)rrr	r
Z_OSX_SUPPORT_INITIAL_cCs|dkrtjd}|tj}tj|\}}tjdkrH|dkrH|d}tj|sx*|D]"}tj	||}tj|rZ|SqZWdS|SdS)NPATHwin32z.exe)
osenvironsplitpathseppathsplitextsysplatformisfilejoin)
executablerpathsbaseZextpfr1/opt/alt/python37/lib64/python3.7/_osx_support.py_find_executables

rc	Csddl}yddl}|}Wn(tk
rDtdtfd}YnX||0}d||jf}t	|s||
dSdSQRXdS)Nrz/tmp/_osx_support.%szw+bz%s 2>/dev/null >'%s'zutf-8)
contextlibtempfileZNamedTemporaryFileImportErroropenr
getpidclosingnamesystemreaddecodestrip)Z
commandstringrr fpcmdrrr_read_output7sr,cCst|ptd|fpdS)Nz/usr/bin/xcrun -find %s)rr,)Ztoolnamerrr_find_build_toolJsr.cCsxtdkrtdaytd}Wntk
r,YnHXztd|}Wd|X|dk	rtd|d	dddatS)Nr-z0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>.)
_SYSTEM_VERSIONr"OSErrorresearchr'closergroupr)rmrrr_get_system_versionSs

r9cCs&x t|D]}|tr
||=q
WdS)N)list
startswith_INITPRE)_config_varskrrr_remove_original_valuesqs
r?cCs8||d}||kr,t||kr,||t|<|||<dS)Nr-)getr<)r=cvZnewvalueZoldvaluerrr_save_modified_valuexsrBcCsTt}|r@ytdd|dD}Wntk
r>d}YnX|rPt|dkSdS)Ncss|]}t|VqdS)N)int).0irrr	<genexpr>sz-_supports_universal_builds.<locals>.<genexpr>r/r-)
F)r9tupler
ValueErrorbool)Zosx_versionrrr_supports_universal_buildss
rLcCsdtjkr|S|dd}}t|s4td}n<tj|drptd|	ddf}|rpd|krptd}|s|t
d	||krxTtD]L}||kr|tjkr||}|d
kr|n|d|d<t||d
|qW|S)
Nr	rZclangZgccz'%s' --version'z'"'"'zllvm-gcczCannot locate working compilerr
z++ )r
rrrr.rbasenamer;r,replaceSystemError_COMPILER_CONFIG_VARSrBr)r=ZccZoldccdatarAZcv_splitrrr_find_appropriate_compilers(


rTcCsZxTtD]L}||kr|tjkr||}tjdd|tjd}tdd|}t|||qW|S)Nz
-arch\s+\w+\srN)flagsz-isysroot\s*\S+)_UNIVERSAL_CONFIG_VARSr
rr4subASCIIrB)r=rArUrrr_remove_universal_flagss
rYcCsdtjkr|Std|ddk	rtd|dddf}|rx@tD]8}||krH|tjkrH||}tdd|}t|||qHW|S)	Nr	z-arch\s+ppcrzNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullrMz'"'"'z-arch\s+ppc\w*\srN)	r
rr4r5r&rPrVrWrB)r=statusrArUrrr_remove_unsupported_archss
	
r[cCshdtjkrdtjd}xNtD]F}||krd||kr||}tdd|}|d|}t|||qW|S)N	ARCHFLAGSz-archz
-arch\s+\w+\srN)r
rrVr4rWrB)r=ZarchrArUrrr_override_all_archss


r]cCs||dd}td|}|dk	rx|d}tj|sxx@tD]8}||kr<|tjkr<||}t	dd|}t
|||q<W|S)Nrr-z-isysroot\s*(\S+)r0z-isysroot\s*\S+(?:\s|$)rN)r@r4r5r7r
rexistsrVrrWrB)r=cflagsr8ZsdkrArUrrr_check_for_unavailable_sdks

r`c
Csd}}t|}ts d}}nd|k}tdd|D}|sHdtjkrx8y|d}|||d=WqJtk
r|PYqJXqJWdtjkr|s|tjd}|rxNdd	t|D}|sP|d
}||dkr|||d=q|||d=qWd}|}d
d	t|D}|s,|}dd	t|D}xB|D]:}||dkrT||d}Pn||t	dd}Pq2W|rtj
|sd
dlm
}	|	d||	d|S)NFTz-archcss|]}|dr|VqdS)z	-isysrootN)r;)rDargrrrrFCsz!compiler_fixup.<locals>.<genexpr>r\r1cSsg|]\}}|dr|qS)z	-isysroot)r;)rDrExrrr
<listcomp>Usz"compiler_fixup.<locals>.<listcomp>rz	-isysrootr0cSsg|]\}}|dr|qS)z	-isysroot)r;)rDrErbrrrrcescSsg|]\}}|dr|qS)z	-isysroot)r;)rDrErbrrrrchs)logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)r:rLanyr
rindexrJr	enumeratelenrisdirZ	distutilsrdwarn)
Zcompiler_soZcc_argsZ	stripArchZstripSysrootrfindicesZsysrootZargvaridxrdrrrr0sT	



cCs"tst|t|t||S)N)rLrYr]r`)r=rrrr{s
cCst|t|t||S)N)rTr[r])r=rrrrs	cCs||dd}tp|}|p|}|rr|}d}|td|dd}|ry$tdd|ddd	D}Wqtk
rd
}YqXnd
}|dkr6d|kr6d
}td|}tt	t
|}t|dkr|d}nZ|dkrd
}nL|dkrd}n>|dkrd}n.|dkrd}n|dkr&d}ntd|fn<|dkrRtj
dkrrd}n |dkrrtj
dkrnd}nd}|||fS) NZMACOSX_DEPLOYMENT_TARGETr-Zmacosxrcss|]}t|VqdS)N)rC)rDrErrrrFsz#get_platform_osx.<locals>.<genexpr>r/rr1)rGr)rGrHz-archZfatz
-arch\s+(\S+)r0)i386ppc)rmx86_64Zintel)rmrnroZfat3)ppc64roZfat64)rmrnrpro	universalz%Don't know machine value for archs=%rrmlro)ZPowerPCZPower_Macintoshrprn)r@r9r<rIrrJr)r4findallsortedsetrhrmaxsize)r=ZosnamereleasemachineZmacverZ
macreleaser_ZarchsrrrrsP


$





)N)r
r4r__all__rVrRr<rr,r.r2r9r?rBrLrTrYr[r]r`rrrrrrrr<module>s4
>(K)