\bgddZddlZddlmZddlmZddlmZddlm Z dZ Gd d 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)log)Command)DistutilsSetupError)customize_compilerc&ddlm}|dS)Nrshow_compilers) ccompilerr r s y/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/setuptools/_distutils/command/build_clib.pyr r s(******NcZeZdZdZgdZddgZdddefgZdZd 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)NF) r build_temp libraries include_dirsdefineundefrrcompilerselfs r initialize_optionszbuild_clib.initialize_options0sJ!     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_options?s ""  ( ( $      *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.runZs~  F -,,,,,$ ]DL      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|ddt|tstd d 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 tuplesrz*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)/zbad library name 'rz'': may not contain directory separatorszMsecond element of each tuple in 'libraries' must be a dictionary (build info)N) r&listrtuplelenr'r)sepdict)rrlibr3 build_infos r r%zbuild_clib.check_library_listrs)T** U%&STT T  Cc5)) Xc#hh!mm)*VWWW" D*dC(( ): d{{rv}}4);Q;;; j$// )8 %  r c`|jsdSg}|jD]\}}|||S)N)rappend)r lib_nameslib_name _build_infos r get_library_nameszbuild_clib.get_library_namessK~ 4 %)^ ' ' !Hk   X & & & &r c||jg}|jD]`\}}|d}|t|tt fst d|d||a|S)Nsources in 'libraries' option (library 'D'), 'sources' must be present and must be a list of source filenames)r%rgetr&r9r:rextend)r filenamesrCr?rGs r get_source_fileszbuild_clib.get_source_filess /// $(N & & Hj nnY//Gj4-&H&H)1x111   W % % % %r c|D]\}}|d}|t|ttfst d|dt|}t jd||d}|d}|j||j |||j }|j |||j |j dS) NrGrHrIzbuilding '%s' librarymacrosr) output_dirrOrr)rPr) rJr&r9r:rrinforcompilerrcreate_static_libr)rrrCr?rGrOrobjectss r r2zbuild_clib.build_librariess$-   Hj nnY//Gj4-&H&H)1x111 7mmG H,h 7 7 7  ^^H--F%>>.99Lm++?)j ,G M + +doTZ ,    9  r )__name__ __module__ __qualname__ description user_optionsboolean_optionsr help_optionsr r+r6r%rErMr2r r rrsCKL(O $ :NKL   DDD6---0###J      r r) __doc__r)distutils._logrcorererrorsr sysconfigrr rr\r r rbs   ((((((****** qqqqqqqqqqr