asda?‰PNG  IHDR ? f ??C1 sRGB ??é gAMA ±? üa pHYs ? ??o¨d GIDATx^íüL”÷e÷Y?a?("Bh?_ò???¢§?q5k?*:t0A-o??¥]VkJ¢M??f?±8\k2íll£1]q?ù???T a d U@sdZddlZddlZddlZgdZdZdZdZd.ddZd/d d Z d d Z da ddZ da ddZddZddZdaddZddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-ZdS)0zShared OS X support functions.N)compiler_fixupcustomize_config_varscustomize_compilerget_platform_osx) CFLAGSLDFLAGSCPPFLAGSZ BASECFLAGS BLDSHAREDLDSHAREDCCCXXZ PY_CFLAGSZ PY_LDFLAGSZ PY_CPPFLAGSZPY_CORE_CFLAGSZPY_CORE_LDFLAGS)r r r r Z_OSX_SUPPORT_INITIAL_cCs|durtjd}|tj}tj|\}}tjdkrH|dkrH|d}tj|s|D]&}tj ||}tj|rX|SqXdS|SdS)zTries 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. NPATHwin32z.exe) osenvironsplitpathseppathsplitextsysplatformisfilejoin) executablerpathsbaseextpfr*/usr/src/Python-3.9.18/Lib/_osx_support.py_find_executables     r!FcCsddl}zddl}|}Wn&tyBtdtfd}Yn0||R}|rdd||jf}nd||jf}t |s| d ndWdS1s0YdS)z0Output from successful command execution or NonerNz/tmp/_osx_support.%szw+bz %s >'%s' 2>&1z%s 2>/dev/null >'%s'zutf-8) contextlibtempfileZNamedTemporaryFile ImportErroropenrgetpidclosingnamesystemreaddecodestrip)Z commandstringZcapture_stderrr"r#fpcmdrrr _read_output7s    r/cCst|ptd|fpdS)z0Find a build tool on current path or using xcrunz/usr/bin/xcrun -find %s)r!r/)Ztoolnamerrr _find_build_toolMs  r1cCs~tdurzdaz td}Wnty*YnP0ztd|}W|n |0|durzd|d dddatS)z*Return the OS X system version as a stringNr0z0/System/Library/CoreServices/SystemVersion.plistz=ProductUserVisibleVersion\s*(.*?).) _SYSTEM_VERSIONr%OSErrorresearchr*closergroupr)rmrrr _get_system_versionVs   r<cCsJtdurFt}|rFztdd|dDaWntyDdaYn0tS)z} Return the macOS system version as a tuple The return value is safe to use to compare two version numbers. Ncss|]}t|VqdSNint.0irrr z,_get_system_version_tuple..r2r)_SYSTEM_VERSION_TUPLEr<tupler ValueErrorZ osx_versionrrr _get_system_version_tupleus  rIcCs"t|D]}|tr||=qdS)z-Remove original unmodified values for testingN)list startswith_INITPRE) _config_varskrrr _remove_original_valuess  rOcCs8||d}||kr,t||vr,||t|<|||<dS)z@Save modified and original unmodified value of configuration varr0N)getrL)rMcvZnewvalueZoldvaluerrr _save_modified_values  rRcCstdur tStd|fd}d}|D]T}|drzEnd of search listz /usr/include/z.sdk/usr/includei)_cache_default_sysrootr/ splitlinesrKr,endswith)cccontents in_incdirslinerrr _default_sysroots$    r[cCst}|rt|dkSdS)z=Returns True if universal builds are supported on this system F)rIboolrHrrr _supports_universal_buildssr`cCst}|r|dkSdS)z9Returns True if arm64 builds are supported on this system) rF)rIrHrrr _supports_arm64_buildssrbcCsdtjvr|S|dd}}t|s4td}n/dev/nullrerfz-arch\s+ppc\w*\srg) rrr7r8r)rirprqrR)rMstatusrQrorrr _remove_unsupported_archss  rucCsddtjvr`tjd}tD]F}||vrd||vr||}tdd|}|d|}t|||q|S)z2Allow override of all archs with ARCHFLAGS env var ARCHFLAGS-archrnrg)rrrpr7rqrR)rMZarchrQrorrr _override_all_archs:s   rxcCsx|dd}td|}|durt|d}tj|sttD]8}||vr:|tjvr:||}t dd|}t |||q:|S)z+Remove references to any SDKs not availablerr0z-isysroot\s*(\S+)Nr3z-isysroot\s*\S+(?:\s|$)rg) rPr7r8r:rrexistsrprrqrR)rMcflagsr;ZsdkrQrorrr _check_for_unavailable_sdkKs    r{c Csd}}t|}ts d}}nd|v}tdd|D}|sHdtjvrz|d}|||d=WqHtyzYqYqH0qHnFtstt t |D].}||dkr||dd kr|||d=qdtjvr|s|tjd }|r>d d t |D}|sq>|d }||d kr.|||d=q|||d=qd}|}dd t |D}|st|}dd t |D}|D]B}||d kr||d}qn||t d d}qqx|rtj |sd dlm} | d|| d|S)ae 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. FTrwcss|]}|dr|VqdS) -isysrootNrK)rAargrrr rCyrDz!compiler_fixup..rvr4r3arm64cSsg|]\}}|dr|qSr|r}rArBxrrr rDz"compiler_fixup..rr|NcSsg|]\}}|dr|qSrr}rrrr rrDcSsg|]\}}|dr|qSrr}rrrr rrD)logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)rJr`anyrrindexrGrbreversedrangelenr enumeraterisdir distutilsrwarn) compiler_soZcc_argsZ stripArchZ stripSysrootridxindicessysrootZargvarrrrr rfsZ        rcCs"tst|t|t||S)aCustomize 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 extension module build is requested (in distutils.sysconfig.customize_compiler). Currently called from distutils.sysconfig )r`rsrxr{rMrrr rs rcCst|t|t||S)zCustomize compiler path and configuration variables. This customization is performed when the first extension module build is requested in distutils.sysconfig.customize_compiler. )rmrurxrrrr rs rcCs|dd}tp|}|p|}|r|}d}|td|dd}|rz$tdd|ddd D}Wqtyd }Yq0nd }|d krDd |vrDd }td|}tt t |}t |dkr|d}nj|dkrd}n\|dkrd }nN|dkrd}n>|dkrd}n.|dkr$d}n|dkr4d}ntd|fn<|dkr`t j dkrd}n |dvrt j dkr|d }nd!}|||fS)"z Filter values for get_platform()MACOSX_DEPLOYMENT_TARGETr0Zmacosxrcss|]}t|VqdSr=r>r@rrr rCrDz#get_platform_osx..r2rr4)r]rr\rwZfatz -arch\s+(\S+)r3)rx86_64Z universal2)i386ppc)rrZintel)rrrZfat3)ppc64rZfat64)rrrr universalz%Don't know machine value for archs=%rrlr)ZPowerPCZPower_Macintoshrr)rPr<rLrFrrGr,r7findallsortedsetrrmaxsize)rMosnamereleasemachineZmacverZ macreleaserzarchsrrr rsX    $             r)N)F)__doc__rr7r__all__rprkrLr!r/r1r5r<rErIrOrRrTr[r`rbrmrsrurxr{rrrrrrrr s:      >(Q)