1 | \section{\module{distutils.sysconfig} ---
|
---|
2 | System configuration information}
|
---|
3 |
|
---|
4 | \declaremodule{standard}{distutils.sysconfig}
|
---|
5 | \modulesynopsis{Low-level access to configuration information of the
|
---|
6 | Python interpreter.}
|
---|
7 | \moduleauthor{Fred L. Drake, Jr.}{fdrake@acm.org}
|
---|
8 | \moduleauthor{Greg Ward}{gward@python.net}
|
---|
9 | \sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org}
|
---|
10 |
|
---|
11 |
|
---|
12 | The \module{distutils.sysconfig} module provides access to Python's
|
---|
13 | low-level configuration information. The specific configuration
|
---|
14 | variables available depend heavily on the platform and configuration.
|
---|
15 | The specific variables depend on the build process for the specific
|
---|
16 | version of Python being run; the variables are those found in the
|
---|
17 | \file{Makefile} and configuration header that are installed with
|
---|
18 | Python on \UNIX{} systems. The configuration header is called
|
---|
19 | \file{pyconfig.h} for Python versions starting with 2.2, and
|
---|
20 | \file{config.h} for earlier versions of Python.
|
---|
21 |
|
---|
22 | Some additional functions are provided which perform some useful
|
---|
23 | manipulations for other parts of the \module{distutils} package.
|
---|
24 |
|
---|
25 |
|
---|
26 | \begin{datadesc}{PREFIX}
|
---|
27 | The result of \code{os.path.normpath(sys.prefix)}.
|
---|
28 | \end{datadesc}
|
---|
29 |
|
---|
30 | \begin{datadesc}{EXEC_PREFIX}
|
---|
31 | The result of \code{os.path.normpath(sys.exec_prefix)}.
|
---|
32 | \end{datadesc}
|
---|
33 |
|
---|
34 | \begin{funcdesc}{get_config_var}{name}
|
---|
35 | Return the value of a single variable. This is equivalent to
|
---|
36 | \code{get_config_vars().get(\var{name})}.
|
---|
37 | \end{funcdesc}
|
---|
38 |
|
---|
39 | \begin{funcdesc}{get_config_vars}{\moreargs}
|
---|
40 | Return a set of variable definitions. If there are no arguments,
|
---|
41 | this returns a dictionary mapping names of configuration variables
|
---|
42 | to values. If arguments are provided, they should be strings, and
|
---|
43 | the return value will be a sequence giving the associated values.
|
---|
44 | If a given name does not have a corresponding value, \code{None}
|
---|
45 | will be included for that variable.
|
---|
46 | \end{funcdesc}
|
---|
47 |
|
---|
48 | \begin{funcdesc}{get_config_h_filename}{}
|
---|
49 | Return the full path name of the configuration header. For \UNIX,
|
---|
50 | this will be the header generated by the \program{configure} script;
|
---|
51 | for other platforms the header will have been supplied directly by
|
---|
52 | the Python source distribution. The file is a platform-specific
|
---|
53 | text file.
|
---|
54 | \end{funcdesc}
|
---|
55 |
|
---|
56 | \begin{funcdesc}{get_makefile_filename}{}
|
---|
57 | Return the full path name of the \file{Makefile} used to build
|
---|
58 | Python. For \UNIX, this will be a file generated by the
|
---|
59 | \program{configure} script; the meaning for other platforms will
|
---|
60 | vary. The file is a platform-specific text file, if it exists.
|
---|
61 | This function is only useful on \POSIX{} platforms.
|
---|
62 | \end{funcdesc}
|
---|
63 |
|
---|
64 | \begin{funcdesc}{get_python_inc}{\optional{plat_specific\optional{, prefix}}}
|
---|
65 | Return the directory for either the general or platform-dependent C
|
---|
66 | include files. If \var{plat_specific} is true, the
|
---|
67 | platform-dependent include directory is returned; if false or
|
---|
68 | omitted, the platform-independent directory is returned. If
|
---|
69 | \var{prefix} is given, it is used as either the prefix instead of
|
---|
70 | \constant{PREFIX}, or as the exec-prefix instead of
|
---|
71 | \constant{EXEC_PREFIX} if \var{plat_specific} is true.
|
---|
72 | \end{funcdesc}
|
---|
73 |
|
---|
74 | \begin{funcdesc}{get_python_lib}{\optional{plat_specific\optional{,
|
---|
75 | standard_lib\optional{, prefix}}}}
|
---|
76 | Return the directory for either the general or platform-dependent
|
---|
77 | library installation. If \var{plat_specific} is true, the
|
---|
78 | platform-dependent include directory is returned; if false or
|
---|
79 | omitted, the platform-independent directory is returned. If
|
---|
80 | \var{prefix} is given, it is used as either the prefix instead of
|
---|
81 | \constant{PREFIX}, or as the exec-prefix instead of
|
---|
82 | \constant{EXEC_PREFIX} if \var{plat_specific} is true. If
|
---|
83 | \var{standard_lib} is true, the directory for the standard library
|
---|
84 | is returned rather than the directory for the installation of
|
---|
85 | third-party extensions.
|
---|
86 | \end{funcdesc}
|
---|
87 |
|
---|
88 |
|
---|
89 | The following function is only intended for use within the
|
---|
90 | \module{distutils} package.
|
---|
91 |
|
---|
92 | \begin{funcdesc}{customize_compiler}{compiler}
|
---|
93 | Do any platform-specific customization of a
|
---|
94 | \class{distutils.ccompiler.CCompiler} instance.
|
---|
95 |
|
---|
96 | This function is only needed on \UNIX{} at this time, but should be
|
---|
97 | called consistently to support forward-compatibility. It inserts
|
---|
98 | the information that varies across \UNIX{} flavors and is stored in
|
---|
99 | Python's \file{Makefile}. This information includes the selected
|
---|
100 | compiler, compiler and linker options, and the extension used by the
|
---|
101 | linker for shared objects.
|
---|
102 | \end{funcdesc}
|
---|
103 |
|
---|
104 |
|
---|
105 | This function is even more special-purpose, and should only be used
|
---|
106 | from Python's own build procedures.
|
---|
107 |
|
---|
108 | \begin{funcdesc}{set_python_build}{}
|
---|
109 | Inform the \module{distutils.sysconfig} module that it is being used
|
---|
110 | as part of the build process for Python. This changes a lot of
|
---|
111 | relative locations for files, allowing them to be located in the
|
---|
112 | build area rather than in an installed Python.
|
---|
113 | \end{funcdesc}
|
---|