Ë ÏúP™ƒ«]ðãó´—dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z m Z ddlmZmZmZmZddlmZdd lmZd „Zd „Zd „ZGd „de «Zy)a9distutils.unixccompiler Contains the UnixCCompiler class, a subclass of CCompiler that handles the "typical" Unix-style command-line C compiler: * macros defined with -Dname[=value] * macros undefined with -Uname * include search directories specified with -Idir * libraries specified with -lllib * library search directories specified with -Ldir * compile handled by 'cc' (or similar) executable with -c option: compiles .c to .o * link static library handled by 'ar' command (possibly with 'ranlib') * link shared library handled by 'cc -shared' éNé)Ú sysconfig)Únewer)Ú CCompilerÚgen_preprocess_optionsÚgen_lib_options)ÚDistutilsExecErrorÚ CompileErrorÚLibErrorÚ LinkError)Úlog)Úcompiler_fixupcó�—d}tjj|d«dk(rd}d||vr |dz }d||vrŒ |d|||dfS)zÿ For macOS, split command into 'env' portion (if any) and the rest of the linker command. >>> _split_env(['a', 'b', 'c']) ([], ['a', 'b', 'c']) >>> _split_env(['/usr/bin/env', 'A=3', 'gcc']) (['/usr/bin/env', 'A=3'], ['gcc']) rÚenvrÚ=N©ÚosÚpathÚbasename©ÚcmdÚpivots úH/usr/lib/python3.12/site-packages/setuptools/_distutils/unixccompiler.pyÚ _split_envr-sc€ð €EÜ ‡w�w×ј˜A™Ó 5Ò(؈Ø�S˜‘ZÑØ �Q‰JˆEð�S˜‘ZÒà ˆv�ˆ;˜˜E˜F˜ Ð #Ð#ócó`—tjj|d«dk(}|d|||dfS)a AIX platforms prefix the compiler with the ld_so_aix script, so split that from the linker command. >>> _split_aix(['a', 'b', 'c']) ([], ['a', 'b', 'c']) >>> _split_aix(['/bin/foo/ld_so_aix', 'gcc']) (['/bin/foo/ld_so_aix'], ['gcc']) rÚ ld_so_aixNrrs rÚ _split_aixr?s8€ô �G‰G× Ñ ˜S ™VÓ $¨ Ñ 3€EØ ˆv�ˆ;˜˜E˜F˜ Ð #Ð#rcó:—t|«}|d||k(r|nd}||dS)a The linker command usually begins with the compiler command (possibly multiple elements), followed by zero or more params for shared library building. If the LDSHARED env variable overrides the linker command, however, the commands may not match. Return the best guess of the linker parameters by stripping the linker command. If the compiler command does not match the linker command, assume the linker command is just the first element. >>> _linker_params('gcc foo bar'.split(), ['gcc']) ['foo', 'bar'] >>> _linker_params('gcc foo bar'.split(), ['other']) ['foo', 'bar'] >>> _linker_params('ccache gcc foo bar'.split(), 'ccache gcc'.split()) ['foo', 'bar'] >>> _linker_params(['gcc'], ['gcc']) [] Nr)Úlen)Ú linker_cmdÚ compiler_cmdÚc_lenrs rÚ_linker_paramsr$Ms0€ô. � Ó €EØ  Ð'¨<Ò7‰E¸Q€EØ �e�fÐ Ðrc ó"—eZdZdZddgdgdgddgdgddgddœZej ddd k(rd ged <gd ¢Zd Zd Z dZ dZ dZ dxZ xZZeZej dk(rdZ dd„Zd„Z dd„Z d d„Zd„Zd„Zd„Zd„Zed„«Zd!d„Zy)"Ú UnixCCompilerÚunixNÚccz-sharedÚarz-cr)Ú preprocessorÚcompilerÚ compiler_soÚ compiler_cxxÚ linker_soÚ linker_exeÚarchiverÚranlibéÚdarwinr1)z.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%sÚcygwinz.execóî—|jd||«}|\}}}t||«} |j| z} |r| jd|g«|r|| dd|r| j|«| j |«|j xs|duxs t ||«} | sy|r.|jtjj|«« |j| «y#t$r} t| «‚d} ~ wwxYw)Nú-or)Ú_fix_compile_argsrr*ÚextendÚappendÚforcerÚmkpathrrÚdirnameÚspawnr r ) ÚselfÚsourceÚ output_fileÚmacrosÚ include_dirsÚ extra_preargsÚextra_postargsÚ fixed_argsÚignoreÚpp_optsÚpp_argsÚ preprocessÚmsgs rrIzUnixCCompiler.preprocess‘sì€ð×+Ñ+¨D°&¸,ÓGˆ Ø'1Ñ$ˆ�˜ Ü(¨°Ó>ˆØ×#Ñ# gÑ-ˆÙ Ø �N‰N˜D +Ð.Ô /Ù Ø'ˆG�B�QˆKÙ Ø �N‰N˜>Ô *Ø�‰�vÔð —Z‘ZÒT ;°$Ð#6ÒT¼%ÀÈ Ó:Tˆ ÙØ á Ø �K‰KœŸ™Ÿ™¨ Ó4Ô 5ð $Ø �J‰J�wÕ øÜ!ò $ܘsÓ#Ð #ûð $úsà Cà C4Ã$ C/Ã/C4cóª—t|j||z«} |j||z|d|gz|z«y#t$r}t |«‚d}~wwxYw)Nr6)rr,r=r r ) r>ÚobjÚsrcÚextÚcc_argsrDrGr,rJs rÚ_compilezUnixCCompiler._compile¶s[€Ü$ T×%5Ñ%5°wÀÑ7OÓPˆ ð $Ø �J‰J�{ WÑ,°°T¸3Ð/?Ñ?À.ÑPÕ QøÜ!ò $ܘsÓ#Ð #ûð $ús›9¹ AÁ A Á Acóò—|j||«\}}|j||¬«}|j||«r‹|jtj j |««|j|j|gz|z|jz«|jr! |j|j|gz«yytjd|«y#t$r}t|«‚d}~wwxYw)N)Ú output_dirúskipping %s (up-to-date))Ú_fix_object_argsÚlibrary_filenameÚ _need_linkr;rrr<r=r0Úobjectsr1r r r Údebug)r>rWÚoutput_libnamerRrXÚ target_langÚoutput_filenamerJs rÚcreate_static_libzUnixCCompiler.create_static_lib½sÕ€ð#×3Ñ3°G¸ZÓHш�à×/Ñ/°È:Ð/ÓVˆà �?‰?˜7 OÔ 4Ø �K‰KœŸ™Ÿ™¨Ó8Ô 9Ø �J‰J�t—}‘}¨Ð'8Ñ8¸7ÑBÀTÇ\Á\ÑQÔ Rð�{Š{ð(Ø—J‘J˜tŸ{™{¨oÐ->Ñ>Õ?ðô �I‰IÐ0°/Õ Bøô*ò(Ü" 3›-Ð'ûð(úsÂ%Cà C6Ã& C1Ã1C6cóð—|j||«\}}|j|||«}|\}}}t||||«}t|tt d«f«s t d«‚|� tjj||«}|j||«�r-||jz|zd|gz}| rdg|dd| r| |dd| r|j| «|jtjj|«« |tj k(}|r |j"n |j$dd}| dk(ro|j&rct)|«\}}t+|«\}}t)|j&«\}}t)|j"«\}}t-||«}||z|z|z}t/||«}|j1||z«yt7j8d|«y#t2$r}t5|«‚d}~wwxYw)Nz%'output_dir' must be a string or Noner6z-grzc++rS)rTÚ _fix_lib_argsrÚ isinstanceÚstrÚtypeÚ TypeErrorrrÚjoinrVrWr8r;r<rÚ EXECUTABLEr/r.r-rrr$rr=r r r rX)r>Ú target_descrWr[rRÚ librariesÚ library_dirsÚruntime_library_dirsÚexport_symbolsrXrCrDÚ build_temprZrEÚlib_optsÚld_argsÚ building_exeÚlinkerrÚ linker_neÚaixÚ linker_naÚ_Úcompiler_cxx_neÚ linker_exe_neÚparamsrJs rÚlinkzUnixCCompiler.linkÕsâ€ð #×3Ñ3°G¸ZÓHш�Ø×'Ñ'¨ °<ÐAUÓVˆ Ø8BÑ5ˆ �<Ð!5ä" 4¨Ð7KÈYÓWˆÜ˜*¤s¬D°«JÐ&7Ô8ÜÐCÓDÐ DØ Ð !Ü Ÿg™gŸl™l¨:°ÓGˆOà �?‰?˜7 OÕ 4Ø § ¡ Ñ,¨xÑ7¸4ÀÐ:QÑQˆGÙØ#˜f�˜˜� ÙØ+�˜˜� ÙØ—‘˜~Ô.Ø �K‰KœŸ™Ÿ™¨Ó8Ô 9ð %ð +¬i×.BÑ.BÑB� Ù-9˜$Ÿ/š/¸t¿~¹~ÉqÐQ�à %Ò'¨D×,=Ò,=Ü%/°Ó%7‘N�C˜Ü%/° Ó%:‘N�C˜Ü)3°D×4EÑ4EÓ)FÑ&�A�Ü'1°$·/±/Ó'BÑ$�A�}ä+¨I°}ÓE�FØ  3™Y¨Ñ8¸6ÑA�Fä'¨°Ó8�à— ‘ ˜6 GÑ+Õ,ô �I‰IÐ0°/Õ Bøô&ò %Ü “nÐ$ûð %úsÄCGÇ G5Ç% G0Ç0G5có —d|zS)Nú-L©)r>Údirs rÚlibrary_dir_optionz UnixCCompiler.library_dir_optionó €Ø�c‰zÐrcóª—tjd«}tjj t j |«d«}d|vxsd|vS)NÚCCrÚgcczg++)rÚget_config_varrrrÚshlexÚsplit)r>Úcc_varr+s rÚ_is_gcczUnixCCompiler._is_gccsI€Ü×)Ñ)¨$Ó/ˆÜ—7‘7×#Ñ#¤E§K¡K°Ó$7¸Ñ$:Ó;ˆØ˜Ð Ò5 E¨XÐ$5Ð5rcóV—tjdddk(r(ddlm}m}|«}|r||«ddgk\rd|zSd|zStjdd d k(rd |zStjddd k(r|j «rd ndd|zgSt jd«dk(rd|zSd|zS)Nr2r3r)Úget_macosx_target_verÚ split_versioné éz -Wl,-rpath,rxéÚfreebsdz -Wl,-rpath=zhp-uxz-Wl,+sz+sÚGNULDÚyesz-Wl,--enable-new-dtags,-Rz-Wl,-R)ÚsysÚplatformÚdistutils.utilr†r‡r„rr€)r>rzr†r‡Úmacosx_target_vers rÚruntime_library_dir_optionz(UnixCCompiler.runtime_library_dir_optionsÇ€ô �<‰<˜˜Ð ˜xÒ 'ß Ká 5Ó 7Ð Ù ¡]Ð3DÓ%EÈ"ÈaÈÒ%PØ$ sÑ*Ð*à˜c‘zÐ!Ü �\‰\˜"˜1Ð  Ò *Ø  3Ñ&Ð &Ü �\‰\˜"˜1Ð  Ò (à ŸL™LœN‘°Ø�s‘ ðð ô × #Ñ # GÓ ,°Ò 5ð/°Ñ4Ð 4à˜c‘>Ð !rcó —d|zS)Nz-lry)r>Úlibs rÚlibrary_optionzUnixCCompiler.library_optionDr|rcóf—tjd«}tjd|«}tj dk(xr<|xr8|j d«xs%|j d«xr|j d« }|r2tjj|jd«|dd«S|S) a° macOS users can specify an alternate SDK using'-isysroot'. Calculate the SDK root if it is specified. Note that, as of Xcode 7, Apple SDKs may contain textual stub libraries with .tbd extensions rather than the normal .dylib shared libraries installed in /. The Apple compiler tool chain handles this transparently but it can cause problems for programs that are being built with an SDK and searching for specific libraries. Callers of find_library_file need to keep in mind that the base filename of the returned SDK library file might have a different extension from that of the library file installed on the running system, for example: /Applications/Xcode.app/Contents/Developer/Platforms/ MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/ usr/lib/libedit.tbd vs /usr/lib/libedit.dylib ÚCFLAGSz-isysroot\s*(\S+)r3z/System/z/usr/z /usr/local/rN) rr€ÚreÚsearchrŽr�Ú startswithrrrcÚgroup)rzÚcflagsÚmatchÚ apply_roots rÚ _library_rootzUnixCCompiler._library_rootGs£€ô*×)Ñ)¨(Ó3ˆÜ— ‘ Ð.°Ó7ˆô �L‰L˜HÑ $ò Øò 𗑘zÓ*òSØ—N‘N 7Ó+ÒQ°C·N±NÀ=Ó4QÐ0Qð ñ9CŒr�w‰w�|‰|˜EŸK™K¨›N¨C°°¨GÓ4ÐKÈÐKrc󇇗ˆˆfd„dj«D«}t‰j|«}d„tj||«D«}t t jj|«}t|d«S)a/ Second-guess the linker with not much hard data to go on: GCC seems to prefer the shared library, so assume that *all* Unix C compilers do, ignoring even GCC's "-static" option. >>> compiler = UnixCCompiler() >>> compiler._library_root = lambda dir: dir >>> monkeypatch = getfixture('monkeypatch') >>> monkeypatch.setattr(os.path, 'exists', lambda d: 'existing' in d) >>> dirs = ('/foo/bar/missing', '/foo/bar/existing') >>> compiler.find_library_file(dirs, 'abc').replace('\\', '/') '/foo/bar/existing/libabc.dylib' >>> compiler.find_library_file(reversed(dirs), 'abc').replace('\\', '/') '/foo/bar/existing/libabc.dylib' >>> monkeypatch.setattr(os.path, 'exists', ... lambda d: 'existing' in d and '.a' in d) >>> compiler.find_library_file(dirs, 'abc').replace('\\', '/') '/foo/bar/existing/libabc.a' >>> compiler.find_library_file(reversed(dirs), 'abc').replace('\\', '/') '/foo/bar/existing/libabc.a' c3óD•K—|]}‰j‰|¬«–—Œy­w))Úlib_typeN)rU)Ú.0rar”r>s €€rÚ z2UnixCCompiler.find_library_file..�s)øèø€ð á@�ð × !Ñ ! #°Ð !× 5Ù@ùsƒ zdylib xcode_stub shared staticc3óbK—|]'\}}tjj||«–—Œ)y­w)N)rrrc)r£ÚrootÚlib_names rr¤z2UnixCCompiler.find_library_file..ˆs+èø€ð á"E‘��hô �G‰G�L‰L˜˜x× (Ù"Eùs‚-/N) r‚ÚmaprŸÚ itertoolsÚproductÚfilterrrÚexistsÚnext)r>Údirsr”rXÚ lib_namesÚrootsÚsearchedÚfounds` ` rÚfind_library_filezUnixCCompiler.find_library_filejspù€ô. à8×>Ñ>Ô@ó ˆ ô �D×&Ñ&¨Ó-ˆñ ä"+×"3Ñ"3°E¸9Ô"Eó ˆô ”r—w‘w—~‘~ xÓ0ˆô�E˜4Ó Ð r)NNNNN)NrN) NNNNNrNNNN)r)Ú__name__Ú __module__Ú __qualname__Ú compiler_typeÚ executablesrŽr�Úsrc_extensionsÚ obj_extensionÚstatic_lib_extensionÚshared_lib_extensionÚdylib_lib_extensionÚxcode_stub_lib_extensionÚstatic_lib_formatÚshared_lib_formatÚdylib_lib_formatÚxcode_stub_lib_formatÚ exe_extensionrIrPr\rvr{r„r’r•Ú staticmethodrŸr³ryrrr&r&is(„Ø€MðØ�FØ�vؘؘIÐ&Ø�fؘ5�MØñ €Kð ‡|�|�B�QИ8Ò#Ø!)  ˆ �HÑò?€NØ€MØÐØ ÐØ"ÐØ%ÐØ?HÐHÐÐHÐ)Ð,<Ø,ÐØ ‡|�|�xÒØˆ ð ØØØØó#$òJ$ðNRóCð:ØØØ!ØØØØØØó9Cò~ò6ò &"òPðñ Lóð LôD&!rr&)Ú__doc__rrŽr˜r�r©ÚrÚ _modifiedrÚ ccompilerrrrÚerrorsr r r r Ú_logr Ú _macos_compatrrrr$r&ryrrÚrÌsPðñ ó Û Û Û ÛåÝßIÑIßIÓIÝÝ)ò$$ò$ $òô8g!�Iõg!r