JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrB  fL@sdZddlZddlZddlZddddgZdZdZd Zd&d d Zd d Z ddZ da ddZ ddZ ddZddZddZddZddZddZd d!Zd"dZd#dZd$dZd%dZdS)'zShared OS X support functions.Ncompiler_fixupcustomize_config_varscustomize_compilerget_platform_osx) CFLAGSZLDFLAGSZCPPFLAGSZ BASECFLAGS BLDSHAREDLDSHAREDCCCXXZ PY_CFLAGSZ PY_LDFLAGSZ PY_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)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. NPATHZwin32z.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)z0Output from successful command execution or NonerNz/tmp/_osx_support.%szw+bz%s 2>/dev/null >'%s'zutf-8) contextlibtempfileZNamedTemporaryFile ImportErroropenr getpidclosingnamesystemreaddecodestrip)Z commandstringrrfpcmdrrr _read_output7s  r+cCst|ptd|fpdS)z0Find a build tool on current path or using xcrunz/usr/bin/xcrun -find %s)rr+)Ztoolnamerrr_find_build_toolJsr-cCsxtdkrtday td}Wntk r,YnHXztd|}Wd|X|dk rtd|d dddatS)z*Return the OS X system version as a stringNr,z0/System/Library/CoreServices/SystemVersion.plistz=ProductUserVisibleVersion\s*(.*?).) _SYSTEM_VERSIONr!OSErrorresearchr&closergroupr)rmrrr_get_system_versionSs   r8cCs&x t|D]}|tr ||=q WdS)z-Remove original unmodified values for testingN)list startswith_INITPRE) _config_varskrrr_remove_original_valuesqs r>cCs8||d}||kr,t||kr,||t|<|||<dS)z@Save modified and original unmodified value of configuration varr,N)getr;)r<cvZnewvalueZoldvaluerrr_save_modified_valuexs  rAcCsTt}|r@ytdd|dD}Wntk r>d}YnX|rPt|dkSdS)z=Returns True if universal builds are supported on this systemcss|]}t|VqdS)N)int).0irrr sz-_supports_universal_builds..r.r,) F)r8tupler ValueErrorbool)Z osx_versionrrr_supports_universal_buildss rKcCsdtjkr|S|dd}}t|s4td}n/dev/nullrLz'"'"'z-arch\s+ppc\w*\srM) r r r3r4r%rOrUrVrA)r<Zstatusr@rTrrr_remove_unsupported_archss  rYcCshdtjkrdtjd}xNtD]F}||krd||kr||}tdd|}|d|}t|||qW|S)z2Allow override of all archs with ARCHFLAGS env var ARCHFLAGSz-archz -arch\s+\w+\srM)r r rUr3rVrA)r<Zarchr@rTrrr_override_all_archss    r[cCs||dd}td|}|dk rx|d}tj|sxx@tD]8}||kr<|tjkr<||}t dd|}t |||q.rZr0cSsg|]\}}|dr|qS)z -isysroot)r:)rCrDxrrr Usz"compiler_fixup..rz -isysrootr/NcSsg|]\}}|dr|qS)z -isysroot)r:)rCrDr`rrrraescSsg|]\}}|dr|qS)z -isysroot)r:)rCrDr`rrrrahs)logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)r9rKanyr r indexrIr enumeratelenrisdirZ distutilsrbwarn) Z compiler_soZcc_argsZ stripArchZ stripSysrootrdindicesZsysrootZargvaridxrbrrrr0sT         cCs"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 )rKrXr[r^)r<rrrr{s cCst|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). )rSrYr[)r<rrrrs cCs||dd}tp|}|p|}|rr|}d}|td|dd}|ry$tdd|ddd D}Wqtk rd }YqXnd }|d kr6d |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) z Filter values for get_platform()ZMACOSX_DEPLOYMENT_TARGETr,Zmacosxrcss|]}t|VqdS)N)rB)rCrDrrrrEsz#get_platform_osx..r.rr0)rFr)rFrGz-archZfatz -arch\s+(\S+)r/)i386ppc)rkx86_64Zintel)rkrlrmZfat3)ppc64rmZfat64)rkrlrnrmZ universalz%Don't know machine value for archs=%rrklrm)ZPowerPCZPower_Macintoshrnrl)r?r8r;rHrrIr(r3findallsortedsetrfrmaxsize)r<ZosnamereleasemachineZmacverZ macreleaser]ZarchsrrrrsP   $           )N)__doc__r r3r__all__rUrQr;rr+r-r1r8r>rArKrSrXrYr[r^rrrrrrrrs6 >(K)