1Et x d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m Z ddd Z G d de Zd dZ dS )a distutils.command.config Implements the Distutils 'config' command, a (mostly) empty command class that exists mainly to be sub-classed by specific module distributions and applications. The idea is that while every "config" command is different, at least they're all named the same, and users always see "config" in the list of standard commands. Also, this is a good place to put common configure-like tasks: "try to compile this C code", or "figure out where this header file lives". N)Command)DistutilsExecError)customize_compiler)logz.cz.cxx)czc++c e Zd ZdZg dZd Zd Zd Zd Zd Z d Z d Zd Zd Z ddZ ddZddZ ddZ ddZ ddZdddg fdZ ddZdS )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 v d | _ d | _ d | _ d | _ d | _ d| _ d| _ g | _ d S )N )compilerccinclude_dirs librarieslibrary_dirsr dump_source temp_filesselfs ?/opt/alt/python311/lib64/python3.11/distutils/command/config.pyinitialize_optionszconfig.initialize_options3 sE c | j | j j pg | _ nCt | j t r)| j t j | _ | j g | _ n't | j t r | j g| _ | j g | _ d S t | j t r+| j t j | _ d S d S N) r distribution isinstancestrsplitospathsepr r r s r finalize_optionszconfig.finalize_optionsB s $ $ 1 > D"D )3 / / D $ 1 7 7 C CD>!DNN , , ."n-DN$ "D )3 / / D $ 1 7 7 C CD D Dr c d S r r s r runz config.runR s r c ddl m}m} t | j | s || j | j d | _ t | j | j r| j | j | j r| j | j | j r#| j | j dS dS dS )z^Check that 'self.compiler' really is a CCompiler object; if not, make it one. r ) CCompilernew_compilerr )r dry_runforceN) distutils.ccompilerr+ r, r! r r- r r set_include_dirsr set_librariesr set_library_dirs)r r+ r, s r _check_compilerzconfig._check_compilerY s @???????$-33 B(L$-15QH H HDMt}--- B ..t/@AAA~ < ++DN;;; B ..t/@AAAAA B B B Br c J dt | z }t |d 5 }|r2|D ]}| d|z | d | | |d dk r| d d d d n# 1 swxY w Y |S )N_configtestwz#include <%s> )LANG_EXTopenwrite)r bodyheaderslangfilenamefileheaders r _gen_temp_sourcefilezconfig._gen_temp_sourcefilek s 8D>1 (C !D !% ; ;FJJ069:::: 4 JJtBx4 4 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! s A+BBBc | ||| }d}| j ||g | j ||| ||fS )Nz _configtest.ir )rB r extendr preprocess)r r<