B @`@sdZddlZddlZddlZddlmZmZmZddlm Z ddl m Z ddl m Z ddlmZdd 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|kr$|dd|kr6|d|dg7}||_dtjkrddlm}dtjd} d|dd} d|j} | | kr| | | } | |_d|j } | | kr| | |_ d tj |jd|f} t |d d rd d |dg}ng}y*|j |j||d|g||| dWn4tk rp}zt|}t|Wdd}~XYnX|rtjdkrtddd|dgt|dd}|t|||WdQRXdS)z9Compile a single source files with a Unix-style compiler.rZaCCz-Aez-Aaz-AAOPT)get_config_vars z%s: %sZ _auto_dependsFz-MMDz-MFz.dz-o)displayNZzosZchtagz-tcZIBM1047a) compiler_soremoveosenviron sysconfigr joinsplitreplace linker_sopathbasenamegetattrspawnrstrrsysplatform subprocess check_outputopenwriter)selfobjsrcextZcc_argsZextra_postargsZpp_optsZccompr optZgcv_optZccomp_sZllink_sr depsemsgfr+A/tmp/pip-unpacked-wheel-ecq9wray/numpy/distutils/unixccompiler.pyUnixCCompiler__compilesD           r-_compilec CsP|||\}}|j||d}|||r@yt|Wnttfk rRYnX|tj |||j }xZ|r|dd}|dd}dtj |j dt ||f}|j|j |g||dqrW|jrLdtj |jd|f}y|j|j|g|dWn4tk r<} zt| } t| Wdd} ~ XYnXn 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 %sr)r z%s:@ %szskipping %s (up-to-date))Z_fix_object_argsZlibrary_filenameZ _need_linkrunlinkIOErrorOSErrormkpathrdirnameobjectsrarchiverlenrZranlibrrrrdebug) r"r6Zoutput_libnamer/r9Z target_langZoutput_filenameZ tmp_objectsr r(r)r+r+r,UnixCCompiler_create_static_libHs8      r:Zcreate_static_lib)NrN)__doc__rrrdistutils.errorsrrrZdistutils.unixccompilerrZnumpy.distutils.ccompilerrZnumpy.distutils.misc_utilrZnumpy.distutilsrr-r:r+r+r+r,s    5  B