B { `@s~dZddlZddlmZmZmZddlmZddlm Z ddl m Z ddl m Z dd Ze ed edd d Ze ed 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|rt|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)displayNa) compiler_soremoveosenvirondistutils.sysconfigr joinsplitreplace linker_sopathbasenamegetattrspawnrstrropenwriter)selfobjsrcextZcc_argsZextra_postargsZpp_optsZccompr optZgcv_optZccomp_sZllink_sr depsemsgfr'A/tmp/pip-unpacked-wheel-4iou4664/numpy/distutils/unixccompiler.pyUnixCCompiler__compiles@          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) rr2Zoutput_libnamer+r5Z target_langZoutput_filenameZ tmp_objectsr r$r%r'r'r(UnixCCompiler_create_static_lib@s8      r6Zcreate_static_lib)NrN)__doc__rdistutils.errorsrrrZdistutils.unixccompilerrZnumpy.distutils.ccompilerrZnumpy.distutils.misc_utilrZnumpy.distutilsrr)r6r'r'r'r(s    /  B