o 0i=3 @ sj d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm Z dddZ G d d d eZd ddZdS ) N)Command)DistutilsExecError)customize_compiler)logz.cz.cxx)czc++c @ s e Zd ZdZg dZdd Zdd Zdd Zd d Zdd Z d d Z dd Zdd Zdd Z d(ddZ d(ddZd)ddZ d*ddZ d*dd Z !d+d"d#Zdddg fd$d%Z d)d&d'ZdS ),configzprepare to build) )z compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z include-dirs=Iz.list of directories to search for header files)zdefine=DzC preprocessor macros to define)zundef=Uz!C preprocessor macros to undefine)z libraries=lz!external C libraries to link with)z library-dirs=Lz.directories to search for external C libraries)noisyNz1show every action (compile, link, run, ...) taken)zdump-sourceNz=dump generated source files before attempting to compile themc C s4 d | _ d | _d | _d | _d | _d| _d| _g | _d S )N )compilerZccinclude_dirs librarieslibrary_dirsr dump_source temp_filesself r ?/opt/alt/python310/lib64/python3.10/distutils/command/config.pyinitialize_options3 s zconfig.initialize_optionsc C s | j d u r | jj p g | _ nt| j tr| j tj| _ | jd u r$g | _nt| jtr/| jg| _| jd u r9g | _d S t| jtrI| jtj| _d S d S N) r Zdistribution isinstancestrsplitospathsepr r r r r r finalize_optionsB s zconfig.finalize_optionsc C s d S r r r r r r runR s z config.runc C s ddl m}m} t| j|s>|| j| jdd| _t| j | jr(| j| j | j r2| j | j | jr@| j| j d S d S d S )Nr ) CCompilernew_compilerr )r dry_runZforce) distutils.ccompilerr" r# r r r$ r r Zset_include_dirsr Z set_librariesr Zset_library_dirs)r r" r# r r r _check_compilerY s zconfig._check_compilerc C s dt | }t|d4}|r|D ] }|d| q|d || |d dkr7|d W d |S W d |S 1 sBw Y |S )NZ_configtestwz#include <%s> )LANG_EXTopenwrite)r bodyheaderslangfilenamefileheaderr r r _gen_temp_sourcefilek s zconfig._gen_temp_sourcefilec C s<