<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>

]$3                 @   s   d  d l  Z  d  d l Z d  d l Z d  d l m Z d  d l m Z d  d l m Z d  d l	 m
 Z
 d d d d	 i Z Gd
 d   d e  Z d d d  Z d S)    N)Command)DistutilsExecError)customize_compiler)logcz.czc++z.cxxc               @   si  e  Z d  Z d Z d> d? d@ dA dB dC dD dE dF g	 Z d d   Z d d   Z d d   Z d  d!   Z d" d#   Z	 d$ d%   Z
 d& d'   Z d( d)   Z d* d+   Z d d d d, d- d.  Z d d d d, d/ d0  Z d d d, d1 d2  Z d d d d d, d3 d4  Z d d d d d, d5 d6  Z d d d d d7 d7 d8 d9  Z d d d g  d: d;  Z d d d, d< d=  Z d S)Gconfigzprepare to build	compiler=Nspecify the compiler typecc=specify the compiler executableinclude-dirs=I.list of directories to search for header filesdefine=DC preprocessor macros to defineundef=U!C preprocessor macros to undefine
libraries=l!external C libraries to link withlibrary-dirs=L.directories to search for external C librariesnoisy1show every action (compile, link, run, ...) takendump-source=dump generated source files before attempting to compile themc             C   sL   d  |  _  d  |  _ d  |  _ d  |  _ d  |  _ d |  _ d |  _ g  |  _ d  S)N   )compilerZccinclude_dirs	librarieslibrary_dirsr   dump_source
temp_files)self r'   +/opt/alt/python35/lib64/python3.5/config.pyinitialize_options3   s    							zconfig.initialize_optionsc             C   s   |  j  d  k r' |  j j  p g  |  _  n* t |  j  t  rQ |  j  j t j  |  _  |  j d  k rl g  |  _ n! t |  j t  r |  j g |  _ |  j d  k r g  |  _ n* t |  j t  r |  j j t j  |  _ d  S)N)	r!   Zdistribution
isinstancestrsplitospathsepr"   r#   )r&   r'   r'   r(   finalize_optionsB   s    zconfig.finalize_optionsc             C   s   d  S)Nr'   )r&   r'   r'   r(   runR   s    z
config.runc             C   s   d d l  m } m } t |  j |  s | d |  j d |  j d d  |  _ t |  j  |  j ru |  j j |  j  |  j	 r |  j j
 |  j	  |  j r |  j j |  j  d  S)Nr   )	CCompilernew_compilerr    dry_runforcer   )distutils.ccompilerr1   r2   r*   r    r3   r   r!   Zset_include_dirsr"   Zset_librariesr#   Zset_library_dirs)r&   r1   r2   r'   r'   r(   _check_compilerY   s    			zconfig._check_compilerc             C   s   d t  | } t | d  } | rR x | D] } | j d |  q* W| j d  | j |  | d d k r| | j d  | j   | S)NZ_configtestwz#include <%s>

r   )LANG_EXTopenwriteclose)r&   bodyheaderslangfilenamefileheaderr'   r'   r(   _gen_temp_sourcefilek   s    
zconfig._gen_temp_sourcefilec             C   sT   |  j  | | |  } d } |  j j | | g  |  j j | | d | | | f S)Nz_configtest.ir!   )rD   r%   extendr    Z
preprocess)r&   r>   r?   r!   r@   srcoutr'   r'   r(   _preprocessx   s
    zconfig._preprocessc             C   s   |  j  | | |  } |  j r/ t | d |  |  j j | g  \ } |  j j | | g  |  j j | g d | | | f S)Nzcompiling '%s':r!   )rD   r$   	dump_filer    Zobject_filenamesr%   rE   compile)r&   r>   r?   r!   r@   rF   objr'   r'   r(   _compile   s    	zconfig._compilec       
   	   C   s   |  j  | | | |  \ } } t j j t j j |   d }	 |  j j | g |	 d | d | d | |  j j d  k	 r |	 |  j j }	 |  j j	 |	  | | |	 f S)Nr   r"   r#   Ztarget_lang)
