a0bi3rSrSSKrSSKrSSKJr SSKJr SSKJr SSK J r SS S .r "S S \5r SS jr g)adistutils.command.config Implements the Distutils 'config' command, a (mostly) empty command class that exists mainly to be sub-classed by specific module distributions and applications. The idea is that while every "config" command is different, at least they're all named the same, and users always see "config" in the list of standard commands. Also, this is a good place to put common configure-like tasks: "try to compile this C code", or "figure out where this header file lives". N)Command)DistutilsExecError)customize_compiler)logz.cz.cxx)czc++c\rSrSrSr/SQrSrSrSrSr Sr S r S r S r S rSSjrSSjrSSjrSSjrSSjrSSjrS S S /4SjrSSjrSrg )configzprepare to build) )z compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z include-dirs=Iz.list of directories to search for header files)zdefine=DzC preprocessor macros to define)zundef=Uz!C preprocessor macros to undefine)z libraries=lz!external C libraries to link with)z library-dirs=Lz.directories to search for external C libraries)noisyNz1show every action (compile, link, run, ...) taken)z dump-sourceNz=dump generated source files before attempting to compile themctSUlSUlSUlSUlSUlSUlSUl/Ulg)N)compilercc include_dirs libraries library_dirsr dump_source temp_filesselfs ڝ/builddir/build/BUILDROOT/alt-python313-setuptools-69.0.2-3.el8.x86_64/opt/alt/python313/lib/python3.13/site-packages/setuptools/_distutils/command/config.pyinitialize_optionsconfig.initialize_options-sA    cTURc%URR=(d /UlOM[UR[5(a.URR [ R 5UlURc/UlO1[UR[5(aUR/UlURc/Ulg[UR[5(a/URR [ R 5UlggN) r distribution isinstancestrsplitospathseprrrs rfinalize_optionsconfig.finalize_options<s    $ $ 1 1 > > D"D  ))3 / / $ 1 1 7 7 CD  >> !DN  , ,"nn-DN    $ "D  ))3 / / $ 1 1 7 7 CD 0r cgr"rs rrun config.runLs r cSSKJnJn [URU5(dU"URUR SS9Ul[ UR5 UR(a%URRUR5 UR(a%URRUR5 UR(a&URRUR5 ggg)zNCheck that 'self.compiler' really is a CCompiler object; if not, make it one. r) CCompiler new_compilerr)rdry_runforceN) ccompilerr0r1r$rr2rrset_include_dirsr set_librariesrset_library_dirs)rr0r1s r_check_compilerconfig._check_compilerSs 8$--33( ADM t}} -   ..t/@/@A~~ ++DNN;   ..t/@/@A!4r c,S[U-n[US5nU(a.UHnURSU-5 M URS5 URU5 USS:waURS5 SSS5 U$!,(df  U$=f)N _configtestwz#include <%s>  )LANG_EXTopenwrite)rbodyheaderslangfilenamefileheaders r_gen_temp_sourcefileconfig._gen_temp_sourcefilegs 8D>1 (C D%FJJ069:& 4 JJt Bx4 4 !! s A!B BcURXU5nSnURRXV/5 URR XVUS9 XV4$)Nz _configtest.ir)rHrextendr preprocess)rrBrCrrDsrcouts r _preprocessconfig._preprocessssL''t< z*     Ezr cURXU5nUR(a[USU-5 URR U/5unUR R XV/5 URRU/US9 XV4$)Nzcompiling '%s':rK)rHr dump_filerobject_filenamesrrLcompile)rrBrCrrDrNobjs r_compileconfig._compilezsz''t<    c,s2 3//6 z* se,?zr cURXX65upx[RR[RR U55Sn UR R U/U UUUS9 UR RbXR R-n URRU 5 XxU 4$)Nr)rr target_lang) rWr'pathsplitextbasenamerlink_executable exe_extensionrappend) rrBrCrrrrDrNrVprogs r_link config._links]]4,E ww 0 0 56q9 %% E % &  == & & 2--555D t$$r cU(dURn/Ul[R"SSRU55 UHn[R "U5 M g![ a M,f=f)Nz removing: %s )rrinfojoinr'removeOSError)r filenamesrEs r_clean config._cleans[I DO )!45!H  (#"  sA"" A0/A0NcSSKJn UR5 SnURXX45 UR 5 U$!Ua SnNf=f)a)Construct a source file from 'body' (a string containing lines of C/C++ code) and 'headers' (a list of header files to include) and run it through the preprocessor. Return true if the preprocessor succeeded, false if there were any errors. ('body' probably isn't of much use, but what the heck.) r CompileErrorTF)r4ror8rPrkrrBrCrrDrooks rtry_cppconfig.try_cppsS -      TL ?   B s>A A cxUR5 URX#XE5upg[U[5(a[R "U5n[ U5nSn UR5n U S:XaOURU 5(aSn OM2SSS5 UR5 W $!,(df  N =f)aConstruct a source file (just like 'try_cpp()'), run it through the preprocessor, and return true if any line of the output matches 'pattern'. 'pattern' should either be a compiled regex object or a string containing a regex. If both 'body' and 'headers' are None, preprocesses an empty file -- which can be useful to determine the symbols the preprocessor and compiler set by default. FTN) r8rPr$r%rerUr@readlinesearchrk) rpatternrBrCrrDrNrOrFmatchlines r search_cppconfig.search_cpps ##D<F gs # #jj)G #Y$E}}2:>>$'' E   Ys 6B++ B9cSSKJn UR5 URXX45 Sn[R "U=(a S=(d S5 UR 5 U$!Ua SnNDf=f)zgTry to compile a source file built from 'body' and 'headers'. Return true on success, false otherwise. rrnTFsuccess!failure.)r4ror8rWrrfrkrps r try_compileconfig.try_compilesg -   MM$ <B " 0j1   B sA&&A10A1cSSKJnJn UR5 UR XX4XV5 Sn [ R "U =(a S=(d S5 UR5 U $!Xx4a Sn NEf=f)zTry to compile and link a source file, built from 'body' and 'headers', to executable form. Return true on success, false otherwise. rro LinkErrorTFrr)r4rorr8rbrrfrk) rrBrCrrrrDrorrqs rtry_linkconfig.try_linksl 8   JJtl| RB " 0j1  ( B sA)) A54A5c$SSKJnJn UR5 UR XX4XV5upn UR U /5 Sn [R"U =(a S=(d S5 UR5 U $!Xx[ 4a Sn NJf=f)zTry to compile, link to an executable, and run a program built from 'body' and 'headers'. Return true on success, false otherwise. rrTFrr) r4rorr8rbspawnrrrfrk) rrBrCrrrrDrorrNrVexerqs rtry_runconfig.try_runs 8   JJ| MCc JJu B " 0j1  );< B s*A>>BBcNUR5 /nU(aURSU-5 URS5 U(aURSU-5 OURSU-5 URS5 SRU5S-nURXX4U5$)aDetermine if function 'func' is available by constructing a source file that refers to 'func', and compiles and links it. If everything succeeds, returns true; otherwise returns false. The constructed source file starts out by including the header files listed in 'headers'. If 'decl' is true, it then declares 'func' (as "int func()"); you probably shouldn't supply 'headers' and set 'decl' true in the same call, or you might get errors about a conflicting declarations for 'func'. Finally, the constructed 'main()' function either references 'func' or (if 'call' is true) calls it. 'libraries' and 'library_dirs' are used when linking. z int %s ();z int main () {z %s();z %s;}r=)r8r`rgr) rfuncrCrrrdeclcallrBs r check_funcconfig.check_func#s.   KK t+ , O$  KK D( ) KK$ ' Cyy%}}TL\RRr cTUR5 URSUUU/U-U5$)aDetermine if 'library' is available to be linked against, without actually checking that any particular symbols are provided by it. 'headers' will be used in constructing the source file to be compiled, but the only effect of this is to check if all the header files listed are available. Any libraries listed in 'other_libraries' will be included in the link, in case 'library' has symbols that depend on other libraries. zint main (void) { })r8r)rlibraryrrCrother_librariess r check_libconfig.check_libHs7 }} !   I '    r c&URSU/US9$)zDetermine if the system header file named by 'header_file' exists and can be found by the preprocessor; return true if so, false otherwise. z /* No body */)rBrCr)rr)rrGrrrDs r check_headerconfig.check_headeras# || 6(  r )rrrrrrrr)NNNr)NNr)NNNNr)NNNNrr)__name__ __module__ __qualname____firstlineno__ description user_optionsrr)r-r8rHrPrWrbrkrrr|rrrrrr__static_attributes__r,r rr r s$KL& D  B(  " *&6( : H  #SP  2 r r cUc[R"SU5 O[R"U5 [U5n[R"UR55 UR 5 g!UR 5 f=f)zbDumps a file content into log.info. If head is not None, will be dumped before the file content. Nz%s)rrfr@readclose)rEheadrFs rrSrSksU  | x   >D   s $A33Br")__doc__r'rvcorererrorsr sysconfigrdistutils._logrr?r rSr,r rrs<  '*f %Q WQ h r