B  âéÚ"(ã@sšdZddlZddlZddlZddlZddlmZddlmZddl m Z m Z m Z ddl mZmZmZmZddlmZejdkr†ddlZGd d „d e ƒZdS) 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Údarwinc @säeZdZdZddgdgdgddgdgddgddœZejdd…d krNd ged <d d d dddgZdZdZ dZ dZ dZ dZ ZZeZejdkrdZd,dd„Zdd„Zd-dd„Zd.d d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zd/d*d+„ZdS)0Ú UnixCCompilerÚunixNÚccz-sharedÚarz-cr)Ú preprocessorÚcompilerÚ compiler_soÚ compiler_cxxÚ linker_soÚ linker_exeÚarchiverÚranlibér rz.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%sÚcygwinz.exec CsÒ| d||¡}|\}}}t||ƒ} |j| } |r>|  d|g¡|rN|| dd…<|r\|  |¡|  |¡|js~|dks~t||ƒrÎ|r”| tj   |¡¡y|  | ¡Wn*t k rÌ} z t | ƒ‚Wdd} ~ XYnXdS)Nz-or)Z_fix_compile_argsrrÚextendÚappendÚforcerÚmkpathÚosÚpathÚdirnameÚspawnrr) ÚselfÚsourceZ output_fileZmacrosÚ include_dirsÚ extra_preargsÚextra_postargsÚ fixed_argsÚignoreÚpp_optsZpp_argsÚmsg©r,ú™/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el9.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/_distutils/unixccompiler.pyÚ preprocessUs$      zUnixCCompiler.preprocessc Csp|j}tjdkr t |||¡}y | |||d|g|¡Wn*tk rj}z t|ƒ‚Wdd}~XYnXdS)Nr z-o)rÚsysÚplatformÚ _osx_supportÚcompiler_fixupr"rr) r#ÚobjÚsrcÚextZcc_argsr'r*rr+r,r,r-Ú_compileos   zUnixCCompiler._compilerc Cs²| ||¡\}}|j||d}| ||¡r¢| tj |¡¡| |j|g||j ¡|j r®y| |j |g¡Wq®t k rž}z t |ƒ‚Wdd}~XYq®Xn t  d|¡dS)N)Ú output_dirzskipping %s (up-to-date))Ú_fix_object_argsÚlibrary_filenameÚ _need_linkrrr r!r"rÚobjectsrrr r Údebug)r#r;Zoutput_libnamer7r<Ú target_langÚoutput_filenamer+r,r,r-Úcreate_static_libzs zUnixCCompiler.create_static_libc CsÞ| ||¡\}}| |||¡}|\}}}t||||ƒ}t|ttdƒfƒsPtdƒ‚|dk rftj  ||¡}|  ||¡rÎ||j |d|g}| rœdg|dd…<| r¬| |dd…<| rº|  | ¡|  tj |¡¡yÒ|tjkrè|jdd…}n|jdd…}| dkrv|jrvd}tj |d¡dkrDd}xd||krB|d7}q(Wtj ||¡d kr`d}nd}|j||||<tjd krŽt ||¡}| ||¡Wn,tk rÊ}z t|ƒ‚Wdd}~XYnXn t d |¡dS) Nz%'output_dir' must be a string or Nonez-oz-grzc++Úenvéú=Z ld_so_aixr zskipping %s (up-to-date))r8Z _fix_lib_argsrÚ isinstanceÚstrÚtypeÚ TypeErrorrr Újoinr:r;rrr!rZ EXECUTABLErrrÚbasenamer/r0r1r2r"rr r r<)r#Z target_descr;r>r7Ú librariesÚ library_dirsÚruntime_library_dirsÚexport_symbolsr<r&r'Ú build_tempr=r(Zlib_optsZld_argsZlinkerÚiÚoffsetr+r,r,r-Úlink”sN      zUnixCCompiler.linkcCsd|S)Nz-Lr,)r#Údirr,r,r-Úlibrary_dir_optionÖsz UnixCCompiler.library_dir_optioncCsd|kpd|kS)NÚgcczg++r,)r#Z compiler_namer,r,r-Ú_is_gccÙszUnixCCompiler._is_gcccCsÚtj t t d¡¡d¡}tjdd…dkrjddl m }m }|ƒ}|r`||ƒddgkr`d|Sd |SnNtjdd …d kr„d |Stjdd…d kr¸|  |¡r¬dd |gSdd |gSt d¡dkrÎd|Sd|SdS)NÚCCrrr )Úget_macosx_target_verÚ split_versioné éz -Wl,-rpath,z-LéZfreebsdz -Wl,-rpath=zhp-uxz-Wl,+sz+sÚGNULDÚyesz-Wl,--enable-new-dtags,-Rz-Wl,-R) rr rHÚshlexÚsplitrÚget_config_varr/r0Údistutils.utilrVrWrT)r#rQrrVrWZmacosx_target_verr,r,r-Úruntime_library_dir_optionÜs     z(UnixCCompiler.runtime_library_dir_optioncCsd|S)Nz-lr,)r#Úlibr,r,r-Úlibrary_optionszUnixCCompiler.library_optioncCs’|j|dd}|j|dd}|j|dd}|j|dd}tjdkrpt d¡}t d|¡} | dkrfd } n |  d ¡} x|D]} tj   | |¡} tj   | |¡} tj   | |¡}tj   | |¡}tjdkrD|   d ¡sä|   d ¡rD|   d ¡sDtj   | | d d…|¡} tj   | | d d…|¡} tj   | | d d…|¡}tj   | | d d…|¡}tj   | ¡rV| Stj   |¡rh|Stj   | ¡rz| Stj   |¡rx|SqxWdS)NÚshared)Zlib_typeÚdylibÚ xcode_stubÚstaticr ÚCFLAGSz-isysroot\s*(\S+)ú/rAz/System/z/usr/z /usr/local/) r9r/r0rr_ÚreÚsearchÚgrouprr rGÚ startswithÚexists)r#Údirsrbr<Zshared_fZdylib_fZ xcode_stub_fZstatic_fÚcflagsÚmZsysrootrQrdrergrfr,r,r-Úfind_library_files>       zUnixCCompiler.find_library_file)NNNNN)NrN) NNNNNrNNNN)r)Ú__name__Ú __module__Ú __qualname__Ú compiler_typeZ executablesr/r0Zsrc_extensionsZ obj_extensionZstatic_lib_extensionÚshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ exe_extensionr.r6r?rPrRrTrarcrrr,r,r,r-r -sD      >'r )Ú__doc__rr/rjr]Ú distutilsrÚdistutils.dep_utilrÚdistutils.ccompilerrrrÚdistutils.errorsrrr r r r0r1r r,r,r,r-Ús