3
ßL]S  ã               @   sZ   d dl mZmZmZ d dlmZ d dlmZ ddd„ZG dd„ deƒZ	G d	d
„ d
eƒZ
dS )é    )ÚdivisionÚabsolute_importÚprint_function)ÚCommand)ÚlogNc             C   sF   | rd S | d krg } | j dƒ ddlm} dd l}|jj}||ƒ d S )Né   r   )Úshow_fcompilers)ÚappendZnumpy.distutils.fcompilerr   Údistutils.coreÚcoreÚ_setup_distribution)Ú_cacher   Ú	distutilsÚdist© r   úJ/tmp/pip-install-q_7g0qgj/Numpy/numpy/distutils/command/config_compiler.pyÚshow_fortran_compilers   s    
r   c               @   s\   e Zd ZdZdZd!d"d#d$d%d&d'd(d)d*g
ZdddefgZdddgZdd„ Z	dd„ Z
dd „ ZdS )+Ú	config_fcz” Distutils command to hold user specified options
    to Fortran compilers.

    config_fc command is used by the FCompiler.customize() method.
    z2specify Fortran 77/Fortran 90 compiler informationú
fcompiler=Núspecify Fortran compiler typeúf77exec=úspecify F77 compiler commandúf90exec=úspecify F90 compiler commandú	f77flags=úspecify F77 compiler flagsú	f90flags=úspecify F90 compiler flagsúopt=úspecify optimization flagsúarch=ú0specify architecture specific optimization flagsÚdebugÚgú"compile with debugging informationÚnooptúcompile without optimizationÚnoarchú+compile without arch-dependent optimizationzhelp-fcompilerz list available Fortran compilersc             C   s@   d | _ d | _d | _d | _d | _d | _d | _d | _d | _d | _	d S )N)
Ú	fcompilerZf77execZf90execZf77flagsZf90flagsÚoptÚarchr"   r%   r'   )Úselfr   r   r   Úinitialize_options1   s    zconfig_fc.initialize_optionsc             C   sô   t jdƒ | jdƒ}| jdƒ}| jdƒ}| jdƒ}| ||||g}x®d
D ]¦}g }x@|D ]8}t||ƒ}	|	d k	rTt|	tƒsz|	j}	|	|krT|j|	ƒ qTW |sšd }
n|d }
t|ƒdkrÀt j	d	||f ƒ |
rFx&|D ]}t||ƒd krÊt
|||
ƒ qÊW qFW d S )NzTunifing config_fc, config, build_clib, build_ext, build commands --fcompiler optionsÚ
build_clibÚ	build_extÚconfigÚbuildr)   r   r   zJ  commands have different --%s options: %s, using first in list as default)r)   )r   ÚinfoÚget_finalized_commandÚgetattrÚ
isinstanceÚstrÚcompiler_typer	   ÚlenÚwarnÚsetattr)r,   r.   r/   r0   r1   Úcmd_listÚaÚlÚcÚvÚv1r   r   r   Úfinalize_options=   s2    








   
 zconfig_fc.finalize_optionsc             C   s   d S )Nr   )r,   r   r   r   ÚrunT   s    zconfig_fc.run)r   Nr   )r   Nr   )r   Nr   )r   Nr   )r   Nr   )r   Nr   )r    Nr!   )r"   r#   r$   )r%   Nr&   )r'   Nr(   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚdescriptionÚuser_optionsr   Úhelp_optionsÚboolean_optionsr-   rA   rB   r   r   r   r   r      s$   
r   c               @   s2   e Zd ZdZdZdgZdd„ Zdd	„ Zd
d„ ZdS )Ú	config_cczN Distutils command to hold user specified options
    to C/C++ compilers.
    z"specify C/C++ compiler informationú	compiler=Núspecify C/C++ compiler typec             C   s
   d | _ d S )N)Úcompiler)r,   r   r   r   r-   c   s    zconfig_cc.initialize_optionsc             C   sô   t jdƒ | jdƒ}| jdƒ}| jdƒ}| jdƒ}| ||||g}x®d
D ]¦}g }x@|D ]8}t||ƒ}	|	d k	rTt|	tƒsz|	j}	|	|krT|j|	ƒ qTW |sšd }
n|d }
t|ƒdkrÀt j	d	||f ƒ |
rFx&|D ]}t||ƒd krÊt
|||
ƒ qÊW qFW d S )NzSunifing config_cc, config, build_clib, build_ext, build commands --compiler optionsr.   r/   r0   r1   rN   r   r   zJ  commands have different --%s options: %s, using first in list as default)rN   )r   r2   r3   r4   r5   r6   r7   r	   r8   r9   r:   )r,   r.   r/   r0   r1   r;   r<   r=   r>   r?   r@   r   r   r   rA   f   s4    








   
 zconfig_cc.finalize_optionsc             C   s   d S )Nr   )r,   r   r   r   rB   ~   s    zconfig_cc.run)rL   NrM   )	rC   rD   rE   rF   rG   rH   r-   rA   rB   r   r   r   r   rK   X   s   rK   )N)Ú
__future__r   r   r   r
   r   Znumpy.distutilsr   r   r   rK   r   r   r   r   Ú<module>   s
   
D