B []9@sdZddlmZmZmZddlZddlmZmZddl Tddl m Z ddl m Z ddlmZejdd krxd d lmZn dd lmZd d Ze ededddZe ededS)z> unixccompiler - can handle very long argument lists for ar. )divisionabsolute_importprint_functionN)DistutilsExecError CompileError)*)replace_method) get_exception)_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||| dWn(tk rdtt}t|YnX|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)displayaN) compiler_soremoveosenvirondistutils.sysconfigrjoinsplitreplace linker_sopathbasenamegetattrspawnrstrr ropenwriter )selfobjsrcextZcc_argsZextra_postargsZpp_optsZccomproptZgcv_optZccomp_sZllink_srdepsmsgfr+@/tmp/pip-install-svzetoqp/numpy/numpy/distutils/unixccompiler.pyUnixCCompiler__compiles@           r-_compilec CsD|||\}}|j||d}|||r4yt|Wnttfk rRYnX|tj |||j }xZ|r|dd}|dd}dtj |j dt ||f}|j|j |g||dqrW|jr@dtj |jd|f}y|j|j|g|dWn(tk r0tt} t| YnXn 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)rz%s:@ %szskipping %s (up-to-date))Z_fix_object_argsZlibrary_filenameZ _need_linkrunlinkIOErrorOSErrormkpathrdirnameobjectsrarchiverlenrranlibrr r LibErrorr debug) r#r6Zoutput_libnamer/r;Z target_langZoutput_filenameZ tmp_objectsrr)r+r+r,UnixCCompiler_create_static_libGs8       r<Zcreate_static_lib)NrN)__doc__ __future__rrrrdistutils.errorsrrZdistutils.unixccompilerZnumpy.distutils.ccompilerrZnumpy.distutils.compatr Znumpy.distutils.misc_utilr sys version_infor Znumpy.distutilsr-Z UnixCCompilerr<r+r+r+r,s    /  B