QfV ddlZddlZddlZgdZdZdZdZddZddZdZ da d Z da d Z d Zd Zdad ZdZdZdZdZdZdZdZdZdZdZdZy)N)compiler_fixupcustomize_config_varscustomize_compilerget_platform_osx) CFLAGSLDFLAGSCPPFLAGS BASECFLAGS BLDSHAREDLDSHAREDCCCXX PY_CFLAGS PY_LDFLAGS PY_CPPFLAGSPY_CORE_CFLAGSPY_CORE_LDFLAGS)r r r r_OSX_SUPPORT_INITIAL_c |tjd}|jtj}tjj |\}}t jdk(r |dk7r|dz}tjj|sK|D]E}tjj||}tjj|sC|cSy|S)NPATHwin32z.exe) osenvironsplitpathseppathsplitextsysplatformisfilejoin) executablerpathsbaseextpfs 3/opt/alt/python312/lib64/python3.12/_osx_support.py_find_executabler)s  |zz&! JJrzz "E  ,ID# cVm&( 77>>* %A Q +Aww~~a   c ddl} ddl}|j}|j|5}|r|d|jd}n|d|jd}t j|s-|jjdjndcdddS#t$r$t dt j d}YwxYw#1swYyxYw) Nrz/tmp/_osx_support.zw+bz >'z' 2>&1z 2>/dev/null >''utf-8) contextlibtempfileNamedTemporaryFile ImportErroropenrgetpidclosingnamesystemreaddecodestrip) commandstringcapture_stderrr.r/fpcmds r( _read_outputr>7s: "  ( ( *   B 2 %2BGG)toolnames r(_find_build_toolrBMs*: X & X GH r*cl tda tdd} tjd|j }|j |2dj |jdjdddatStS#|j wxYw#t$rYtSwxYw) Nr@z0/System/Library/CoreServices/SystemVersion.plistr-)encodingz=ProductUserVisibleVersion\s*(.*?).) _SYSTEM_VERSIONr2researchr7closer!grouprOSError)r'ms r(_get_system_versionrOVs4 FGRYZA  II89:C }"%((1771:+;+;C+@!+D"E ?      s B"$B B" B32B3c t4t}|r( td|jdDatStS#t$r daYtSwxYw)Nc32K|]}t|ywNint.0is r( z,_get_system_version_tuple..s-U>Tc!f>TrE)_SYSTEM_VERSION_TUPLErOtupler ValueError osx_versions r(_get_system_version_tupler`usg$)+  +(--Uk>O>OPS>T-U(U% !   +(*%   +s!A AAcX t|D]}|jts||=yrR)list startswith_INITPRE) _config_varsks r(_remove_original_valuesrgs'7 ,  << !Q r*cl |j|d}||k7rt|z|vr ||t|z<|||<y)Nr@)getrd)recvnewvalueoldvalues r(_save_modified_valuermsBJB'HH8b= #D&. X]#Lr*c8 ttSt|dd}d}|jD]\}|jdrd}|jdrd}+|s.|j }|dk(rdaF|j dsX|dd a^tdatS) Nz -c -E -v - zEnd of search listz /usr/include/z.sdk/usr/includei)_cache_default_sysrootr> splitlinesrcr9endswith)cccontents in_incdirslines r(_default_sysrootrwsG)%%">EHJ##% ??+ ,J __1 2J ::replace SystemError_COMPILER_CONFIG_VARSrmr!)rersoldccdatarjcv_splits r(_find_appropriate_compilerrsA  rzzd#))+A..B B g &   "  ( ( / " 3 :=> J$&!'*B /1 1 U{(B\!b &:'+113$&%KbR$Y $\2sxx7IJ ( r*c tD]j}||vs|tjvs||}tjdd|tj }tjdd|}t |||l|S)N -arch\s+\w+\sr)flagsz-isysroot\s*\S+)_UNIVERSAL_CONFIG_VARSrrrIsubASCIIrm)rerjrs r(_remove_universal_flagsrsl?$  "BJJ"6 $EFF+S%rxxHEFF-sE:E r5 9 % r*cV dtjvr|Stjd|dztjd|dj ddd}|rLt D]C}||vs|tjvs||}tjdd |}t|||E|S) Nr z -arch\s+ppcrzecho 'int main{};' | 'r,rz6' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullz-arch\s+ppc\w*\sr) rrrIrJr6rrrrm)restatusrjrs r(_remove_unsupported_archsrs7 rzz yyh!78D4 ((i8 ;< -%"BJJ*>(,EFF#6UCE(r5A - r*c dtjvr\tjd}tD]@}||vsd||vs||}tjdd|}|dz|z}t |||B|S)N ARCHFLAGS-archrr)rrrrIrrm)rearchrjrs r(_override_all_archsr:s~<bjj zz+&(B\!gb1A&A$R(/e< d*$\2u= ) r*cT |jdd}tjd|}|||jd}tj j |sLtD]C}||vs|tjvs||}tjdd|}t|||E|S)Nrr@z-isysroot\s*(\S+)rFz-isysroot\s*\S+(?:\s|$)r) rirIrJrLrrexistsrrrrm)recflagsrNsdkrjrs r(_check_for_unavailable_sdkrKs5  h +F &/A}ggajww~~c",%"BJJ*>(,EFF#=sEJE(r5A - r*c dx}}t|}tsdx}}nd|v}td|D}|sdtjvr |j d}|||dz=ts?ttt|D]}||dk(s ||dzdk(s|||dz=!dtjvr&|s$|tjdjz}|rR t|Dcgc]\}}|jd s|}}}|sn|d }||d k(r |||dz=n|||dz=Qd} |} t|Dcgc]\}}|jd s|}}}|s1|} t|Dcgc]\}}|jd s|}}}|D]&}| |d k(r | |dz} n| |td d} n| rtjj| s`t j"j%d | d t j"j%d t j"j'|S#t $rYwxYwcc}}wcc}}wcc}}w)NFTrc3DK|]}|jds|yw) -isysrootN)rc)rVargs r(rXz!compiler_fixup..ysQ'3S^^K5P3's  rrGrFarm64rrz2Compiling with an SDK that doesn't seem to exist:  z%Please check your Xcode installation )rbr}anyrrindexr]rreversedrangelenr enumeratercrisdirrstderrwriteflush) compiler_socc_args stripArch stripSysrootridxrWxindicessysrootargvars r(rrfs %$I {#K % '$(' Lw& Q'QQ K2::- #))'2eAg . $ %E#k"234C37*{3q5/AW/LCE *5bjj "BJJ{$;$A$A$CC $-k$:X$:SQqall;>Wq$:GXAJE5![0eAg . eAg .G F%g.L.SQq!,,{2Kq.GL  )+ 6T 61!,,{:S1 6T #;+ %SUmG Sk#k"2"34G  rww}}W- MgYVXYZ AB  e   Y MUs6 I8II I%'I%I+I+ IIc^ ts t|t|t||SrR)r}rrrres r(rrs30 & ' - %|, r*cJ t|t|t||SrR)rrrrs r(rrs+|,l+ % r*c |jdd}|r d|vr|dz }txs|}|xs|}|r,|}d}|jtdz|jdd}|r& td|j ddd D}nd }|d k\rd |j vrd }tjd|}ttt|}t|dk(r|d}nu|dk(rd}nm|dk(rd }ne|dk(rd}n]|dk(rd}nU|dk(rd}nM|dk(rd}nEt d||dk(rtjdk\rd}n|dvrtjdk\rd }nd!}|||fS#t $rd }YwxYw)"NMACOSX_DEPLOYMENT_TARGETr@rEz.0macosxrc32K|]}t|ywrRrSrUs r(rXz#get_platform_osx..s"N3Ma3q63MrYrrG)rzryrfatz -arch\s+(\S+)rF)rx86_64 universal2)i386ppc)rrintel)rrrfat3)ppc64rfat64)rrrr universalz#Don't know machine value for archs=rlr)PowerPCPower_Macintoshrr)rirOrdr\rr]r9rIfindallsortedsetrrmaxsize)reosnamereleasemachinemacver macreleaserarchss r(rrs*  8" =F #V# $$&0&J  !zF  !!(8"3$0$4$4Xr$BD  %""N:3C3CC3H13M"NN !J ' !w&,,.'@GJJ/8E&U,-E5zQ(--&/),,!33 --!<<% >CEGG {{e#" 6 6{{e#! GW %%a %$  %s&$E'' E54E5rR)F)rrIr__all__rrrdr)r>rBrHrOr[r`rgrmrprwr}rrrrrrrrrrrZr*r(rs$  A ? #4Q,<!&  "2B<;| %P"6M`&R(P&r*