î
]á[\%  ã               @   st   d  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 „  Z	 Gd d	 „  d	 e ƒ Z
 d S)
zBdistutils.command.build

Implements the Distutils 'build' command.é    N)ÚCommand)ÚDistutilsOptionError)Úget_platformc              C   s   d d l  m }  |  ƒ  d  S)Nr   )Úshow_compilers)Zdistutils.ccompilerr   )r   © r   ú-/usr/lib/python3.4/distutils/command/build.pyr      s    r   c               @   sù   e  Z d  Z d Z d5 d6 d7 d
 d d d f d8 d9 d d d e ƒ  f d: d; d< d= g Z d d g Z d! d d" e f g Z d# d$ „  Z	 d% d& „  Z
 d' d( „  Z d) d* „  Z d+ d, „  Z d- d. „  Z d/ d0 „  Z d1 e f d2 e f d3 e f d4 e f g Z d S)>Úbuildz"build everything needed to installúbuild-base=Úbú base directory for build libraryúbuild-purelib=Nú2build directory for platform-neutral distributionsúbuild-platlib=ú3build directory for platform-specific distributionsz
build-lib=z9build directory for all distribution (defaults to either zbuild-purelib or build-platlibúbuild-scripts=úbuild directory for scriptsúbuild-temp=Útútemporary build directoryz
plat-name=Úpz6platform name to build for, if supported (default: %s)ú	compiler=Úcúspecify the compiler typeÚdebugÚgú;compile extensions and libraries with debugging informationÚforceÚfú2forcibly build everything (ignore file timestamps)úexecutable=Úeú5specify final destination interpreter path (build.py)zhelp-compilerzlist available compilersc             C   sg   d |  _  d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d |  _	 d  |  _
 d  S)Nr   r   )Ú
build_baseÚbuild_purelibÚbuild_platlibÚ	build_libÚ
build_tempÚbuild_scriptsZcompilerÚ	plat_namer   r   Ú
executable)Úselfr   r   r   Úinitialize_options6   s    										zbuild.initialize_optionsc             C   s¬  |  j  d  k r t ƒ  |  _  n t j d k r< t d ƒ ‚ n  d |  j  t j d d … f } t t d ƒ rx | d 7} n  |  j d  k r¥ t j	 j
 |  j d ƒ |  _ n  |  j d  k rÖ t j	 j
 |  j d | ƒ |  _ n  |  j d  k r|  j j r |  j |  _ q|  j |  _ n  |  j d  k r@t j	 j
 |  j d	 | ƒ |  _ n  |  j d  k r~t j	 j
 |  j d
 t j d d … ƒ |  _ n  |  j d  k r¨t j	 j t j ƒ |  _ n  d  S)NÚntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z.%s-%sr   é   Zgettotalrefcountz-pydebugZlibZtempzscripts-)r(   r   ÚosÚnamer   ÚsysÚversionÚhasattrr#   ÚpathÚjoinr"   r$   r%   ÚdistributionZext_modulesr&   r'   r)   Únormpath)r*   Zplat_specifierr   r   r   Úfinalize_optionsE   s2      zbuild.finalize_optionsc             C   s(   x! |  j  ƒ  D] } |  j | ƒ q Wd  S)N)Zget_sub_commandsZrun_command)r*   Zcmd_namer   r   r   Úrunw   s    z	build.runc             C   s   |  j  j ƒ  S)N)r5   Úhas_pure_modules)r*   r   r   r   r9   ƒ   s    zbuild.has_pure_modulesc             C   s   |  j  j ƒ  S)N)r5   Úhas_c_libraries)r*   r   r   r   r:   †   s    zbuild.has_c_librariesc             C   s   |  j  j ƒ  S)N)r5   Úhas_ext_modules)r*   r   r   r   r;   ‰   s    zbuild.has_ext_modulesc             C   s   |  j  j ƒ  S)N)r5   Úhas_scripts)r*   r   r   r   r<   Œ   s    zbuild.has_scriptsZbuild_pyZ
build_clibZ	build_extr'   )r	   r
   r   )r   Nr   )r   Nr   )r   Nr   )r   r   r   )r   r   r   )zdebugr   r   )zforcer   r   )r   r    r!   )Ú__name__Ú
__module__Ú__qualname__Zdescriptionr   Zuser_optionsZboolean_optionsr   Zhelp_optionsr+   r7   r8   r9   r:   r;   r<   Zsub_commandsr   r   r   r   r      sN        
    	2			r   )Ú__doc__r0   r.   Zdistutils.corer   Zdistutils.errorsr   Zdistutils.utilr   r   r   r   r   r   r   Ú<module>   s   