\dV`dZddlZddlmZddlTddlmZddlmZdZ Gdd eZ dS) zdistutils.command.build_clib Implements the Distutils 'build_clib' command, to build a C/C++ library that is included in the module distribution and needed by an extension module.N)Command)*)customize_compiler)logc&ddlm}|dS)Nrshow_compilers)distutils.ccompilerr rs -..\python\lib\distutils\command\build_clib.pyr r s(222222NcZeZdZdZgdZddgZdddefgZdZd Z d Z d Z d Z d Z dZdS) build_clibz/build C/C++ libraries used by Python extensions))z build-clib=bz%directory to build C/C++ libraries to)z build-temp=tz,directory to put temporary build by-products)debuggz"compile with debugging information)forcefz2forcibly build everything (ignore file timestamps))z compiler=czspecify the compiler typerrz help-compilerNzlist available compilerscd|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr) r build_temp libraries include_dirsdefineundefrrcompilerselfs r initialize_optionszbuild_clib.initialize_options4sJ!     r c\|dddddd|jj|_|jr||j|j|jjpg|_t |jt r+|jtj |_dSdS)Nbuild)rr)rr)rr)rr)rr) set_undefined_options distributionrcheck_library_listr isinstancestrsplitospathseprs r finalize_optionszbuild_clib.finalize_optionsDs ""7#?#?#;#5#5  7 7 7*4 > 4  # #DN 3 3 3   $ $ 1 > D"D  d' - - D $ 1 7 7 C CD    D Dr c|jsdSddlm}||j|j|j|_t |j|j|j|j|j (|j D] \}}|j ||!|j $|j D]}|j || |jdS)Nr) new_compiler)rdry_runr)rr r,rr-rrrset_include_dirsr define_macrorundefine_macrobuild_libraries)rr,namevaluemacros r runzbuild_clib.run^s~  F 544444$ dm-1\+/:777  4=)))   ( M * *4+< = = = ; " $  8 8 e **47777 : ! 4 4 ,,U3333 T^,,,,,r ct|tstd|D]}t|ts"t |dkrtd|\}}t|t stdd|vst jdkr&t j|vrtd|dzt|tstdd S) a`Ensure that the list of libraries is valid. `library` is presumably provided as a command option 'libraries'. This method checks that it is a list of 2-tuples, where the tuples are (library_name, build_info_dict). Raise DistutilsSetupError if the structure is invalid anywhere; just returns otherwise. z+'libraries' option must be a list of tuplesz*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)/z;bad library name '%s': may not contain directory separatorsrzMsecond element of each tuple in 'libraries' must be a dictionary (build info)N) r%listDistutilsSetupErrortuplelenr&r(sepdict)rrlibr2 build_infos r r$zbuild_clib.check_library_listvs.)T** A%?AA A ; ;Cc5)) Dc#hh!mm)BDDD # D*dC(( =)<===d{{rv}}4)+>@CA+GHHHj$// ;):;;; ;! ; ;r c`|jsdSg}|jD]\}}|||S)N)rappend)r lib_nameslib_namer@s r get_library_nameszbuild_clib.get_library_namessK~ 4 &*n ' ' "Xz   X & & & &r c ||jg}|jD]_\}}|d}|t|tt fst d|z||`|S)Nsourcesfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)r$rgetr%r9r;r:extend)r filenamesrDr@rGs r get_source_fileszbuild_clib.get_source_filess /// &*n & & "Xz nnY//Gj4-&H&H)46>?@@@   W % % % %r c|D]\}}|d}|t|ttfst d|zt|}t jd||d}|d}|j||j |||j }|j |||j |j dS)NrGrHzbuilding '%s' librarymacrosr) output_dirrNrr)rOr) rIr%r9r;r:rinforcompilerrcreate_static_libr)rrrDr@rGrNrobjectss r r1zbuild_clib.build_librariess&/ > > "Xz nnY//Gj4-&H&H)46>?@@@7mmG H,h 7 7 7  ^^H--F%>>.99Lm++G7;399E26* ,>>G M + +GX7;26* , > > > >3 > >r )__name__ __module__ __qualname__ description user_optionsboolean_optionsr help_optionsrr*r5r$rErLr1r r rrsCK    L(O $ #^ 5 L    DDD4---0!;!;!;H      >>>>>r r) __doc__r(distutils.corerdistutils.errorsdistutils.sysconfigr distutilsrr rr[r r ras   """"""222222 u>u>u>u>u>u>u>u>u>u>r