o 6a@sdZddlZddlZddlZddlmZmZmZddlm Z ddl m Z ddl m Z ddlmZdd Ze e d e dd 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}|ddkr#d|vr|dd|vr|d|dg7}||_dtjvrkddlm}dtjd} d|dd} d|j} | | vrX| | | } | |_d|j } | | vrk| | |_ d tj |jd|f} t |d d rd d |dg}ng}z|j |j||d|g||| dWnty}z t|}t|dd}~ww|rtjdkrtddd|dgt|dd}|t|||WddS1swYdSdS)z9Compile a single source files with a Unix-style compiler.raCCz-Aez-Aaz-AAOPT)get_config_vars z%s: %s _auto_dependsFz-MMDz-MFz.dz-odisplayNzoschtagz-tcIBM1047a) compiler_soremoveosenviron sysconfigr joinsplitreplace linker_sopathbasenamegetattrspawnrstrrsysplatform subprocess check_outputopenwriter)selfobjsrcextcc_argsextra_postargspp_optsccompr optgcv_optccomp_sllink_srdepsemsgfr8?/usr/lib/python3/dist-packages/numpy/distutils/unixccompiler.pyUnixCCompiler__compilesR              "r:_compilec CsB|||\}}|j||d}|||rzt|Wn ttfy'Ynw|tj |||j }|rc|dd}|dd}dtj |j dt ||f}|j|j |g||d|s8|jrdtj |jd|f}z|j|j|g|dWdSty} z t| } t| dd} ~ wwdStd|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 %srrz%s:@ %szskipping %s (up-to-date))_fix_object_argslibrary_filename _need_linkrunlinkIOErrorOSErrormkpathrdirnameobjectsrarchiverlenr ranlibrr!rrdebug) r(rFoutput_libnamer<rJ target_langoutput_filename tmp_objectsrr5r6r8r8r9UnixCCompiler_create_static_libHsN       rOcreate_static_lib)NrN)__doc__rr"r$distutils.errorsrrrdistutils.unixccompilerrnumpy.distutils.ccompilerrnumpy.distutils.misc_utilrnumpy.distutilsrr:rOr8r8r8r9s      5 C