a :jg2@sdZddlZddlZddlZddlZddlmZmZmZddl m Z ddl m Z ddl mZddlmZdd Ze e d edd d Ze e d edS)z> unixccompiler - can handle very long argument lists for ar. N) CompileErrorDistutilsExecErrorLibError) UnixCCompiler)replace_method)_commandline_dep_string)logc Cs|j}|ddkrFd|vr$|dd|vr6|d|dg7}||_dtjvrddlm}tttjd} tt|dd} t|j} | | vr| | | } t| |_t|j } | | vr|j t| |_ dtj |jd|f} t |d d rd d |d g}ng}z*|j|j||d|g||| dWn8tyz}zt|}t|dWYd}~n d}~00|rtjdkrtddd|d gt|d d"}|t|||Wdn1s0YdS)z9Compile a single source files with a Unix-style compiler.rZaCCz-Aez-Aaz-AAOPT)get_config_varsz%s: %sZ _auto_dependsFz-MMDz-MFz.dz-odisplayNZzosZchtagz-tcZIBM1047a) compiler_soremoveosenviron sysconfigr shlexjoinsplitreplace linker_sopathbasenamegetattrspawnrstrrsysplatform subprocess check_outputopenwriter)selfobjsrcextZcc_argsZextra_postargsZpp_optsZccompr optZgcv_optZccomp_sZllink_sr depsemsgfr,G/usr/local/lib/python3.9/site-packages/numpy/distutils/unixccompiler.pyUnixCCompiler__compilesJ             r._compilec CsJ|||\}}|j||d}|||r:zt|WntyLYn0|tj|||j }|r|dd}|dd}dtj |j dt ||f}|j |j |g||dqj|jrFdtj |jd|f}z|j |j|g|dWn8ty6} zt| } t| dWYd} ~ n d} ~ 00n td|dS) a Build a static library in a separate sub-process. Parameters ---------- objects : list or tuple of str List of paths to object files used to build the static library. output_libname : str The library name as an absolute or relative (if `output_dir` is used) path. output_dir : str, optional The path to the output directory. Default is None, in which case the ``output_dir`` attribute of the UnixCCompiler instance. debug : bool, optional This parameter is not used. target_lang : str, optional This parameter is not used. Returns ------- None ) output_dirN2z %s: adding %d object files to %srr z%s:@ %szskipping %s (up-to-date))Z_fix_object_argsZlibrary_filenameZ _need_linkrunlinkOSErrormkpathrdirnameobjectsrarchiverlenrZranlibrrrrdebug) r#r6Zoutput_libnamer0r9Z target_langZoutput_filenameZ tmp_objectsr r)r*r,r,r-UnixCCompiler_create_static_libIsB      " r:Zcreate_static_lib)NrN)__doc__rrrrdistutils.errorsrrrZdistutils.unixccompilerrZnumpy.distutils.ccompilerrZnumpy.distutils.misc_utilrZnumpy.distutilsrr.r:r,r,r,r-s     5  C