rL   r-   pathsplitextbasenamer    Zlink_executableZexe_extensionr%   append)
r&   r>   r?   r!   r"   r#   r@   rF   rK   progr'   r'   r(   _link   s    "zconfig._linkc             G   sl   | s |  j  } g  |  _  t j d d j |   x4 | D], } y t j |  Wq8 t k
 rc Yq8 Xq8 Wd  S)Nzremoving: %s )r%   r   infojoinr-   removeOSError)r&   	filenamesrA   r'   r'   r(   _clean   s    		zconfig._cleanr   c             C   sc   d d l  m } |  j   d } y |  j | | | |  Wn | k
 rT d } Yn X|  j   | S)Nr   )CompileErrorTF)r5   rZ   r6   rH   rY   )r&   r>   r?   r!   r@   rZ   okr'   r'   r(   try_cpp   s    

zconfig.try_cppc             C   s   |  j    |  j | | | |  \ } } t | t  rF t j |  } t |  } d }	 x3 | j   }
 |
 d k rt P| j |
  r[ d }	 Pq[ W| j	   |  j
   |	 S)NF T)r6   rH   r*   r+   rerJ   r;   readlinesearchr=   rY   )r&   patternr>   r?   r!   r@   rF   rG   rB   matchliner'   r'   r(   
search_cpp   s     	


zconfig.search_cppc             C   s|   d d l  m } |  j   y  |  j | | | |  d } Wn | k
 rT d } Yn Xt j | rg d pj d  |  j   | S)Nr   )rZ   TFzsuccess!zfailure.)r5   rZ   r6   rL   r   rT   rY   )r&   r>   r?   r!   r@   rZ   r[   r'   r'   r(   try_compile   s    


zconfig.try_compilec       
      C   s   d d l  m } m } |  j   y& |  j | | | | | |  d }	 Wn | | f k
 rf d }	 Yn Xt j |	 ry d p| d  |  j   |	 S)Nr   )rZ   	LinkErrorTFzsuccess!zfailure.)r5   rZ   rf   r6   rR   r   rT   rY   )
r&   r>   r?   r!   r"   r#   r@   rZ   rf   r[   r'   r'   r(   try_link   s    


zconfig.try_linkc             C   s   d d l  m } m } |  j   yA |  j | | | | | |  \ }	 }
 } |  j | g  d } Wn! | | t f k
 r d } Yn Xt j | r d p d  |  j	   | S)Nr   )rZ   rf   TFzsuccess!zfailure.)
r5   rZ   rf   r6   rR   spawnr   r   rT   rY   )r&   r>   r?   r!   r"   r#   r@   rZ   rf   rF   rK   Zexer[   r'   r'   r(   try_run   s    


zconfig.try_runr   c       	      C   s   |  j    g  } | r' | j d |  | j d  | rN | j d |  n | j d |  | j d  d j |  d } |  j | | | | |  S)Nz
int %s ();zint main () {z  %s();z  %s;}r8   )r6   rP   rU   rg   )	r&   funcr?   r!   r"   r#   Zdeclcallr>   r'   r'   r(   
check_func  s    
zconfig.check_funcc             C   s*   |  j    |  j d | | | g | |  S)Nzint main (void) { })r6   rg   )r&   Zlibraryr#   r?   r!   Zother_librariesr'   r'   r(   	check_lib6  s    

zconfig.check_libc             C   s   |  j  d d d | g d |  S)Nr>   z/* No body */r?   r!   )r\   )r&   rC   r!   r#   r@   r'   r'   r(   check_headerD  s    zconfig.check_header)r   Nr	   )r
   Nr   )r   r   r   )r   r   r   )r   r   r   )r   r   r   )r   r   r   )r   Nr   )r   Nr   )__name__
__module____qualname__descriptionZuser_optionsr)   r/   r0   r6   rD   rH   rL   rR   rY   r\   rd   re   rg   ri   rm   rn   ro   r'   r'   r'   r(   r      sT            					r   c          
   C   sb   | d  k r  t  j d |   n t  j |  t |   } z t  j | j    Wd  | j   Xd  S)Nz%s)r   rT   r;   readr=   )rA   headrB   r'   r'   r(   rI   N  s    rI   )sysr-   r^   Zdistutils.corer   Zdistutils.errorsr   Zdistutils.sysconfigr   Z	distutilsr   r:   r   rI   r'   r'   r'   r(   <module>   s   $ :