/usr/lib64/python3.9/distutils/__pycache__
NameSizeModeActions
archive_util.cpython-39.opt-1.pyc65870644editdlrm
archive_util.cpython-39.opt-2.pyc45450644editdlrm
archive_util.cpython-39.pyc65870644editdlrm
bcppcompiler.cpython-39.opt-1.pyc64980644editdlrm
bcppcompiler.cpython-39.opt-2.pyc62100644editdlrm
bcppcompiler.cpython-39.pyc64980644editdlrm
ccompiler.cpython-39.opt-1.pyc330970644editdlrm
ccompiler.cpython-39.opt-2.pyc167900644editdlrm
ccompiler.cpython-39.pyc331880644editdlrm
cmd.cpython-39.opt-1.pyc139260644editdlrm
cmd.cpython-39.opt-2.pyc80600644editdlrm
cmd.cpython-39.pyc139260644editdlrm
config.cpython-39.opt-1.pyc35290644editdlrm
config.cpython-39.opt-2.pyc31380644editdlrm
config.cpython-39.pyc35290644editdlrm
core.cpython-39.opt-1.pyc66540644editdlrm
core.cpython-39.opt-2.pyc32670644editdlrm
core.cpython-39.pyc66540644editdlrm
cygwinccompiler.cpython-39.opt-1.pyc85030644editdlrm
cygwinccompiler.cpython-39.opt-2.pyc68730644editdlrm
cygwinccompiler.cpython-39.pyc85030644editdlrm
debug.cpython-39.opt-1.pyc1960644editdlrm
debug.cpython-39.opt-2.pyc1960644editdlrm
debug.cpython-39.pyc1960644editdlrm
dep_util.cpython-39.opt-1.pyc27160644editdlrm
dep_util.cpython-39.opt-2.pyc12720644editdlrm
dep_util.cpython-39.pyc27160644editdlrm
dir_util.cpython-39.opt-1.pyc58170644editdlrm
dir_util.cpython-39.opt-2.pyc34390644editdlrm
dir_util.cpython-39.pyc58170644editdlrm
dist.cpython-39.opt-1.pyc343480644editdlrm
dist.cpython-39.opt-2.pyc250570644editdlrm
dist.cpython-39.pyc343480644editdlrm
errors.cpython-39.opt-1.pyc52520644editdlrm
errors.cpython-39.opt-2.pyc27040644editdlrm
errors.cpython-39.pyc52520644editdlrm
extension.cpython-39.opt-1.pyc69170644editdlrm
extension.cpython-39.opt-2.pyc34270644editdlrm
extension.cpython-39.pyc69170644editdlrm
fancy_getopt.cpython-39.opt-1.pyc105020644editdlrm
fancy_getopt.cpython-39.opt-2.pyc76990644editdlrm
fancy_getopt.cpython-39.pyc106250644editdlrm
filelist.cpython-39.opt-1.pyc97610644editdlrm
filelist.cpython-39.opt-2.pyc68900644editdlrm
filelist.cpython-39.pyc98350644editdlrm
file_util.cpython-39.opt-1.pyc59830644editdlrm
file_util.cpython-39.opt-2.pyc38460644editdlrm
file_util.cpython-39.pyc59830644editdlrm
log.cpython-39.opt-1.pyc23150644editdlrm
log.cpython-39.opt-2.pyc22540644editdlrm
log.cpython-39.pyc23150644editdlrm
msvc9compiler.cpython-39.opt-1.pyc174690644editdlrm
msvc9compiler.cpython-39.opt-2.pyc158480644editdlrm
msvc9compiler.cpython-39.pyc175120644editdlrm
msvccompiler.cpython-39.opt-1.pyc147070644editdlrm
msvccompiler.cpython-39.opt-2.pyc131340644editdlrm
msvccompiler.cpython-39.pyc147070644editdlrm
spawn.cpython-39.opt-1.pyc34410644editdlrm
spawn.cpython-39.opt-2.pyc23080644editdlrm
spawn.cpython-39.pyc34410644editdlrm
sysconfig.cpython-39.opt-1.pyc120640644editdlrm
sysconfig.cpython-39.opt-2.pyc85770644editdlrm
sysconfig.cpython-39.pyc120640644editdlrm
text_file.cpython-39.opt-1.pyc84410644editdlrm
text_file.cpython-39.opt-2.pyc33430644editdlrm
text_file.cpython-39.pyc84410644editdlrm
unixccompiler.cpython-39.opt-1.pyc71320644editdlrm
unixccompiler.cpython-39.opt-2.pyc65030644editdlrm
unixccompiler.cpython-39.pyc71320644editdlrm
util.cpython-39.opt-1.pyc155900644editdlrm
util.cpython-39.opt-2.pyc97060644editdlrm
util.cpython-39.pyc155900644editdlrm
version.cpython-39.opt-1.pyc73120644editdlrm
version.cpython-39.opt-2.pyc40270644editdlrm
version.cpython-39.pyc73410644editdlrm
versionpredicate.cpython-39.opt-1.pyc51250644editdlrm
versionpredicate.cpython-39.opt-2.pyc26450644editdlrm
versionpredicate.cpython-39.pyc51250644editdlrm
_msvccompiler.cpython-39.opt-1.pyc127840644editdlrm
_msvccompiler.cpython-39.opt-2.pyc116350644editdlrm
_msvccompiler.cpython-39.pyc128270644editdlrm
__init__.cpython-39.opt-1.pyc3860644editdlrm
__init__.cpython-39.opt-2.pyc2040644editdlrm
__init__.cpython-39.pyc3860644editdlrm
Edit: /usr/lib64/python3.9/distutils/__pycache__/ccompiler.cpython-39.pyc (33188B)
a ´i:¹ã@sÂdZddlZddlZddlZddlTddlmZddlmZddl m Z ddl m Z ddl mZmZdd lmZGd d „d ƒZd Zdd d„ZddddddœZdd„Zddd„Zdd„Zdd„ZdS)zˆdistutils.ccompiler Contains CCompiler, an abstract base class that defines the interface for the Distutils compiler abstraction model.éN)Ú*)Úspawn)Ú move_file)Úmkpath)Ú newer_group)Ú split_quotedÚexecute)Úlogc @seZdZdZdZdZdZdZdZdZ dZ dZ ddddddœZ gd¢Z drd d „Zd d „Zd d„Zdd„Zdd„Zdsdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd „Zd!d"„Zd#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Z d/d0„Z!dtd1d2„Z"d3d4„Z#d5d6„Z$d7d8„Z%d9d:„Z&dud;d<„Z'dvd=d>„Z(d?d@„Z)dwdAdB„Z*dCZ+dDZ,dEZ-dxdFdG„Z.dydHdI„Z/dzdJdK„Z0d{dLdM„Z1dNdO„Z2dPdQ„Z3dRdS„Z4d|dTdU„Z5d}dVdW„Z6d~dYdZ„Z7dd[d\„Z8d€d]d^„Z9d�d`da„Z:d‚dcdd„Z;dedf„Zdkdl„Z?dmdn„Z@d„dpdq„ZAdS)…Ú CCompileraŸAbstract base class to define the interface that must be implemented by real compiler classes. Also has some utility methods used by several compiler classes. The basic idea behind a compiler abstraction class is that each instance can be used for all the compile/link steps in building a single project. Thus, attributes common to all of those compile and link steps -- include directories, macros to define, libraries to link against, etc. -- are attributes of the compiler instance. To allow for variability in how individual files are treated, most of those attributes may be varied on a per-compilation or per-link basis. NÚcúc++Úobjc)ú.cz.ccz.cppz.cxxz.m)r r r rcCsb||_||_||_d|_g|_g|_g|_g|_g|_g|_ |j   ¡D]}|  ||j |¡qFdS©N) Údry_runÚforceÚverboseÚ output_dirÚmacrosÚ include_dirsÚ librariesÚ library_dirsÚruntime_library_dirsÚobjectsÚ executablesÚkeysÚset_executable)ÚselfrrrÚkey©rú+/usr/lib64/python3.9/distutils/ccompiler.pyÚ__init__UszCCompiler.__init__cKs<|D]2}||jvr&td||jjfƒ‚| |||¡qdS)a‹Define the executables (and options for them) that will be run to perform the various stages of compilation. The exact set of executables that may be specified here depends on the compiler class (via the 'executables' class attribute), but most will have: compiler the C/C++ compiler linker_so linker used to create shared objects and libraries linker_exe linker used to create binary executables archiver static library creator On platforms with a command-line (Unix, DOS/Windows), each of these is a string that will be split into executable name and (optional) list of arguments. (Splitting the string is done similarly to how Unix shells operate: words are delimited by spaces, but quotes and backslashes can override this. See 'distutils.util.split_quoted()'.) z$unknown executable '%s' for class %sN)rÚ ValueErrorÚ __class__Ú__name__r)rÚkwargsrrrr Úset_executablesys   ÿzCCompiler.set_executablescCs,t|tƒrt||t|ƒƒn t|||ƒdSr)Ú isinstanceÚstrÚsetattrr)rrÚvaluerrr r™s zCCompiler.set_executablecCs0d}|jD] }|d|kr"|S|d7}q dS)Nré)r)rÚnameÚiÚdefnrrr Ú _find_macroŸs    zCCompiler._find_macrocCs`|D]V}t|tƒrFt|ƒdvrFt|dtƒs8|ddurFt|dtƒstd|ddƒ‚qdS)z×Ensures that every element of 'definitions' is a valid macro definition, ie. either (name,value) 2-tuple or a (name,) tuple. Do nothing if all definitions are OK, raise TypeError otherwise. )r+ér+Nrzinvalid macro definition '%s': z.must be tuple (string,), (string, string), or z(string, None))r'ÚtupleÚlenr(Ú TypeError)rZ definitionsr.rrr Ú_check_macro_definitions§s  ÿ þ þ ýÿþz"CCompiler._check_macro_definitionscCs.| |¡}|dur|j|=|j ||f¡dS)a_Define a preprocessor macro for all compilations driven by this compiler object. The optional parameter 'value' should be a string; if it is not supplied, then the macro will be defined without an explicit value and the exact outcome depends on the compiler used (XXX true? does ANSI say anything about this?) N©r/rÚappend)rr,r*r-rrr Ú define_macro¸s zCCompiler.define_macrocCs0| |¡}|dur|j|=|f}|j |¡dS)a³Undefine a preprocessor macro for all compilations driven by this compiler object. If the same macro is defined by 'define_macro()' and undefined by 'undefine_macro()' the last call takes precedence (including multiple redefinitions or undefinitions). If the macro is redefined/undefined on a per-compilation basis (ie. in the call to 'compile()'), then that takes precedence. Nr5)rr,r-Zundefnrrr Úundefine_macroÇs zCCompiler.undefine_macrocCs|j |¡dS)zóAdd 'dir' to the list of directories that will be searched for header files. The compiler is instructed to search directories in the order in which they are supplied by successive calls to 'add_include_dir()'. N)rr6©rÚdirrrr Úadd_include_dirÙszCCompiler.add_include_dircCs|dd…|_dS)aySet the list of directories that will be searched to 'dirs' (a list of strings). Overrides any preceding calls to 'add_include_dir()'; subsequence calls to 'add_include_dir()' add to the list passed to 'set_include_dirs()'. This does not affect any list of standard include directories that the compiler may search by default. N©r©rÚdirsrrr Úset_include_dirsászCCompiler.set_include_dirscCs|j |¡dS)a¿Add 'libname' to the list of libraries that will be included in all links driven by this compiler object. Note that 'libname' should *not* be the name of a file containing a library, but the name of the library itself: the actual filename will be inferred by the linker, the compiler, or the compiler class (depending on the platform). The linker will be instructed to link against libraries in the order they were supplied to 'add_library()' and/or 'set_libraries()'. It is perfectly valid to duplicate library names; the linker will be instructed to link against libraries as many times as they are mentioned. N)rr6)rÚlibnamerrr Ú add_libraryëszCCompiler.add_librarycCs|dd…|_dS)zôSet the list of libraries to be included in all links driven by this compiler object to 'libnames' (a list of strings). This does not affect any standard system libraries that the linker may include by default. N)r)rZlibnamesrrr Ú set_librariesûszCCompiler.set_librariescCs|j |¡dS)a'Add 'dir' to the list of directories that will be searched for libraries specified to 'add_library()' and 'set_libraries()'. The linker will be instructed to search for libraries in the order they are supplied to 'add_library_dir()' and/or 'set_library_dirs()'. N)rr6r9rrr Úadd_library_dirszCCompiler.add_library_dircCs|dd…|_dS)zÀSet the list of library search directories to 'dirs' (a list of strings). This does not affect any standard library search path that the linker may search by default. N)rr=rrr Úset_library_dirs szCCompiler.set_library_dirscCs|j |¡dS)zlAdd 'dir' to the list of directories that will be searched for shared libraries at runtime. N)rr6r9rrr Úadd_runtime_library_dirsz!CCompiler.add_runtime_library_dircCs|dd…|_dS)zãSet the list of directories to search for shared libraries at runtime to 'dirs' (a list of strings). This does not affect any standard search path that the runtime linker may search by default. N)rr=rrr Úset_runtime_library_dirssz"CCompiler.set_runtime_library_dirscCs|j |¡dS)zãAdd 'object' to the list of object files (or analogues, such as explicitly named library files or the output of "resource compilers") to be included in every link driven by this compiler object. N)rr6)rÚobjectrrr Úadd_link_object szCCompiler.add_link_objectcCs|dd…|_dS)zêSet the list of object files (or analogues) to be included in every link to 'objects'. This does not affect any standard object files that the linker may include by default (such as system libraries). N)r)rrrrr Úset_link_objects(szCCompiler.set_link_objectscCs*|dur|j}nt|tƒs"tdƒ‚|dur2|j}n"t|tƒrL||jpFg}ntdƒ‚|durd|j}n*t|ttfƒr†t|ƒ|jp€g}ntdƒ‚|duršg}|j|d|d�}t |ƒt |ƒks¾J‚t ||ƒ}i} t t |ƒƒD]B} || } || } t j  | ¡d} | t j  | ¡¡| | f| | <qØ||||| fS)z;Process arguments and decide which source files to compile.Nú%'output_dir' must be a string or Noneú/'macros' (if supplied) must be a list of tuplesú6'include_dirs' (if supplied) must be a list of stringsr)Ú strip_dirrr+)rr'r(r3rÚlistrr1Úobject_filenamesr2Úgen_preprocess_optionsÚrangeÚosÚpathÚsplitextrÚdirname)rZoutdirrZincdirsÚsourcesÚdependsÚextrarÚpp_optsÚbuildr-ÚsrcÚobjÚextrrr Ú_setup_compile6s>  ÿÿ zCCompiler._setup_compilecCs0|dg}|rdg|dd…<|r,||dd…<|S)Nz-cz-grr)rrYÚdebugÚbeforeÚcc_argsrrr Ú _get_cc_argsas   zCCompiler._get_cc_argscCs˜|dur|j}nt|tƒs"tdƒ‚|dur2|j}n"t|tƒrL||jpFg}ntdƒ‚|durd|j}n*t|ttfƒr†t|ƒ|jp€g}ntdƒ‚|||fS)a'Typecheck and fix-up some of the arguments to the 'compile()' method, and return fixed-up values. Specifically: if 'output_dir' is None, replaces it with 'self.output_dir'; ensures that 'macros' is a list, and augments it with 'self.macros'; ensures that 'include_dirs' is a list, and augments it with 'self.include_dirs'. Guarantees that the returned values are of the correct type, i.e. for 'output_dir' either string or None, and for 'macros' and 'include_dirs' either list or None. NrJrKrL)rr'r(r3rrNrr1)rrrrrrr Ú_fix_compile_argsjs"   ÿzCCompiler._fix_compile_argscCs*|j||d�}t|ƒt|ƒks"J‚|ifS)a,Decide which source files must be recompiled. Determine the list of object files corresponding to 'sources', and figure out which ones really need to be recompiled. Return a list of all object files and a dictionary telling which source files can be skipped. )r)rOr2)rrVrrWrrrr Ú _prep_compileŠs zCCompiler._prep_compilecCsHt|ttfƒstdƒ‚t|ƒ}|dur.|j}nt|tƒs@tdƒ‚||fS)zûTypecheck and fix up some arguments supplied to various methods. Specifically: ensure that 'objects' is a list; if output_dir is None, replace with self.output_dir. Return fixed versions of 'objects' and 'output_dir'. z,'objects' must be a list or tuple of stringsNrJ)r'rNr1r3rr()rrrrrr Ú_fix_object_argsšs zCCompiler._fix_object_argscCs¸|dur|j}n*t|ttfƒr2t|ƒ|jp,g}ntdƒ‚|durJ|j}n*t|ttfƒrlt|ƒ|jpfg}ntdƒ‚|dur„|j}n*t|ttfƒr¦t|ƒ|jp g}ntdƒ‚|||fS)a;Typecheck and fix up some of the arguments supplied to the 'link_*' methods. Specifically: ensure that all arguments are lists, and augment them with their permanent versions (eg. 'self.libraries' augments 'libraries'). Return a tuple with fixed versions of all arguments. Nz3'libraries' (if supplied) must be a list of stringsz6'library_dirs' (if supplied) must be a list of stringsz>'runtime_library_dirs' (if supplied) must be a list of strings)rr'rNr1r3rr)rrrrrrr Ú _fix_lib_args«s,ÿÿÿzCCompiler._fix_lib_argscCs2|jr dS|jr t||dd�}n t||ƒ}|SdS)zjReturn true if we need to relink the files listed in 'objects' to recreate 'output_file'. TÚnewer)ÚmissingN)rrr)rrÚ output_filergrrr Ú _need_linkÍs  zCCompiler._need_linkc Cs|t|tƒs|g}d}t|jƒ}|D]T}tj |¡\}}|j |¡}z |j  |¡}||kr`|}|}Wq"t ytYq"0q"|S)z|Detect the language of a given file, or list of files. Uses language_map, and language_order to do the job. N) r'rNr2Úlanguage_orderrRrSrTÚ language_mapÚgetÚindexr") rrVÚlangrnÚsourceÚbaser]ZextlangZextindexrrr Údetect_languageÚs     zCCompiler.detect_languagecCsdS)aÕPreprocess a single C/C++ source file, named in 'source'. Output will be written to file named 'output_file', or stdout if 'output_file' not supplied. 'macros' is a list of macro definitions as for 'compile()', which will augment the macros set with 'define_macro()' and 'undefine_macro()'. 'include_dirs' is a list of directory names that will be added to the default list. Raises PreprocessError on failure. Nr)rrprirrÚ extra_preargsÚextra_postargsrrr Ú preprocessòs zCCompiler.preprocessc  Csv| ||||||¡\}} }} } | | ||¡} | D]@} z| | \}}WntyZYq0Yn0| | ||| || ¡q0| S)aK Compile one or more source files. 'sources' must be a list of filenames, most likely C/C++ files, but in reality anything that can be handled by a particular compiler and compiler class (eg. MSVCCompiler can handle resource files in 'sources'). Return a list of object filenames, one per source filename in 'sources'. Depending on the implementation, not all source files will necessarily be compiled, but all corresponding object filenames will be returned. If 'output_dir' is given, object files will be put under it, while retaining their original path component. That is, "foo/bar.c" normally compiles to "foo/bar.o" (for a Unix implementation); if 'output_dir' is "build", then it would compile to "build/foo/bar.o". 'macros', if given, must be a list of macro definitions. A macro definition is either a (name, value) 2-tuple or a (name,) 1-tuple. The former defines a macro; if the value is None, the macro is defined without an explicit value. The 1-tuple case undefines a macro. Later definitions/redefinitions/ undefinitions take precedence. 'include_dirs', if given, must be a list of strings, the directories to add to the default include file search path for this compilation only. 'debug' is a boolean; if true, the compiler will be instructed to output debug symbols in (or alongside) the object file(s). 'extra_preargs' and 'extra_postargs' are implementation- dependent. On platforms that have the notion of a command-line (e.g. Unix, DOS/Windows), they are most likely lists of strings: extra command-line arguments to prepend/append to the compiler command line. On other platforms, consult the implementation class documentation. In any event, they are intended as an escape hatch for those occasions when the abstract compiler framework doesn't cut the mustard. 'depends', if given, is a list of filenames that all targets depend on. If a source file is older than any file in depends, then the source file will be recompiled. This supports dependency tracking, but only at a coarse granularity. Raises CompileError on failure. )r^rbÚKeyErrorÚ_compile)rrVrrrr_rsrtrWrrYrZrar\r[r]rrr Úcompileÿs6 ÿÿ   zCCompiler.compilecCsdS)zCompile 'src' to product 'obj'.Nr)rr\r[r]rartrYrrr rwCszCCompiler._compilecCsdS)a&Link a bunch of stuff together to create a static library file. The "bunch of stuff" consists of the list of object files supplied as 'objects', the extra object files supplied to 'add_link_object()' and/or 'set_link_objects()', the libraries supplied to 'add_library()' and/or 'set_libraries()', and the libraries supplied as 'libraries' (if any). 'output_libname' should be a library name, not a filename; the filename will be inferred from the library name. 'output_dir' is the directory where the library file will be put. 'debug' is a boolean; if true, debugging information will be included in the library (note that on most platforms, it is the compile step where this matters: the 'debug' flag is included here just for consistency). 'target_lang' is the target language for which the given objects are being compiled. This allows specific linkage time treatment of certain languages. Raises LibError on failure. Nr)rrÚoutput_libnamerr_Ú target_langrrr Úcreate_static_libIszCCompiler.create_static_libZ shared_objectZshared_libraryÚ executablecCst‚dS)auLink a bunch of stuff together to create an executable or shared library file. The "bunch of stuff" consists of the list of object files supplied as 'objects'. 'output_filename' should be a filename. If 'output_dir' is supplied, 'output_filename' is relative to it (i.e. 'output_filename' can provide directory components if needed). 'libraries' is a list of libraries to link against. These are library names, not filenames, since they're translated into filenames in a platform-specific way (eg. "foo" becomes "libfoo.a" on Unix and "foo.lib" on DOS/Windows). However, they can include a directory component, which means the linker will look in that specific directory rather than searching all the normal locations. 'library_dirs', if supplied, should be a list of directories to search for libraries that were specified as bare library names (ie. no directory component). These are on top of the system default and those supplied to 'add_library_dir()' and/or 'set_library_dirs()'. 'runtime_library_dirs' is a list of directories that will be embedded into the shared library and used to search for other shared libraries that *it* depends on at run-time. (This may only be relevant on Unix.) 'export_symbols' is a list of symbols that the shared library will export. (This appears to be relevant only on Windows.) 'debug' is as for 'compile()' and 'create_static_lib()', with the slight distinction that it actually matters on most platforms (as opposed to 'create_static_lib()', which includes a 'debug' flag mostly for form's sake). 'extra_preargs' and 'extra_postargs' are as for 'compile()' (except of course that they supply command-line arguments for the particular linker being used). 'target_lang' is the target language for which the given objects are being compiled. This allows specific linkage time treatment of certain languages. Raises LinkError on failure. N©ÚNotImplementedError)rZ target_descrÚoutput_filenamerrrrÚexport_symbolsr_rsrtÚ build_temprzrrr Úlinkis9zCCompiler.linkc Cs2| tj||j|dd�||||||| | | | ¡ dS)NÚshared)Úlib_type)r‚r ÚSHARED_LIBRARYÚlibrary_filename) rrryrrrrr€r_rsrtr�rzrrr Úlink_shared_lib§s  ûzCCompiler.link_shared_libc Cs(| tj||||||||| | | | ¡ dSr)r‚r Ú SHARED_OBJECT) rrrrrrrr€r_rsrtr�rzrrr Úlink_shared_object¼s üzCCompiler.link_shared_objectc Cs.| tj|| |¡||||d||| d| ¡ dSr)r‚r Ú EXECUTABLEÚexecutable_filename) rrZoutput_prognamerrrrr_rsrtrzrrr Úlink_executableÐs   ýzCCompiler.link_executablecCst‚dS)zkReturn the compiler option to add 'dir' to the list of directories searched for libraries. Nr}r9rrr Úlibrary_dir_optionæszCCompiler.library_dir_optioncCst‚dS)zsReturn the compiler option to add 'dir' to the list of directories searched for runtime libraries. Nr}r9rrr Úruntime_library_dir_optionìsz$CCompiler.runtime_library_dir_optioncCst‚dS)zReturn the compiler option to add 'lib' to the list of libraries linked into the shared library or executable. Nr})rÚlibrrr Úlibrary_optionòszCCompiler.library_optionc Csôddl}|durg}|dur g}|dur,g}|dur8g}|jd|dd�\}}t |d¡} z2|D]} |  d| ¡q^|  d|¡W|  ¡n |  ¡0z|j|g|d �} Wnty¾Yd S0z|j| d ||d �Wnt t fyîYd S0dS) z·Return a boolean indicating whether funcname is supported on the current platform. The optional arguments can be used to augment the compilation environment. rNrT)ÚtextÚwz#include "%s" z=int main (int argc, char **argv) { %s(); return 0; } r<Fza.out)rr) ÚtempfileÚmkstemprRÚfdopenÚwriteÚcloserxZ CompileErrorrŒZ LinkErrorr3) rÚfuncnameZincludesrrrr“ÚfdÚfnameÚfZinclrrrr Ú has_functionøs<  û þ zCCompiler.has_functioncCst‚dS)aHSearch the specified list of directories for a static or shared library file 'lib' and return the full path to that file. If 'debug' true, look for a debugging version (if that makes sense on the current platform). Return None if 'lib' wasn't found in any of the specified directories. Nr})rr>r�r_rrr Úfind_library_file$szCCompiler.find_library_fileÚcCs–|dur d}g}|D]|}tj |¡\}}tj |¡d}|tj |¡d…}||jvrftd||fƒ‚|rvtj |¡}| tj  |||j ¡¡q|S)Nržr+z"unknown file type '%s' (from '%s')) rRrSrTÚ splitdriveÚisabsÚsrc_extensionsZUnknownFileErrorÚbasenamer6ÚjoinÚ obj_extension)rZsource_filenamesrMrZ obj_namesZsrc_namerqr]rrr rOOs"  ÿ  ÿzCCompiler.object_filenamescCs0|dus J‚|rtj |¡}tj |||j¡Sr)rRrSr¢r£Úshared_lib_extension©rr¢rMrrrr Úshared_object_filename`s  z CCompiler.shared_object_filenamecCs4|dus J‚|rtj |¡}tj |||jp.d¡S)Nrž)rRrSr¢r£Ú exe_extensionr¦rrr r‹fs  zCCompiler.executable_filenameÚstaticc Csl|dus J‚|dvrtdƒ‚t||dƒ}t||dƒ}tj |¡\}}|||f} |r\d}tj ||| ¡S)N)r©rƒZdylibZ xcode_stubz?'lib_type' must be "static", "shared", "dylib", or "xcode_stub"Z _lib_formatZ_lib_extensionrž)r"ÚgetattrrRrSÚsplitr£) rr@r„rMrÚfmtr]r:rqÚfilenamerrr r†ls ÿ zCCompiler.library_filenamer+cCst |¡dSr)r r_)rÚmsgÚlevelrrr ÚannounceszCCompiler.announcecCsddlm}|rt|ƒdS)Nr)ÚDEBUG)Zdistutils.debugr±Úprint)rr®r±rrr Ú debug_print‚s zCCompiler.debug_printcCstj d|¡dS)Nz warning: %s )ÚsysÚstderrr–)rr®rrr Úwarn‡szCCompiler.warncCst||||jƒdSr)rr)rÚfuncÚargsr®r¯rrr rŠszCCompiler.executecCst||jd�dS©N)r)rr)rÚcmdrrr r�szCCompiler.spawncCst|||jd�Sr¹)rr)rr[Údstrrr r�szCCompiler.move_fileéÿcCst|||jd�dSr¹)rr)rr,Úmoderrr r“szCCompiler.mkpath)rrr)N)N)NNNNN)NNNrNNN)NrN) NNNNNrNNNN) NNNNNrNNNN) NNNNNrNNNN)NNNNrNNN)NNNN)r)rrž)rrž)rrž)r©rrž)r+)Nr+)r¼)Br$Ú __module__Ú __qualname__Ú__doc__Z compiler_typer¡r¤Zstatic_lib_extensionr¥Zstatic_lib_formatZshared_lib_formatr¨rlrkr!r&rr/r4r7r8r;r?rArBrCrDrErFrHrIr^rbrcrdrerfrjrrrurxrwr{rˆr…rŠr‚r‡r‰rŒr�rŽr�rœr�rOr§r‹r†r°r³r¶rrrrrrrr r sêü $   +  " ÿ þ Dÿ ó Aô ô ö ÿ , +   ÿ   r ))zcygwin.*Úunix)ÚposixrÁ)ÚntÚmsvccCsV|durtj}|durtj}tD]0\}}t ||¡dusHt ||¡dur |Sq dS)akDetermine the default compiler to use for the given platform. osname should be one of the standard Python OS names (i.e. the ones returned by os.name) and platform the common value returned by sys.platform for the platform in question. The default values are os.name and sys.platform in case the parameters are not given. NrÁ)rRr,r´ÚplatformÚ_default_compilersÚreÚmatch)ZosnamerÅÚpatternÚcompilerrrr Úget_default_compiler©s  ÿ rË)Z unixccompilerZ UnixCCompilerzstandard UNIX-style compiler)Z _msvccompilerZ MSVCCompilerzMicrosoft Visual C++)ÚcygwinccompilerZCygwinCCompilerz'Cygwin port of GNU C Compiler for Win32)rÌZMingw32CCompilerz(Mingw32 port of GNU C Compiler for Win32)Z bcppcompilerZ BCPPCompilerzBorland C++ Compiler)rÁrÄÚcygwinZmingw32ZbcppcCsXddlm}g}t ¡D] }| d|dt|df¡q| ¡||ƒ}| d¡dS)zyPrint list of available compilers (used by the "--help-compiler" options to "build", "build_ext", "build_clib"). r)Ú FancyGetoptz compiler=Nr0zList of available compilers:)Zdistutils.fancy_getoptrÎÚcompiler_classrr6ÚsortÚ print_help)rÎZ compilersrÊZpretty_printerrrr Úshow_compilersÍs    ÿrÒc CsÞ|durtj}z"|dur t|ƒ}t|\}}}Wn6tyfd|}|durZ|d|}t|ƒ‚Yn0z*d|}t|ƒtj|} t | ƒ|} Wn>t y°t d|ƒ‚Yn"tyÐt d||fƒ‚Yn0| d||ƒS)a[Generate an instance of some CCompiler subclass for the supplied platform/compiler combination. 'plat' defaults to 'os.name' (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler for that platform. Currently only 'posix' and 'nt' are supported, and the default compilers are "traditional Unix interface" (UnixCCompiler class) and Visual C++ (MSVCCompiler class). Note that it's perfectly possible to ask for a Unix compiler object under Windows, and a Microsoft compiler object under Unix -- if you supply a value for 'compiler', 'plat' is ignored. Nz5don't know how to compile C/C++ code on platform '%s'z with '%s' compilerz distutils.z4can't compile C/C++ code: unable to load module '%s'zBcan't compile C/C++ code: unable to find class '%s' in module '%s') rRr,rËrÏrvZDistutilsPlatformErrorÚ __import__r´ÚmodulesÚvarsÚ ImportErrorZDistutilsModuleError) ZplatrÊrrrÚ module_nameÚ class_nameZlong_descriptionr®ÚmoduleÚklassrrr Ú new_compilerÞs:     ÿÿ ÿÿ rÛcCs´g}|D]Ž}t|tƒr0dt|ƒkr.dkss8      ø  --