Yfc@stdZddlZddlZddlmZddlmZddlmZddZ Gdd d eZ dS) zBdistutils.command.build Implements the Distutils 'build' command.N)Command)DistutilsOptionError) get_platformcCsddlm}|dS)Nr)show_compilers)Zdistutils.ccompilerr)rrd?d@dAg ZddgZd$dd%efgZd&d'Z d(d)Z d*d+Z d,d-Z d.d/Z d0d1Zd2d3Zd4e fd5e fd6efd7efgZdS)Bbuildz"build everything needed to install build-base=b base directory for build librarybuild-purelib=N2build directory for platform-neutral distributionsbuild-platlib=3build directory for platform-specific distributionsz build-lib=z9build directory for all distribution (defaults to either zbuild-purelib or build-platlibbuild-scripts=build directory for scripts build-temp=ttemporary build directoryz plat-name=pz6platform name to build for, if supported (default: %s) compiler=cspecify the compiler type parallel=jnumber of parallel build jobsdebugg;compile extensions and libraries with debugging informationforcef2forcibly build everything (ignore file timestamps) executable=e5specify final destination interpreter path (build.py)z help-compilerzlist available compilerscCspd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ dS)Nrr) build_base build_purelib build_platlib build_lib build_temp build_scriptsZcompiler plat_namerr executableparallel)selfrrrinitialize_options8s           zbuild.initialize_optionsc Cs|jdkrt|_ntjdkr9tdd|jtjddf}ttdrr|d7}|jdkrtj j |j d|_|j dkrtj j |j d||_ |j dkr|jjr|j |_ n |j|_ |jdkr.tj j |j d ||_|jdkritj j |j d tjdd|_|jdkrtj jtj|_t|jtryt|j|_Wntk rtd YnXdS) NntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z.%s-%srgettotalrefcountz-pydebuglibZtempzscripts-zparallel should be an integer)r+rosnamersysversionhasattrr&pathjoinr%r'r( distributionZ ext_modulesr)r*r,normpath isinstancer-strint ValueError)r.Zplat_specifierrrrfinalize_optionsHs<      zbuild.finalize_optionscCs(x!|jD]}|j|q WdS)N)Zget_sub_commandsZ run_command)r.Zcmd_namerrrrunsz build.runcCs |jjS)N)r;has_pure_modules)r.rrrrCszbuild.has_pure_modulescCs |jjS)N)r;has_c_libraries)r.rrrrDszbuild.has_c_librariescCs |jjS)N)r;has_ext_modules)r.rrrrEszbuild.has_ext_modulescCs |jjS)N)r; has_scripts)r.rrrrFszbuild.has_scriptsZbuild_pyZ build_clibZ build_extr*)r r r )r Nr )rNr)rNr)rrr)rrr)rrr)rrr)rr r!)r"r#r$)__name__ __module__ __qualname__Z descriptionrZ user_optionsZboolean_optionsrZ help_optionsr/rArBrCrDrErFZ sub_commandsrrrrrsR      8       r) __doc__r6r4Zdistutils.corerZdistutils.errorsrZdistutils.utilrrrrrrrs