
(h                 @   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)distutils.ccompilerr   )r    r   I/tmp/pip-build-kmztzv_d/setuptools/setuptools/_distutils/command/build.pyr      s    r   c               @   s   e  Z d  Z d Z d8 d9 d: d
 d d d f d; d< d d d e   f d= d> d? d@ dA 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 d0 d1   Z d2 d3   Z d4 e f d5 e f d6 e f d7 e f g Z d S)Bbuildz"build everything needed to installbuild-base=b base directory for build librarybuild-purelib=N2build 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	parallel=jnumber of parallel build jobsdebugg;compile extensions and libraries with debugging informationforcef2forcibly build everything (ignore file timestamps)executable=e5specify final destination interpreter path (build.py)zhelp-compilerzlist available compilersc             C   sp   d |  _  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_scriptscompiler	plat_namer   r    
executableparallel)selfr   r   r   initialize_options8   s    											zbuild.initialize_optionsc             C   s  |  j  d  k r t   |  _  n t j d k r9 t d   d |  j  f t j d  d   } t t d  ru | d 7} |  j d  k r t j	 j
 |  j d  |  _ |  j d  k r t j	 j
 |  j d |  |  _ |  j d  k r|  j j r |  j |  _ n |  j |  _ |  j d  k r1t j	 j
 |  j d |  |  _ |  j d  k rlt j	 j
 |  j d	 t j d  d   |  _ |  j d  k rt j rt j	 j t j  |  _ t |  j t  ry t |  j  |  _ Wn t k
 rt d
   Yn Xd  S)NntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z	.%s-%d.%d   gettotalrefcountz-pydebuglibtempzscripts-%d.%dzparallel should be an integer)r-   r   osnamer   sysversion_infohasattrr'   pathjoinr&   r(   r)   distributionext_modulesr*   r+   r.   normpath
isinstancer/   strint
ValueError)r0   plat_specifierr   r   r   finalize_optionsH   s<    	#
zbuild.finalize_optionsc             C   s(   x! |  j    D] } |  j |  q Wd  S)N)get_sub_commandsrun_command)r0   cmd_namer   r   r   run   s    z	build.runc             C   s   |  j  j   S)N)r>   has_pure_modules)r0   r   r   r   rK      s    zbuild.has_pure_modulesc             C   s   |  j  j   S)N)r>   has_c_libraries)r0   r   r   r   rL      s    zbuild.has_c_librariesc             C   s   |  j  j   S)N)r>   has_ext_modules)r0   r   r   r   rM      s    zbuild.has_ext_modulesc             C   s   |  j  j   S)N)r>   has_scripts)r0   r   r   r   rN      s    zbuild.has_scriptsbuild_py
build_clib	build_extr+   )r
   r   r   )r   Nr   )r   Nr   )r   Nr   )r   r   r   )r   r   r   )r   r   r   )zdebugr   r   )zforcer!   r"   )r#   r$   r%   )__name__
__module____qualname__descriptionr   user_optionsboolean_optionsr   help_optionsr1   rF   rJ   rK   rL   rM   rN   sub_commandsr   r   r   r   r	      sR        
     	8			r	   )__doc__r9   r7   distutils.corer   Zdistutils.errorsr   distutils.utilr   r   r	   r   r   r   r   <module>   s   