configure.html 118 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
  6. <meta property="og:title" content="3. Configure Python" />
  7. <meta property="og:type" content="website" />
  8. <meta property="og:url" content="https://docs.python.org/3/using/configure.html" />
  9. <meta property="og:site_name" content="Python documentation" />
  10. <meta property="og:description" content="Build Requirements: Features required to build CPython: A C11 compiler. Optional C11 features are not required., Support for IEEE 754 floating point numbers and floating point Not-a-Number (NaN)., ..." />
  11. <meta property="og:image" content="https://docs.python.org/3/_static/og-image.png" />
  12. <meta property="og:image:alt" content="Python documentation" />
  13. <meta name="description" content="Build Requirements: Features required to build CPython: A C11 compiler. Optional C11 features are not required., Support for IEEE 754 floating point numbers and floating point Not-a-Number (NaN)., ..." />
  14. <meta property="og:image:width" content="200" />
  15. <meta property="og:image:height" content="200" />
  16. <meta name="theme-color" content="#3776ab" />
  17. <title>3. Configure Python &#8212; Python 3.12.0 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
  18. <link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
  19. <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?digest=b37c26da2f7529d09fe70b41c4b2133fe4931a90" />
  20. <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css" />
  21. <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
  22. <script src="../_static/jquery.js"></script>
  23. <script src="../_static/underscore.js"></script>
  24. <script src="../_static/doctools.js"></script>
  25. <script src="../_static/sidebar.js"></script>
  26. <link rel="search" type="application/opensearchdescription+xml"
  27. title="Search within Python 3.12.0 documentation"
  28. href="../_static/opensearch.xml"/>
  29. <link rel="author" title="About these documents" href="../about.html" />
  30. <link rel="index" title="Index" href="../genindex.html" />
  31. <link rel="search" title="Search" href="../search.html" />
  32. <link rel="copyright" title="Copyright" href="../copyright.html" />
  33. <link rel="next" title="4. Using Python on Windows" href="windows.html" />
  34. <link rel="prev" title="2. Using Python on Unix platforms" href="unix.html" />
  35. <link rel="canonical" href="https://docs.python.org/3/using/configure.html" />
  36. <style>
  37. @media only screen {
  38. table.full-width-table {
  39. width: 100%;
  40. }
  41. }
  42. </style>
  43. <link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">
  44. <link rel="shortcut icon" type="image/png" href="../_static/py.svg" />
  45. <script type="text/javascript" src="../_static/copybutton.js"></script>
  46. <script type="text/javascript" src="../_static/menu.js"></script>
  47. <script type="text/javascript" src="../_static/themetoggle.js"></script>
  48. </head>
  49. <body>
  50. <div class="mobile-nav">
  51. <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"
  52. aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" />
  53. <nav class="nav-content" role="navigation">
  54. <label for="menuToggler" class="toggler__label">
  55. <span></span>
  56. </label>
  57. <span class="nav-items-wrapper">
  58. <a href="https://www.python.org/" class="nav-logo">
  59. <img src="../_static/py.svg" alt="Logo"/>
  60. </a>
  61. <span class="version_switcher_placeholder"></span>
  62. <form role="search" class="search" action="../search.html" method="get">
  63. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">
  64. <path fill-rule="nonzero" fill="currentColor" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
  65. </svg>
  66. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  67. <input type="submit" value="Go"/>
  68. </form>
  69. </span>
  70. </nav>
  71. <div class="menu-wrapper">
  72. <nav class="menu" role="navigation" aria-label="main navigation">
  73. <div class="language_switcher_placeholder"></div>
  74. <label class="theme-selector-label">
  75. Theme
  76. <select class="theme-selector" oninput="activateTheme(this.value)">
  77. <option value="auto" selected>Auto</option>
  78. <option value="light">Light</option>
  79. <option value="dark">Dark</option>
  80. </select>
  81. </label>
  82. <div>
  83. <h3><a href="../contents.html">Table of Contents</a></h3>
  84. <ul>
  85. <li><a class="reference internal" href="#">3. Configure Python</a><ul>
  86. <li><a class="reference internal" href="#build-requirements">3.1. Build Requirements</a></li>
  87. <li><a class="reference internal" href="#generated-files">3.2. Generated files</a></li>
  88. <li><a class="reference internal" href="#configure-options">3.3. Configure Options</a><ul>
  89. <li><a class="reference internal" href="#general-options">3.3.1. General Options</a></li>
  90. <li><a class="reference internal" href="#webassembly-options">3.3.2. WebAssembly Options</a></li>
  91. <li><a class="reference internal" href="#install-options">3.3.3. Install Options</a></li>
  92. <li><a class="reference internal" href="#performance-options">3.3.4. Performance options</a></li>
  93. <li><a class="reference internal" href="#python-debug-build">3.3.5. Python Debug Build</a></li>
  94. <li><a class="reference internal" href="#debug-options">3.3.6. Debug options</a></li>
  95. <li><a class="reference internal" href="#linker-options">3.3.7. Linker options</a></li>
  96. <li><a class="reference internal" href="#libraries-options">3.3.8. Libraries options</a></li>
  97. <li><a class="reference internal" href="#security-options">3.3.9. Security Options</a></li>
  98. <li><a class="reference internal" href="#macos-options">3.3.10. macOS Options</a></li>
  99. <li><a class="reference internal" href="#cross-compiling-options">3.3.11. Cross Compiling Options</a></li>
  100. </ul>
  101. </li>
  102. <li><a class="reference internal" href="#python-build-system">3.4. Python Build System</a><ul>
  103. <li><a class="reference internal" href="#main-files-of-the-build-system">3.4.1. Main files of the build system</a></li>
  104. <li><a class="reference internal" href="#main-build-steps">3.4.2. Main build steps</a></li>
  105. <li><a class="reference internal" href="#main-makefile-targets">3.4.3. Main Makefile targets</a></li>
  106. <li><a class="reference internal" href="#c-extensions">3.4.4. C extensions</a></li>
  107. </ul>
  108. </li>
  109. <li><a class="reference internal" href="#compiler-and-linker-flags">3.5. Compiler and linker flags</a><ul>
  110. <li><a class="reference internal" href="#preprocessor-flags">3.5.1. Preprocessor flags</a></li>
  111. <li><a class="reference internal" href="#compiler-flags">3.5.2. Compiler flags</a></li>
  112. <li><a class="reference internal" href="#linker-flags">3.5.3. Linker flags</a></li>
  113. </ul>
  114. </li>
  115. </ul>
  116. </li>
  117. </ul>
  118. </div>
  119. <div>
  120. <h4>Previous topic</h4>
  121. <p class="topless"><a href="unix.html"
  122. title="previous chapter"><span class="section-number">2. </span>Using Python on Unix platforms</a></p>
  123. </div>
  124. <div>
  125. <h4>Next topic</h4>
  126. <p class="topless"><a href="windows.html"
  127. title="next chapter"><span class="section-number">4. </span>Using Python on Windows</a></p>
  128. </div>
  129. <div role="note" aria-label="source link">
  130. <h3>This Page</h3>
  131. <ul class="this-page-menu">
  132. <li><a href="../bugs.html">Report a Bug</a></li>
  133. <li>
  134. <a href="https://github.com/python/cpython/blob/main/Doc/using/configure.rst"
  135. rel="nofollow">Show Source
  136. </a>
  137. </li>
  138. </ul>
  139. </div>
  140. </nav>
  141. </div>
  142. </div>
  143. <div class="related" role="navigation" aria-label="related navigation">
  144. <h3>Navigation</h3>
  145. <ul>
  146. <li class="right" style="margin-right: 10px">
  147. <a href="../genindex.html" title="General Index"
  148. accesskey="I">index</a></li>
  149. <li class="right" >
  150. <a href="../py-modindex.html" title="Python Module Index"
  151. >modules</a> |</li>
  152. <li class="right" >
  153. <a href="windows.html" title="4. Using Python on Windows"
  154. accesskey="N">next</a> |</li>
  155. <li class="right" >
  156. <a href="unix.html" title="2. Using Python on Unix platforms"
  157. accesskey="P">previous</a> |</li>
  158. <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  159. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  160. <li class="switchers">
  161. <div class="language_switcher_placeholder"></div>
  162. <div class="version_switcher_placeholder"></div>
  163. </li>
  164. <li>
  165. </li>
  166. <li id="cpython-language-and-version">
  167. <a href="../index.html">3.12.0 Documentation</a> &#187;
  168. </li>
  169. <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Python Setup and Usage</a> &#187;</li>
  170. <li class="nav-item nav-item-this"><a href=""><span class="section-number">3. </span>Configure Python</a></li>
  171. <li class="right">
  172. <div class="inline-search" role="search">
  173. <form class="inline-search" action="../search.html" method="get">
  174. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  175. <input type="submit" value="Go" />
  176. </form>
  177. </div>
  178. |
  179. </li>
  180. <li class="right">
  181. <label class="theme-selector-label">
  182. Theme
  183. <select class="theme-selector" oninput="activateTheme(this.value)">
  184. <option value="auto" selected>Auto</option>
  185. <option value="light">Light</option>
  186. <option value="dark">Dark</option>
  187. </select>
  188. </label> |</li>
  189. </ul>
  190. </div>
  191. <div class="document">
  192. <div class="documentwrapper">
  193. <div class="bodywrapper">
  194. <div class="body" role="main">
  195. <section id="configure-python">
  196. <h1><span class="section-number">3. </span>Configure Python<a class="headerlink" href="#configure-python" title="Permalink to this headline">¶</a></h1>
  197. <section id="build-requirements">
  198. <h2><span class="section-number">3.1. </span>Build Requirements<a class="headerlink" href="#build-requirements" title="Permalink to this headline">¶</a></h2>
  199. <p>Features required to build CPython:</p>
  200. <ul class="simple">
  201. <li><p>A <a class="reference external" href="https://en.cppreference.com/w/c/11">C11</a> compiler. <a class="reference external" href="https://en.wikipedia.org/wiki/C11_(C_standard_revision)#Optional_features">Optional C11
  202. features</a>
  203. are not required.</p></li>
  204. <li><p>Support for <a class="reference external" href="https://en.wikipedia.org/wiki/IEEE_754">IEEE 754</a> floating
  205. point numbers and <a class="reference external" href="https://en.wikipedia.org/wiki/NaN#Floating_point">floating point Not-a-Number (NaN)</a>.</p></li>
  206. <li><p>Support for threads.</p></li>
  207. <li><p>OpenSSL 1.1.1 or newer for the <a class="reference internal" href="../library/ssl.html#module-ssl" title="ssl: TLS/SSL wrapper for socket objects"><code class="xref py py-mod docutils literal notranslate"><span class="pre">ssl</span></code></a> and <a class="reference internal" href="../library/hashlib.html#module-hashlib" title="hashlib: Secure hash and message digest algorithms."><code class="xref py py-mod docutils literal notranslate"><span class="pre">hashlib</span></code></a> modules.</p></li>
  208. <li><p>On Windows, Microsoft Visual Studio 2017 or later is required.</p></li>
  209. </ul>
  210. <div class="versionchanged">
  211. <p><span class="versionmodified changed">Changed in version 3.11: </span>C11 compiler, IEEE 754 and NaN support are now required.
  212. On Windows, Visual Studio 2017 or later is required.</p>
  213. </div>
  214. <div class="versionchanged">
  215. <p><span class="versionmodified changed">Changed in version 3.10: </span>OpenSSL 1.1.1 is now required.</p>
  216. </div>
  217. <div class="versionchanged">
  218. <p><span class="versionmodified changed">Changed in version 3.7: </span>Thread support and OpenSSL 1.0.2 are now required.</p>
  219. </div>
  220. <div class="versionchanged">
  221. <p><span class="versionmodified changed">Changed in version 3.6: </span>Selected C99 features are now required, like <code class="docutils literal notranslate"><span class="pre">&lt;stdint.h&gt;</span></code> and <code class="docutils literal notranslate"><span class="pre">static</span>
  222. <span class="pre">inline</span></code> functions.</p>
  223. </div>
  224. <div class="versionchanged">
  225. <p><span class="versionmodified changed">Changed in version 3.5: </span>On Windows, Visual Studio 2015 or later is required.</p>
  226. </div>
  227. <p>See also <span class="target" id="index-0"></span><a class="pep reference external" href="https://peps.python.org/pep-0007/"><strong>PEP 7</strong></a> “Style Guide for C Code” and <span class="target" id="index-1"></span><a class="pep reference external" href="https://peps.python.org/pep-0011/"><strong>PEP 11</strong></a> “CPython platform
  228. support”.</p>
  229. </section>
  230. <section id="generated-files">
  231. <h2><span class="section-number">3.2. </span>Generated files<a class="headerlink" href="#generated-files" title="Permalink to this headline">¶</a></h2>
  232. <p>To reduce build dependencies, Python source code contains multiple generated
  233. files. Commands to regenerate all generated files:</p>
  234. <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">regen</span><span class="o">-</span><span class="nb">all</span>
  235. <span class="n">make</span> <span class="n">regen</span><span class="o">-</span><span class="n">stdlib</span><span class="o">-</span><span class="n">module</span><span class="o">-</span><span class="n">names</span>
  236. <span class="n">make</span> <span class="n">regen</span><span class="o">-</span><span class="n">limited</span><span class="o">-</span><span class="n">abi</span>
  237. <span class="n">make</span> <span class="n">regen</span><span class="o">-</span><span class="n">configure</span>
  238. </pre></div>
  239. </div>
  240. <p>The <code class="docutils literal notranslate"><span class="pre">Makefile.pre.in</span></code> file documents generated files, their inputs, and tools used
  241. to regenerate them. Search for <code class="docutils literal notranslate"><span class="pre">regen-*</span></code> make targets.</p>
  242. <p>The <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">regen-configure</span></code> command runs <a class="reference external" href="https://github.com/tiran/cpython_autoconf">tiran/cpython_autoconf</a> container for reproducible build;
  243. see container <code class="docutils literal notranslate"><span class="pre">entry.sh</span></code> script. The container is optional, the following
  244. command can be run locally, the generated files depend on autoconf and aclocal
  245. versions:</p>
  246. <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="n">autoreconf</span> <span class="o">-</span><span class="n">ivf</span> <span class="o">-</span><span class="n">Werror</span>
  247. </pre></div>
  248. </div>
  249. </section>
  250. <section id="configure-options">
  251. <span id="id1"></span><h2><span class="section-number">3.3. </span>Configure Options<a class="headerlink" href="#configure-options" title="Permalink to this headline">¶</a></h2>
  252. <p>List all <code class="docutils literal notranslate"><span class="pre">./configure</span></code> script options using:</p>
  253. <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">configure</span> <span class="o">--</span><span class="n">help</span>
  254. </pre></div>
  255. </div>
  256. <p>See also the <code class="file docutils literal notranslate"><span class="pre">Misc/SpecialBuilds.txt</span></code> in the Python source distribution.</p>
  257. <section id="general-options">
  258. <h3><span class="section-number">3.3.1. </span>General Options<a class="headerlink" href="#general-options" title="Permalink to this headline">¶</a></h3>
  259. <dl class="std cmdoption">
  260. <dt class="sig sig-object std" id="cmdoption-enable-loadable-sqlite-extensions">
  261. <span class="sig-name descname"><span class="pre">--enable-loadable-sqlite-extensions</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-enable-loadable-sqlite-extensions" title="Permalink to this definition">¶</a></dt>
  262. <dd><p>Support loadable extensions in the <code class="xref py py-mod docutils literal notranslate"><span class="pre">_sqlite</span></code> extension module (default
  263. is no) of the <a class="reference internal" href="../library/sqlite3.html#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><code class="xref py py-mod docutils literal notranslate"><span class="pre">sqlite3</span></code></a> module.</p>
  264. <p>See the <a class="reference internal" href="../library/sqlite3.html#sqlite3.Connection.enable_load_extension" title="sqlite3.Connection.enable_load_extension"><code class="xref py py-meth docutils literal notranslate"><span class="pre">sqlite3.Connection.enable_load_extension()</span></code></a> method of the
  265. <a class="reference internal" href="../library/sqlite3.html#module-sqlite3" title="sqlite3: A DB-API 2.0 implementation using SQLite 3.x."><code class="xref py py-mod docutils literal notranslate"><span class="pre">sqlite3</span></code></a> module.</p>
  266. <div class="versionadded">
  267. <p><span class="versionmodified added">New in version 3.6.</span></p>
  268. </div>
  269. </dd></dl>
  270. <dl class="std cmdoption">
  271. <dt class="sig sig-object std" id="cmdoption-disable-ipv6">
  272. <span class="sig-name descname"><span class="pre">--disable-ipv6</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-disable-ipv6" title="Permalink to this definition">¶</a></dt>
  273. <dd><p>Disable IPv6 support (enabled by default if supported), see the
  274. <a class="reference internal" href="../library/socket.html#module-socket" title="socket: Low-level networking interface."><code class="xref py py-mod docutils literal notranslate"><span class="pre">socket</span></code></a> module.</p>
  275. </dd></dl>
  276. <dl class="std cmdoption">
  277. <dt class="sig sig-object std" id="cmdoption-enable-big-digits">
  278. <span class="sig-name descname"><span class="pre">--enable-big-digits</span></span><span class="sig-prename descclassname"><span class="pre">=[15|30]</span></span><a class="headerlink" href="#cmdoption-enable-big-digits" title="Permalink to this definition">¶</a></dt>
  279. <dd><p>Define the size in bits of Python <a class="reference internal" href="../library/functions.html#int" title="int"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a> digits: 15 or 30 bits.</p>
  280. <p>By default, the digit size is 30.</p>
  281. <p>Define the <code class="docutils literal notranslate"><span class="pre">PYLONG_BITS_IN_DIGIT</span></code> to <code class="docutils literal notranslate"><span class="pre">15</span></code> or <code class="docutils literal notranslate"><span class="pre">30</span></code>.</p>
  282. <p>See <a class="reference internal" href="../library/sys.html#sys.int_info" title="sys.int_info"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.int_info.bits_per_digit</span></code></a>.</p>
  283. </dd></dl>
  284. <dl class="std cmdoption">
  285. <dt class="sig sig-object std" id="cmdoption-with-suffix">
  286. <span class="sig-name descname"><span class="pre">--with-suffix</span></span><span class="sig-prename descclassname"><span class="pre">=SUFFIX</span></span><a class="headerlink" href="#cmdoption-with-suffix" title="Permalink to this definition">¶</a></dt>
  287. <dd><p>Set the Python executable suffix to <em>SUFFIX</em>.</p>
  288. <p>The default suffix is <code class="docutils literal notranslate"><span class="pre">.exe</span></code> on Windows and macOS (<code class="docutils literal notranslate"><span class="pre">python.exe</span></code>
  289. executable), <code class="docutils literal notranslate"><span class="pre">.js</span></code> on Emscripten node, <code class="docutils literal notranslate"><span class="pre">.html</span></code> on Emscripten browser,
  290. <code class="docutils literal notranslate"><span class="pre">.wasm</span></code> on WASI, and an empty string on other platforms (<code class="docutils literal notranslate"><span class="pre">python</span></code>
  291. executable).</p>
  292. <div class="versionchanged">
  293. <p><span class="versionmodified changed">Changed in version 3.11: </span>The default suffix on WASM platform is one of <code class="docutils literal notranslate"><span class="pre">.js</span></code>, <code class="docutils literal notranslate"><span class="pre">.html</span></code>
  294. or <code class="docutils literal notranslate"><span class="pre">.wasm</span></code>.</p>
  295. </div>
  296. </dd></dl>
  297. <dl class="std cmdoption">
  298. <dt class="sig sig-object std" id="cmdoption-with-tzpath">
  299. <span class="sig-name descname"><span class="pre">--with-tzpath</span></span><span class="sig-prename descclassname"><span class="pre">=&lt;list</span> <span class="pre">of</span> <span class="pre">absolute</span> <span class="pre">paths</span> <span class="pre">separated</span> <span class="pre">by</span> <span class="pre">pathsep&gt;</span></span><a class="headerlink" href="#cmdoption-with-tzpath" title="Permalink to this definition">¶</a></dt>
  300. <dd><p>Select the default time zone search path for <a class="reference internal" href="../library/zoneinfo.html#zoneinfo.TZPATH" title="zoneinfo.TZPATH"><code class="xref py py-const docutils literal notranslate"><span class="pre">zoneinfo.TZPATH</span></code></a>.
  301. See the <a class="reference internal" href="../library/zoneinfo.html#zoneinfo-data-compile-time-config"><span class="std std-ref">Compile-time configuration</span></a> of the <a class="reference internal" href="../library/zoneinfo.html#module-zoneinfo" title="zoneinfo: IANA time zone support"><code class="xref py py-mod docutils literal notranslate"><span class="pre">zoneinfo</span></code></a> module.</p>
  302. <p>Default: <code class="docutils literal notranslate"><span class="pre">/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo</span></code>.</p>
  303. <p>See <a class="reference internal" href="../library/os.html#os.pathsep" title="os.pathsep"><code class="xref py py-data docutils literal notranslate"><span class="pre">os.pathsep</span></code></a> path separator.</p>
  304. <div class="versionadded">
  305. <p><span class="versionmodified added">New in version 3.9.</span></p>
  306. </div>
  307. </dd></dl>
  308. <dl class="std cmdoption">
  309. <dt class="sig sig-object std" id="cmdoption-without-decimal-contextvar">
  310. <span class="sig-name descname"><span class="pre">--without-decimal-contextvar</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-without-decimal-contextvar" title="Permalink to this definition">¶</a></dt>
  311. <dd><p>Build the <code class="docutils literal notranslate"><span class="pre">_decimal</span></code> extension module using a thread-local context rather
  312. than a coroutine-local context (default), see the <a class="reference internal" href="../library/decimal.html#module-decimal" title="decimal: Implementation of the General Decimal Arithmetic Specification."><code class="xref py py-mod docutils literal notranslate"><span class="pre">decimal</span></code></a> module.</p>
  313. <p>See <a class="reference internal" href="../library/decimal.html#decimal.HAVE_CONTEXTVAR" title="decimal.HAVE_CONTEXTVAR"><code class="xref py py-const docutils literal notranslate"><span class="pre">decimal.HAVE_CONTEXTVAR</span></code></a> and the <a class="reference internal" href="../library/contextvars.html#module-contextvars" title="contextvars: Context Variables"><code class="xref py py-mod docutils literal notranslate"><span class="pre">contextvars</span></code></a> module.</p>
  314. <div class="versionadded">
  315. <p><span class="versionmodified added">New in version 3.9.</span></p>
  316. </div>
  317. </dd></dl>
  318. <dl class="std cmdoption">
  319. <dt class="sig sig-object std" id="cmdoption-with-dbmliborder">
  320. <span class="sig-name descname"><span class="pre">--with-dbmliborder</span></span><span class="sig-prename descclassname"><span class="pre">=&lt;list</span> <span class="pre">of</span> <span class="pre">backend</span> <span class="pre">names&gt;</span></span><a class="headerlink" href="#cmdoption-with-dbmliborder" title="Permalink to this definition">¶</a></dt>
  321. <dd><p>Override order to check db backends for the <a class="reference internal" href="../library/dbm.html#module-dbm" title="dbm: Interfaces to various Unix &quot;database&quot; formats."><code class="xref py py-mod docutils literal notranslate"><span class="pre">dbm</span></code></a> module</p>
  322. <p>A valid value is a colon (<code class="docutils literal notranslate"><span class="pre">:</span></code>) separated string with the backend names:</p>
  323. <ul class="simple">
  324. <li><p><code class="docutils literal notranslate"><span class="pre">ndbm</span></code>;</p></li>
  325. <li><p><code class="docutils literal notranslate"><span class="pre">gdbm</span></code>;</p></li>
  326. <li><p><code class="docutils literal notranslate"><span class="pre">bdb</span></code>.</p></li>
  327. </ul>
  328. </dd></dl>
  329. <dl class="std cmdoption">
  330. <dt class="sig sig-object std" id="cmdoption-without-c-locale-coercion">
  331. <span class="sig-name descname"><span class="pre">--without-c-locale-coercion</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-without-c-locale-coercion" title="Permalink to this definition">¶</a></dt>
  332. <dd><p>Disable C locale coercion to a UTF-8 based locale (enabled by default).</p>
  333. <p>Don’t define the <code class="docutils literal notranslate"><span class="pre">PY_COERCE_C_LOCALE</span></code> macro.</p>
  334. <p>See <span class="target" id="index-2"></span><a class="reference internal" href="cmdline.html#envvar-PYTHONCOERCECLOCALE"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONCOERCECLOCALE</span></code></a> and the <span class="target" id="index-3"></span><a class="pep reference external" href="https://peps.python.org/pep-0538/"><strong>PEP 538</strong></a>.</p>
  335. </dd></dl>
  336. <dl class="std cmdoption">
  337. <dt class="sig sig-object std" id="cmdoption-without-freelists">
  338. <span class="sig-name descname"><span class="pre">--without-freelists</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-without-freelists" title="Permalink to this definition">¶</a></dt>
  339. <dd><p>Disable all freelists except the empty tuple singleton.</p>
  340. <div class="versionadded">
  341. <p><span class="versionmodified added">New in version 3.11.</span></p>
  342. </div>
  343. </dd></dl>
  344. <dl class="std cmdoption">
  345. <dt class="sig sig-object std" id="cmdoption-with-platlibdir">
  346. <span class="sig-name descname"><span class="pre">--with-platlibdir</span></span><span class="sig-prename descclassname"><span class="pre">=DIRNAME</span></span><a class="headerlink" href="#cmdoption-with-platlibdir" title="Permalink to this definition">¶</a></dt>
  347. <dd><p>Python library directory name (default is <code class="docutils literal notranslate"><span class="pre">lib</span></code>).</p>
  348. <p>Fedora and SuSE use <code class="docutils literal notranslate"><span class="pre">lib64</span></code> on 64-bit platforms.</p>
  349. <p>See <a class="reference internal" href="../library/sys.html#sys.platlibdir" title="sys.platlibdir"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.platlibdir</span></code></a>.</p>
  350. <div class="versionadded">
  351. <p><span class="versionmodified added">New in version 3.9.</span></p>
  352. </div>
  353. </dd></dl>
  354. <dl class="std cmdoption">
  355. <dt class="sig sig-object std" id="cmdoption-with-wheel-pkg-dir">
  356. <span class="sig-name descname"><span class="pre">--with-wheel-pkg-dir</span></span><span class="sig-prename descclassname"><span class="pre">=PATH</span></span><a class="headerlink" href="#cmdoption-with-wheel-pkg-dir" title="Permalink to this definition">¶</a></dt>
  357. <dd><p>Directory of wheel packages used by the <a class="reference internal" href="../library/ensurepip.html#module-ensurepip" title="ensurepip: Bootstrapping the &quot;pip&quot; installer into an existing Python installation or virtual environment."><code class="xref py py-mod docutils literal notranslate"><span class="pre">ensurepip</span></code></a> module
  358. (none by default).</p>
  359. <p>Some Linux distribution packaging policies recommend against bundling
  360. dependencies. For example, Fedora installs wheel packages in the
  361. <code class="docutils literal notranslate"><span class="pre">/usr/share/python-wheels/</span></code> directory and don’t install the
  362. <code class="xref py py-mod docutils literal notranslate"><span class="pre">ensurepip._bundled</span></code> package.</p>
  363. <div class="versionadded">
  364. <p><span class="versionmodified added">New in version 3.10.</span></p>
  365. </div>
  366. </dd></dl>
  367. <dl class="std cmdoption">
  368. <dt class="sig sig-object std" id="cmdoption-with-pkg-config">
  369. <span class="sig-name descname"><span class="pre">--with-pkg-config</span></span><span class="sig-prename descclassname"><span class="pre">=[check|yes|no]</span></span><a class="headerlink" href="#cmdoption-with-pkg-config" title="Permalink to this definition">¶</a></dt>
  370. <dd><p>Whether configure should use <strong class="program">pkg-config</strong> to detect build
  371. dependencies.</p>
  372. <ul class="simple">
  373. <li><p><code class="docutils literal notranslate"><span class="pre">check</span></code> (default): <strong class="program">pkg-config</strong> is optional</p></li>
  374. <li><p><code class="docutils literal notranslate"><span class="pre">yes</span></code>: <strong class="program">pkg-config</strong> is mandatory</p></li>
  375. <li><p><code class="docutils literal notranslate"><span class="pre">no</span></code>: configure does not use <strong class="program">pkg-config</strong> even when present</p></li>
  376. </ul>
  377. <div class="versionadded">
  378. <p><span class="versionmodified added">New in version 3.11.</span></p>
  379. </div>
  380. </dd></dl>
  381. <dl class="std cmdoption">
  382. <dt class="sig sig-object std" id="cmdoption-enable-pystats">
  383. <span class="sig-name descname"><span class="pre">--enable-pystats</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-enable-pystats" title="Permalink to this definition">¶</a></dt>
  384. <dd><p>Turn on internal statistics gathering.</p>
  385. <p>The statistics will be dumped to a arbitrary (probably unique) file in
  386. <code class="docutils literal notranslate"><span class="pre">/tmp/py_stats/</span></code>, or <code class="docutils literal notranslate"><span class="pre">C:\temp\py_stats\</span></code> on Windows. If that directory
  387. does not exist, results will be printed on stdout.</p>
  388. <p>Use <code class="docutils literal notranslate"><span class="pre">Tools/scripts/summarize_stats.py</span></code> to read the stats.</p>
  389. <div class="versionadded">
  390. <p><span class="versionmodified added">New in version 3.11.</span></p>
  391. </div>
  392. </dd></dl>
  393. </section>
  394. <section id="webassembly-options">
  395. <h3><span class="section-number">3.3.2. </span>WebAssembly Options<a class="headerlink" href="#webassembly-options" title="Permalink to this headline">¶</a></h3>
  396. <dl class="std cmdoption">
  397. <dt class="sig sig-object std" id="cmdoption-with-emscripten-target">
  398. <span class="sig-name descname"><span class="pre">--with-emscripten-target</span></span><span class="sig-prename descclassname"><span class="pre">=[browser|node]</span></span><a class="headerlink" href="#cmdoption-with-emscripten-target" title="Permalink to this definition">¶</a></dt>
  399. <dd><p>Set build flavor for <code class="docutils literal notranslate"><span class="pre">wasm32-emscripten</span></code>.</p>
  400. <ul class="simple">
  401. <li><p><code class="docutils literal notranslate"><span class="pre">browser</span></code> (default): preload minimal stdlib, default MEMFS.</p></li>
  402. <li><p><code class="docutils literal notranslate"><span class="pre">node</span></code>: NODERAWFS and pthread support.</p></li>
  403. </ul>
  404. <div class="versionadded">
  405. <p><span class="versionmodified added">New in version 3.11.</span></p>
  406. </div>
  407. </dd></dl>
  408. <dl class="std cmdoption">
  409. <dt class="sig sig-object std" id="cmdoption-enable-wasm-dynamic-linking">
  410. <span class="sig-name descname"><span class="pre">--enable-wasm-dynamic-linking</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-enable-wasm-dynamic-linking" title="Permalink to this definition">¶</a></dt>
  411. <dd><p>Turn on dynamic linking support for WASM.</p>
  412. <p>Dynamic linking enables <code class="docutils literal notranslate"><span class="pre">dlopen</span></code>. File size of the executable
  413. increases due to limited dead code elimination and additional features.</p>
  414. <div class="versionadded">
  415. <p><span class="versionmodified added">New in version 3.11.</span></p>
  416. </div>
  417. </dd></dl>
  418. <dl class="std cmdoption">
  419. <dt class="sig sig-object std" id="cmdoption-enable-wasm-pthreads">
  420. <span class="sig-name descname"><span class="pre">--enable-wasm-pthreads</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-enable-wasm-pthreads" title="Permalink to this definition">¶</a></dt>
  421. <dd><p>Turn on pthreads support for WASM.</p>
  422. <div class="versionadded">
  423. <p><span class="versionmodified added">New in version 3.11.</span></p>
  424. </div>
  425. </dd></dl>
  426. </section>
  427. <section id="install-options">
  428. <h3><span class="section-number">3.3.3. </span>Install Options<a class="headerlink" href="#install-options" title="Permalink to this headline">¶</a></h3>
  429. <dl class="std cmdoption">
  430. <dt class="sig sig-object std" id="cmdoption-prefix">
  431. <span class="sig-name descname"><span class="pre">--prefix</span></span><span class="sig-prename descclassname"><span class="pre">=PREFIX</span></span><a class="headerlink" href="#cmdoption-prefix" title="Permalink to this definition">¶</a></dt>
  432. <dd><p>Install architecture-independent files in PREFIX. On Unix, it
  433. defaults to <code class="file docutils literal notranslate"><span class="pre">/usr/local</span></code>.</p>
  434. <p>This value can be retrieved at runtime using <a class="reference internal" href="../library/sys.html#sys.prefix" title="sys.prefix"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.prefix</span></code></a>.</p>
  435. <p>As an example, one can use <code class="docutils literal notranslate"><span class="pre">--prefix=&quot;$HOME/.local/&quot;</span></code> to install
  436. a Python in its home directory.</p>
  437. </dd></dl>
  438. <dl class="std cmdoption">
  439. <dt class="sig sig-object std" id="cmdoption-exec-prefix">
  440. <span class="sig-name descname"><span class="pre">--exec-prefix</span></span><span class="sig-prename descclassname"><span class="pre">=EPREFIX</span></span><a class="headerlink" href="#cmdoption-exec-prefix" title="Permalink to this definition">¶</a></dt>
  441. <dd><p>Install architecture-dependent files in EPREFIX, defaults to <a class="reference internal" href="#cmdoption-prefix"><code class="xref std std-option docutils literal notranslate"><span class="pre">--prefix</span></code></a>.</p>
  442. <p>This value can be retrieved at runtime using <a class="reference internal" href="../library/sys.html#sys.exec_prefix" title="sys.exec_prefix"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.exec_prefix</span></code></a>.</p>
  443. </dd></dl>
  444. <dl class="std cmdoption">
  445. <dt class="sig sig-object std" id="cmdoption-disable-test-modules">
  446. <span class="sig-name descname"><span class="pre">--disable-test-modules</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-disable-test-modules" title="Permalink to this definition">¶</a></dt>
  447. <dd><p>Don’t build nor install test modules, like the <a class="reference internal" href="../library/test.html#module-test" title="test: Regression tests package containing the testing suite for Python."><code class="xref py py-mod docutils literal notranslate"><span class="pre">test</span></code></a> package or the
  448. <code class="xref py py-mod docutils literal notranslate"><span class="pre">_testcapi</span></code> extension module (built and installed by default).</p>
  449. <div class="versionadded">
  450. <p><span class="versionmodified added">New in version 3.10.</span></p>
  451. </div>
  452. </dd></dl>
  453. <dl class="std cmdoption">
  454. <dt class="sig sig-object std" id="cmdoption-with-ensurepip">
  455. <span class="sig-name descname"><span class="pre">--with-ensurepip</span></span><span class="sig-prename descclassname"><span class="pre">=[upgrade|install|no]</span></span><a class="headerlink" href="#cmdoption-with-ensurepip" title="Permalink to this definition">¶</a></dt>
  456. <dd><p>Select the <a class="reference internal" href="../library/ensurepip.html#module-ensurepip" title="ensurepip: Bootstrapping the &quot;pip&quot; installer into an existing Python installation or virtual environment."><code class="xref py py-mod docutils literal notranslate"><span class="pre">ensurepip</span></code></a> command run on Python installation:</p>
  457. <ul class="simple">
  458. <li><p><code class="docutils literal notranslate"><span class="pre">upgrade</span></code> (default): run <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">ensurepip</span> <span class="pre">--altinstall</span> <span class="pre">--upgrade</span></code>
  459. command.</p></li>
  460. <li><p><code class="docutils literal notranslate"><span class="pre">install</span></code>: run <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">ensurepip</span> <span class="pre">--altinstall</span></code> command;</p></li>
  461. <li><p><code class="docutils literal notranslate"><span class="pre">no</span></code>: don’t run ensurepip;</p></li>
  462. </ul>
  463. <div class="versionadded">
  464. <p><span class="versionmodified added">New in version 3.6.</span></p>
  465. </div>
  466. </dd></dl>
  467. </section>
  468. <section id="performance-options">
  469. <h3><span class="section-number">3.3.4. </span>Performance options<a class="headerlink" href="#performance-options" title="Permalink to this headline">¶</a></h3>
  470. <p>Configuring Python using <code class="docutils literal notranslate"><span class="pre">--enable-optimizations</span> <span class="pre">--with-lto</span></code> (PGO + LTO) is
  471. recommended for best performance. The experimental <code class="docutils literal notranslate"><span class="pre">--enable-bolt</span></code> flag can
  472. also be used to improve performance.</p>
  473. <dl class="std cmdoption">
  474. <dt class="sig sig-object std" id="cmdoption-enable-optimizations">
  475. <span class="sig-name descname"><span class="pre">--enable-optimizations</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-enable-optimizations" title="Permalink to this definition">¶</a></dt>
  476. <dd><p>Enable Profile Guided Optimization (PGO) using <span class="target" id="index-4"></span><a class="reference internal" href="#envvar-PROFILE_TASK"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PROFILE_TASK</span></code></a>
  477. (disabled by default).</p>
  478. <p>The C compiler Clang requires <code class="docutils literal notranslate"><span class="pre">llvm-profdata</span></code> program for PGO. On
  479. macOS, GCC also requires it: GCC is just an alias to Clang on macOS.</p>
  480. <p>Disable also semantic interposition in libpython if <code class="docutils literal notranslate"><span class="pre">--enable-shared</span></code> and
  481. GCC is used: add <code class="docutils literal notranslate"><span class="pre">-fno-semantic-interposition</span></code> to the compiler and linker
  482. flags.</p>
  483. <div class="versionadded">
  484. <p><span class="versionmodified added">New in version 3.6.</span></p>
  485. </div>
  486. <div class="versionchanged">
  487. <p><span class="versionmodified changed">Changed in version 3.10: </span>Use <code class="docutils literal notranslate"><span class="pre">-fno-semantic-interposition</span></code> on GCC.</p>
  488. </div>
  489. </dd></dl>
  490. <dl class="std envvar">
  491. <dt class="sig sig-object std" id="envvar-PROFILE_TASK">
  492. <span class="sig-name descname"><span class="pre">PROFILE_TASK</span></span><a class="headerlink" href="#envvar-PROFILE_TASK" title="Permalink to this definition">¶</a></dt>
  493. <dd><p>Environment variable used in the Makefile: Python command line arguments for
  494. the PGO generation task.</p>
  495. <p>Default: <code class="docutils literal notranslate"><span class="pre">-m</span> <span class="pre">test</span> <span class="pre">--pgo</span> <span class="pre">--timeout=$(TESTTIMEOUT)</span></code>.</p>
  496. <div class="versionadded">
  497. <p><span class="versionmodified added">New in version 3.8.</span></p>
  498. </div>
  499. </dd></dl>
  500. <dl class="std cmdoption">
  501. <dt class="sig sig-object std" id="cmdoption-with-lto">
  502. <span class="sig-name descname"><span class="pre">--with-lto</span></span><span class="sig-prename descclassname"><span class="pre">=[full|thin|no|yes]</span></span><a class="headerlink" href="#cmdoption-with-lto" title="Permalink to this definition">¶</a></dt>
  503. <dd><p>Enable Link Time Optimization (LTO) in any build (disabled by default).</p>
  504. <p>The C compiler Clang requires <code class="docutils literal notranslate"><span class="pre">llvm-ar</span></code> for LTO (<code class="docutils literal notranslate"><span class="pre">ar</span></code> on macOS), as well
  505. as an LTO-aware linker (<code class="docutils literal notranslate"><span class="pre">ld.gold</span></code> or <code class="docutils literal notranslate"><span class="pre">lld</span></code>).</p>
  506. <div class="versionadded">
  507. <p><span class="versionmodified added">New in version 3.6.</span></p>
  508. </div>
  509. <div class="versionadded">
  510. <p><span class="versionmodified added">New in version 3.11: </span>To use ThinLTO feature, use <code class="docutils literal notranslate"><span class="pre">--with-lto=thin</span></code> on Clang.</p>
  511. </div>
  512. <div class="versionchanged">
  513. <p><span class="versionmodified changed">Changed in version 3.12: </span>Use ThinLTO as the default optimization policy on Clang if the compiler accepts the flag.</p>
  514. </div>
  515. </dd></dl>
  516. <dl class="std cmdoption">
  517. <dt class="sig sig-object std" id="cmdoption-enable-bolt">
  518. <span class="sig-name descname"><span class="pre">--enable-bolt</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-enable-bolt" title="Permalink to this definition">¶</a></dt>
  519. <dd><p>Enable usage of the <a class="reference external" href="https://github.com/llvm/llvm-project/tree/main/bolt">BOLT post-link binary optimizer</a> (disabled by
  520. default).</p>
  521. <p>BOLT is part of the LLVM project but is not always included in their binary
  522. distributions. This flag requires that <code class="docutils literal notranslate"><span class="pre">llvm-bolt</span></code> and <code class="docutils literal notranslate"><span class="pre">merge-fdata</span></code>
  523. are available.</p>
  524. <p>BOLT is still a fairly new project so this flag should be considered
  525. experimental for now. Because this tool operates on machine code its success
  526. is dependent on a combination of the build environment + the other
  527. optimization configure args + the CPU architecture, and not all combinations
  528. are supported.
  529. BOLT versions before LLVM 16 are known to crash BOLT under some scenarios.
  530. Use of LLVM 16 or newer for BOLT optimization is strongly encouraged.</p>
  531. <p>The <code class="xref std std-envvar docutils literal notranslate"><span class="pre">BOLT_INSTRUMENT_FLAGS</span></code> and <code class="xref std std-envvar docutils literal notranslate"><span class="pre">BOLT_APPLY_FLAGS</span></code>
  532. <strong class="program">configure</strong> variables can be defined to override the default set of
  533. arguments for <strong class="program">llvm-bolt</strong> to instrument and apply BOLT data to
  534. binaries, respectively.</p>
  535. <div class="versionadded">
  536. <p><span class="versionmodified added">New in version 3.12.</span></p>
  537. </div>
  538. </dd></dl>
  539. <dl class="std cmdoption">
  540. <dt class="sig sig-object std" id="cmdoption-with-computed-gotos">
  541. <span class="sig-name descname"><span class="pre">--with-computed-gotos</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-with-computed-gotos" title="Permalink to this definition">¶</a></dt>
  542. <dd><p>Enable computed gotos in evaluation loop (enabled by default on supported
  543. compilers).</p>
  544. </dd></dl>
  545. <dl class="std cmdoption">
  546. <dt class="sig sig-object std" id="cmdoption-without-pymalloc">
  547. <span class="sig-name descname"><span class="pre">--without-pymalloc</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-without-pymalloc" title="Permalink to this definition">¶</a></dt>
  548. <dd><p>Disable the specialized Python memory allocator <a class="reference internal" href="../c-api/memory.html#pymalloc"><span class="std std-ref">pymalloc</span></a>
  549. (enabled by default).</p>
  550. <p>See also <span class="target" id="index-5"></span><a class="reference internal" href="cmdline.html#envvar-PYTHONMALLOC"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONMALLOC</span></code></a> environment variable.</p>
  551. </dd></dl>
  552. <dl class="std cmdoption">
  553. <dt class="sig sig-object std" id="cmdoption-without-doc-strings">
  554. <span class="sig-name descname"><span class="pre">--without-doc-strings</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-without-doc-strings" title="Permalink to this definition">¶</a></dt>
  555. <dd><p>Disable static documentation strings to reduce the memory footprint (enabled
  556. by default). Documentation strings defined in Python are not affected.</p>
  557. <p>Don’t define the <code class="docutils literal notranslate"><span class="pre">WITH_DOC_STRINGS</span></code> macro.</p>
  558. <p>See the <code class="docutils literal notranslate"><span class="pre">PyDoc_STRVAR()</span></code> macro.</p>
  559. </dd></dl>
  560. <dl class="std cmdoption">
  561. <dt class="sig sig-object std" id="cmdoption-enable-profiling">
  562. <span class="sig-name descname"><span class="pre">--enable-profiling</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-enable-profiling" title="Permalink to this definition">¶</a></dt>
  563. <dd><p>Enable C-level code profiling with <code class="docutils literal notranslate"><span class="pre">gprof</span></code> (disabled by default).</p>
  564. </dd></dl>
  565. <dl class="std cmdoption">
  566. <dt class="sig sig-object std" id="cmdoption-with-strict-overflow">
  567. <span class="sig-name descname"><span class="pre">--with-strict-overflow</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-with-strict-overflow" title="Permalink to this definition">¶</a></dt>
  568. <dd><p>Add <code class="docutils literal notranslate"><span class="pre">-fstrict-overflow</span></code> to the C compiler flags (by default we add
  569. <code class="docutils literal notranslate"><span class="pre">-fno-strict-overflow</span></code> instead).</p>
  570. </dd></dl>
  571. </section>
  572. <section id="python-debug-build">
  573. <span id="debug-build"></span><h3><span class="section-number">3.3.5. </span>Python Debug Build<a class="headerlink" href="#python-debug-build" title="Permalink to this headline">¶</a></h3>
  574. <p>A debug build is Python built with the <a class="reference internal" href="#cmdoption-with-pydebug"><code class="xref std std-option docutils literal notranslate"><span class="pre">--with-pydebug</span></code></a> configure
  575. option.</p>
  576. <p>Effects of a debug build:</p>
  577. <ul class="simple">
  578. <li><p>Display all warnings by default: the list of default warning filters is empty
  579. in the <a class="reference internal" href="../library/warnings.html#module-warnings" title="warnings: Issue warning messages and control their disposition."><code class="xref py py-mod docutils literal notranslate"><span class="pre">warnings</span></code></a> module.</p></li>
  580. <li><p>Add <code class="docutils literal notranslate"><span class="pre">d</span></code> to <a class="reference internal" href="../library/sys.html#sys.abiflags" title="sys.abiflags"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.abiflags</span></code></a>.</p></li>
  581. <li><p>Add <code class="xref py py-func docutils literal notranslate"><span class="pre">sys.gettotalrefcount()</span></code> function.</p></li>
  582. <li><p>Add <a class="reference internal" href="cmdline.html#cmdoption-X"><code class="xref std std-option docutils literal notranslate"><span class="pre">-X</span> <span class="pre">showrefcount</span></code></a> command line option.</p></li>
  583. <li><p>Add <a class="reference internal" href="cmdline.html#cmdoption-d"><code class="xref std std-option docutils literal notranslate"><span class="pre">-d</span></code></a> command line option and <span class="target" id="index-6"></span><a class="reference internal" href="cmdline.html#envvar-PYTHONDEBUG"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONDEBUG</span></code></a> environment
  584. variable to debug the parser.</p></li>
  585. <li><p>Add support for the <code class="docutils literal notranslate"><span class="pre">__lltrace__</span></code> variable: enable low-level tracing in the
  586. bytecode evaluation loop if the variable is defined.</p></li>
  587. <li><p>Install <a class="reference internal" href="../c-api/memory.html#default-memory-allocators"><span class="std std-ref">debug hooks on memory allocators</span></a>
  588. to detect buffer overflow and other memory errors.</p></li>
  589. <li><p>Define <code class="docutils literal notranslate"><span class="pre">Py_DEBUG</span></code> and <code class="docutils literal notranslate"><span class="pre">Py_REF_DEBUG</span></code> macros.</p></li>
  590. <li><p>Add runtime checks: code surrounded by <code class="docutils literal notranslate"><span class="pre">#ifdef</span> <span class="pre">Py_DEBUG</span></code> and <code class="docutils literal notranslate"><span class="pre">#endif</span></code>.
  591. Enable <code class="docutils literal notranslate"><span class="pre">assert(...)</span></code> and <code class="docutils literal notranslate"><span class="pre">_PyObject_ASSERT(...)</span></code> assertions: don’t set
  592. the <code class="docutils literal notranslate"><span class="pre">NDEBUG</span></code> macro (see also the <a class="reference internal" href="#cmdoption-with-assertions"><code class="xref std std-option docutils literal notranslate"><span class="pre">--with-assertions</span></code></a> configure
  593. option). Main runtime checks:</p>
  594. <ul>
  595. <li><p>Add sanity checks on the function arguments.</p></li>
  596. <li><p>Unicode and int objects are created with their memory filled with a pattern
  597. to detect usage of uninitialized objects.</p></li>
  598. <li><p>Ensure that functions which can clear or replace the current exception are
  599. not called with an exception raised.</p></li>
  600. <li><p>Check that deallocator functions don’t change the current exception.</p></li>
  601. <li><p>The garbage collector (<a class="reference internal" href="../library/gc.html#gc.collect" title="gc.collect"><code class="xref py py-func docutils literal notranslate"><span class="pre">gc.collect()</span></code></a> function) runs some basic checks
  602. on objects consistency.</p></li>
  603. <li><p>The <code class="xref c c-macro docutils literal notranslate"><span class="pre">Py_SAFE_DOWNCAST()</span></code> macro checks for integer underflow and
  604. overflow when downcasting from wide types to narrow types.</p></li>
  605. </ul>
  606. </li>
  607. </ul>
  608. <p>See also the <a class="reference internal" href="../library/devmode.html#devmode"><span class="std std-ref">Python Development Mode</span></a> and the
  609. <a class="reference internal" href="#cmdoption-with-trace-refs"><code class="xref std std-option docutils literal notranslate"><span class="pre">--with-trace-refs</span></code></a> configure option.</p>
  610. <div class="versionchanged">
  611. <p><span class="versionmodified changed">Changed in version 3.8: </span>Release builds and debug builds are now ABI compatible: defining the
  612. <code class="docutils literal notranslate"><span class="pre">Py_DEBUG</span></code> macro no longer implies the <code class="docutils literal notranslate"><span class="pre">Py_TRACE_REFS</span></code> macro (see the
  613. <a class="reference internal" href="#cmdoption-with-trace-refs"><code class="xref std std-option docutils literal notranslate"><span class="pre">--with-trace-refs</span></code></a> option), which introduces the only ABI
  614. incompatibility.</p>
  615. </div>
  616. </section>
  617. <section id="debug-options">
  618. <h3><span class="section-number">3.3.6. </span>Debug options<a class="headerlink" href="#debug-options" title="Permalink to this headline">¶</a></h3>
  619. <dl class="std cmdoption">
  620. <dt class="sig sig-object std" id="cmdoption-with-pydebug">
  621. <span class="sig-name descname"><span class="pre">--with-pydebug</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-with-pydebug" title="Permalink to this definition">¶</a></dt>
  622. <dd><p><a class="reference internal" href="#debug-build"><span class="std std-ref">Build Python in debug mode</span></a>: define the <code class="docutils literal notranslate"><span class="pre">Py_DEBUG</span></code>
  623. macro (disabled by default).</p>
  624. </dd></dl>
  625. <dl class="std cmdoption">
  626. <dt class="sig sig-object std" id="cmdoption-with-trace-refs">
  627. <span class="sig-name descname"><span class="pre">--with-trace-refs</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-with-trace-refs" title="Permalink to this definition">¶</a></dt>
  628. <dd><p>Enable tracing references for debugging purpose (disabled by default).</p>
  629. <p>Effects:</p>
  630. <ul class="simple">
  631. <li><p>Define the <code class="docutils literal notranslate"><span class="pre">Py_TRACE_REFS</span></code> macro.</p></li>
  632. <li><p>Add <code class="xref py py-func docutils literal notranslate"><span class="pre">sys.getobjects()</span></code> function.</p></li>
  633. <li><p>Add <span class="target" id="index-7"></span><a class="reference internal" href="cmdline.html#envvar-PYTHONDUMPREFS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONDUMPREFS</span></code></a> environment variable.</p></li>
  634. </ul>
  635. <p>This build is not ABI compatible with release build (default build) or debug
  636. build (<code class="docutils literal notranslate"><span class="pre">Py_DEBUG</span></code> and <code class="docutils literal notranslate"><span class="pre">Py_REF_DEBUG</span></code> macros).</p>
  637. <div class="versionadded">
  638. <p><span class="versionmodified added">New in version 3.8.</span></p>
  639. </div>
  640. </dd></dl>
  641. <dl class="std cmdoption">
  642. <dt class="sig sig-object std" id="cmdoption-with-assertions">
  643. <span class="sig-name descname"><span class="pre">--with-assertions</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-with-assertions" title="Permalink to this definition">¶</a></dt>
  644. <dd><p>Build with C assertions enabled (default is no): <code class="docutils literal notranslate"><span class="pre">assert(...);</span></code> and
  645. <code class="docutils literal notranslate"><span class="pre">_PyObject_ASSERT(...);</span></code>.</p>
  646. <p>If set, the <code class="docutils literal notranslate"><span class="pre">NDEBUG</span></code> macro is not defined in the <span class="target" id="index-8"></span><a class="reference internal" href="#envvar-OPT"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">OPT</span></code></a> compiler
  647. variable.</p>
  648. <p>See also the <a class="reference internal" href="#cmdoption-with-pydebug"><code class="xref std std-option docutils literal notranslate"><span class="pre">--with-pydebug</span></code></a> option (<a class="reference internal" href="#debug-build"><span class="std std-ref">debug build</span></a>) which also enables assertions.</p>
  649. <div class="versionadded">
  650. <p><span class="versionmodified added">New in version 3.6.</span></p>
  651. </div>
  652. </dd></dl>
  653. <dl class="std cmdoption">
  654. <dt class="sig sig-object std" id="cmdoption-with-valgrind">
  655. <span class="sig-name descname"><span class="pre">--with-valgrind</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-with-valgrind" title="Permalink to this definition">¶</a></dt>
  656. <dd><p>Enable Valgrind support (default is no).</p>
  657. </dd></dl>
  658. <dl class="std cmdoption">
  659. <dt class="sig sig-object std" id="cmdoption-with-dtrace">
  660. <span class="sig-name descname"><span class="pre">--with-dtrace</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-with-dtrace" title="Permalink to this definition">¶</a></dt>
  661. <dd><p>Enable DTrace support (default is no).</p>
  662. <p>See <a class="reference internal" href="../howto/instrumentation.html#instrumentation"><span class="std std-ref">Instrumenting CPython with DTrace and SystemTap</span></a>.</p>
  663. <div class="versionadded">
  664. <p><span class="versionmodified added">New in version 3.6.</span></p>
  665. </div>
  666. </dd></dl>
  667. <dl class="std cmdoption">
  668. <dt class="sig sig-object std" id="cmdoption-with-address-sanitizer">
  669. <span class="sig-name descname"><span class="pre">--with-address-sanitizer</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-with-address-sanitizer" title="Permalink to this definition">¶</a></dt>
  670. <dd><p>Enable AddressSanitizer memory error detector, <code class="docutils literal notranslate"><span class="pre">asan</span></code> (default is no).</p>
  671. <div class="versionadded">
  672. <p><span class="versionmodified added">New in version 3.6.</span></p>
  673. </div>
  674. </dd></dl>
  675. <dl class="std cmdoption">
  676. <dt class="sig sig-object std" id="cmdoption-with-memory-sanitizer">
  677. <span class="sig-name descname"><span class="pre">--with-memory-sanitizer</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-with-memory-sanitizer" title="Permalink to this definition">¶</a></dt>
  678. <dd><p>Enable MemorySanitizer allocation error detector, <code class="docutils literal notranslate"><span class="pre">msan</span></code> (default is no).</p>
  679. <div class="versionadded">
  680. <p><span class="versionmodified added">New in version 3.6.</span></p>
  681. </div>
  682. </dd></dl>
  683. <dl class="std cmdoption">
  684. <dt class="sig sig-object std" id="cmdoption-with-undefined-behavior-sanitizer">
  685. <span class="sig-name descname"><span class="pre">--with-undefined-behavior-sanitizer</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-with-undefined-behavior-sanitizer" title="Permalink to this definition">¶</a></dt>
  686. <dd><p>Enable UndefinedBehaviorSanitizer undefined behaviour detector, <code class="docutils literal notranslate"><span class="pre">ubsan</span></code>
  687. (default is no).</p>
  688. <div class="versionadded">
  689. <p><span class="versionmodified added">New in version 3.6.</span></p>
  690. </div>
  691. </dd></dl>
  692. </section>
  693. <section id="linker-options">
  694. <h3><span class="section-number">3.3.7. </span>Linker options<a class="headerlink" href="#linker-options" title="Permalink to this headline">¶</a></h3>
  695. <dl class="std cmdoption">
  696. <dt class="sig sig-object std" id="cmdoption-enable-shared">
  697. <span class="sig-name descname"><span class="pre">--enable-shared</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-enable-shared" title="Permalink to this definition">¶</a></dt>
  698. <dd><p>Enable building a shared Python library: <code class="docutils literal notranslate"><span class="pre">libpython</span></code> (default is no).</p>
  699. </dd></dl>
  700. <dl class="std cmdoption">
  701. <dt class="sig sig-object std" id="cmdoption-without-static-libpython">
  702. <span class="sig-name descname"><span class="pre">--without-static-libpython</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-without-static-libpython" title="Permalink to this definition">¶</a></dt>
  703. <dd><p>Do not build <code class="docutils literal notranslate"><span class="pre">libpythonMAJOR.MINOR.a</span></code> and do not install <code class="docutils literal notranslate"><span class="pre">python.o</span></code>
  704. (built and enabled by default).</p>
  705. <div class="versionadded">
  706. <p><span class="versionmodified added">New in version 3.10.</span></p>
  707. </div>
  708. </dd></dl>
  709. </section>
  710. <section id="libraries-options">
  711. <h3><span class="section-number">3.3.8. </span>Libraries options<a class="headerlink" href="#libraries-options" title="Permalink to this headline">¶</a></h3>
  712. <dl class="std cmdoption">
  713. <dt class="sig sig-object std" id="cmdoption-with-libs">
  714. <span class="sig-name descname"><span class="pre">--with-libs</span></span><span class="sig-prename descclassname"><span class="pre">='lib1</span> <span class="pre">...'</span></span><a class="headerlink" href="#cmdoption-with-libs" title="Permalink to this definition">¶</a></dt>
  715. <dd><p>Link against additional libraries (default is no).</p>
  716. </dd></dl>
  717. <dl class="std cmdoption">
  718. <dt class="sig sig-object std" id="cmdoption-with-system-expat">
  719. <span class="sig-name descname"><span class="pre">--with-system-expat</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-with-system-expat" title="Permalink to this definition">¶</a></dt>
  720. <dd><p>Build the <code class="xref py py-mod docutils literal notranslate"><span class="pre">pyexpat</span></code> module using an installed <code class="docutils literal notranslate"><span class="pre">expat</span></code> library
  721. (default is no).</p>
  722. </dd></dl>
  723. <dl class="std cmdoption">
  724. <dt class="sig sig-object std" id="cmdoption-with-system-libmpdec">
  725. <span class="sig-name descname"><span class="pre">--with-system-libmpdec</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-with-system-libmpdec" title="Permalink to this definition">¶</a></dt>
  726. <dd><p>Build the <code class="docutils literal notranslate"><span class="pre">_decimal</span></code> extension module using an installed <code class="docutils literal notranslate"><span class="pre">mpdec</span></code>
  727. library, see the <a class="reference internal" href="../library/decimal.html#module-decimal" title="decimal: Implementation of the General Decimal Arithmetic Specification."><code class="xref py py-mod docutils literal notranslate"><span class="pre">decimal</span></code></a> module (default is no).</p>
  728. <div class="versionadded">
  729. <p><span class="versionmodified added">New in version 3.3.</span></p>
  730. </div>
  731. </dd></dl>
  732. <dl class="std cmdoption">
  733. <dt class="sig sig-object std" id="cmdoption-with-readline">
  734. <span class="sig-name descname"><span class="pre">--with-readline</span></span><span class="sig-prename descclassname"><span class="pre">=editline</span></span><a class="headerlink" href="#cmdoption-with-readline" title="Permalink to this definition">¶</a></dt>
  735. <dd><p>Use <code class="docutils literal notranslate"><span class="pre">editline</span></code> library for backend of the <a class="reference internal" href="../library/readline.html#module-readline" title="readline: GNU readline support for Python. (Unix)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">readline</span></code></a> module.</p>
  736. <p>Define the <code class="docutils literal notranslate"><span class="pre">WITH_EDITLINE</span></code> macro.</p>
  737. <div class="versionadded">
  738. <p><span class="versionmodified added">New in version 3.10.</span></p>
  739. </div>
  740. </dd></dl>
  741. <dl class="std cmdoption">
  742. <dt class="sig sig-object std" id="cmdoption-without-readline">
  743. <span class="sig-name descname"><span class="pre">--without-readline</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-without-readline" title="Permalink to this definition">¶</a></dt>
  744. <dd><p>Don’t build the <a class="reference internal" href="../library/readline.html#module-readline" title="readline: GNU readline support for Python. (Unix)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">readline</span></code></a> module (built by default).</p>
  745. <p>Don’t define the <code class="docutils literal notranslate"><span class="pre">HAVE_LIBREADLINE</span></code> macro.</p>
  746. <div class="versionadded">
  747. <p><span class="versionmodified added">New in version 3.10.</span></p>
  748. </div>
  749. </dd></dl>
  750. <dl class="std cmdoption">
  751. <dt class="sig sig-object std" id="cmdoption-with-libm">
  752. <span class="sig-name descname"><span class="pre">--with-libm</span></span><span class="sig-prename descclassname"><span class="pre">=STRING</span></span><a class="headerlink" href="#cmdoption-with-libm" title="Permalink to this definition">¶</a></dt>
  753. <dd><p>Override <code class="docutils literal notranslate"><span class="pre">libm</span></code> math library to <em>STRING</em> (default is system-dependent).</p>
  754. </dd></dl>
  755. <dl class="std cmdoption">
  756. <dt class="sig sig-object std" id="cmdoption-with-libc">
  757. <span class="sig-name descname"><span class="pre">--with-libc</span></span><span class="sig-prename descclassname"><span class="pre">=STRING</span></span><a class="headerlink" href="#cmdoption-with-libc" title="Permalink to this definition">¶</a></dt>
  758. <dd><p>Override <code class="docutils literal notranslate"><span class="pre">libc</span></code> C library to <em>STRING</em> (default is system-dependent).</p>
  759. </dd></dl>
  760. <dl class="std cmdoption">
  761. <dt class="sig sig-object std" id="cmdoption-with-openssl">
  762. <span class="sig-name descname"><span class="pre">--with-openssl</span></span><span class="sig-prename descclassname"><span class="pre">=DIR</span></span><a class="headerlink" href="#cmdoption-with-openssl" title="Permalink to this definition">¶</a></dt>
  763. <dd><p>Root of the OpenSSL directory.</p>
  764. <div class="versionadded">
  765. <p><span class="versionmodified added">New in version 3.7.</span></p>
  766. </div>
  767. </dd></dl>
  768. <dl class="std cmdoption">
  769. <dt class="sig sig-object std" id="cmdoption-with-openssl-rpath">
  770. <span class="sig-name descname"><span class="pre">--with-openssl-rpath</span></span><span class="sig-prename descclassname"><span class="pre">=[no|auto|DIR]</span></span><a class="headerlink" href="#cmdoption-with-openssl-rpath" title="Permalink to this definition">¶</a></dt>
  771. <dd><p>Set runtime library directory (rpath) for OpenSSL libraries:</p>
  772. <ul class="simple">
  773. <li><p><code class="docutils literal notranslate"><span class="pre">no</span></code> (default): don’t set rpath;</p></li>
  774. <li><p><code class="docutils literal notranslate"><span class="pre">auto</span></code>: auto-detect rpath from <a class="reference internal" href="#cmdoption-with-openssl"><code class="xref std std-option docutils literal notranslate"><span class="pre">--with-openssl</span></code></a> and
  775. <code class="docutils literal notranslate"><span class="pre">pkg-config</span></code>;</p></li>
  776. <li><p><em>DIR</em>: set an explicit rpath.</p></li>
  777. </ul>
  778. <div class="versionadded">
  779. <p><span class="versionmodified added">New in version 3.10.</span></p>
  780. </div>
  781. </dd></dl>
  782. </section>
  783. <section id="security-options">
  784. <h3><span class="section-number">3.3.9. </span>Security Options<a class="headerlink" href="#security-options" title="Permalink to this headline">¶</a></h3>
  785. <dl class="std cmdoption">
  786. <dt class="sig sig-object std" id="cmdoption-with-hash-algorithm">
  787. <span class="sig-name descname"><span class="pre">--with-hash-algorithm</span></span><span class="sig-prename descclassname"><span class="pre">=[fnv|siphash13|siphash24]</span></span><a class="headerlink" href="#cmdoption-with-hash-algorithm" title="Permalink to this definition">¶</a></dt>
  788. <dd><p>Select hash algorithm for use in <code class="docutils literal notranslate"><span class="pre">Python/pyhash.c</span></code>:</p>
  789. <ul class="simple">
  790. <li><p><code class="docutils literal notranslate"><span class="pre">siphash13</span></code> (default);</p></li>
  791. <li><p><code class="docutils literal notranslate"><span class="pre">siphash24</span></code>;</p></li>
  792. <li><p><code class="docutils literal notranslate"><span class="pre">fnv</span></code>.</p></li>
  793. </ul>
  794. <div class="versionadded">
  795. <p><span class="versionmodified added">New in version 3.4.</span></p>
  796. </div>
  797. <div class="versionadded">
  798. <p><span class="versionmodified added">New in version 3.11: </span><code class="docutils literal notranslate"><span class="pre">siphash13</span></code> is added and it is the new default.</p>
  799. </div>
  800. </dd></dl>
  801. <dl class="std cmdoption">
  802. <dt class="sig sig-object std" id="cmdoption-with-builtin-hashlib-hashes">
  803. <span class="sig-name descname"><span class="pre">--with-builtin-hashlib-hashes</span></span><span class="sig-prename descclassname"><span class="pre">=md5,sha1,sha256,sha512,sha3,blake2</span></span><a class="headerlink" href="#cmdoption-with-builtin-hashlib-hashes" title="Permalink to this definition">¶</a></dt>
  804. <dd><p>Built-in hash modules:</p>
  805. <ul class="simple">
  806. <li><p><code class="docutils literal notranslate"><span class="pre">md5</span></code>;</p></li>
  807. <li><p><code class="docutils literal notranslate"><span class="pre">sha1</span></code>;</p></li>
  808. <li><p><code class="docutils literal notranslate"><span class="pre">sha256</span></code>;</p></li>
  809. <li><p><code class="docutils literal notranslate"><span class="pre">sha512</span></code>;</p></li>
  810. <li><p><code class="docutils literal notranslate"><span class="pre">sha3</span></code> (with shake);</p></li>
  811. <li><p><code class="docutils literal notranslate"><span class="pre">blake2</span></code>.</p></li>
  812. </ul>
  813. <div class="versionadded">
  814. <p><span class="versionmodified added">New in version 3.9.</span></p>
  815. </div>
  816. </dd></dl>
  817. <dl class="std cmdoption">
  818. <dt class="sig sig-object std" id="cmdoption-with-ssl-default-suites">
  819. <span class="sig-name descname"><span class="pre">--with-ssl-default-suites</span></span><span class="sig-prename descclassname"><span class="pre">=[python|openssl|STRING]</span></span><a class="headerlink" href="#cmdoption-with-ssl-default-suites" title="Permalink to this definition">¶</a></dt>
  820. <dd><p>Override the OpenSSL default cipher suites string:</p>
  821. <ul class="simple">
  822. <li><p><code class="docutils literal notranslate"><span class="pre">python</span></code> (default): use Python’s preferred selection;</p></li>
  823. <li><p><code class="docutils literal notranslate"><span class="pre">openssl</span></code>: leave OpenSSL’s defaults untouched;</p></li>
  824. <li><p><em>STRING</em>: use a custom string</p></li>
  825. </ul>
  826. <p>See the <a class="reference internal" href="../library/ssl.html#module-ssl" title="ssl: TLS/SSL wrapper for socket objects"><code class="xref py py-mod docutils literal notranslate"><span class="pre">ssl</span></code></a> module.</p>
  827. <div class="versionadded">
  828. <p><span class="versionmodified added">New in version 3.7.</span></p>
  829. </div>
  830. <div class="versionchanged">
  831. <p><span class="versionmodified changed">Changed in version 3.10: </span>The settings <code class="docutils literal notranslate"><span class="pre">python</span></code> and <em>STRING</em> also set TLS 1.2 as minimum
  832. protocol version.</p>
  833. </div>
  834. </dd></dl>
  835. </section>
  836. <section id="macos-options">
  837. <h3><span class="section-number">3.3.10. </span>macOS Options<a class="headerlink" href="#macos-options" title="Permalink to this headline">¶</a></h3>
  838. <p>See <code class="docutils literal notranslate"><span class="pre">Mac/README.rst</span></code>.</p>
  839. <dl class="std cmdoption">
  840. <dt class="sig sig-object std" id="cmdoption-enable-universalsdk">
  841. <span class="sig-name descname"><span class="pre">--enable-universalsdk</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-enable-universalsdk" title="Permalink to this definition">¶</a></dt>
  842. <dd></dd></dl>
  843. <dl class="std cmdoption">
  844. <dt class="sig sig-object std" id="cmdoption-0">
  845. <span class="sig-name descname"><span class="pre">--enable-universalsdk</span></span><span class="sig-prename descclassname"><span class="pre">=SDKDIR</span></span><a class="headerlink" href="#cmdoption-0" title="Permalink to this definition">¶</a></dt>
  846. <dd><p>Create a universal binary build. <em>SDKDIR</em> specifies which macOS SDK should
  847. be used to perform the build (default is no).</p>
  848. </dd></dl>
  849. <dl class="std cmdoption">
  850. <dt class="sig sig-object std" id="cmdoption-enable-framework">
  851. <span class="sig-name descname"><span class="pre">--enable-framework</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-enable-framework" title="Permalink to this definition">¶</a></dt>
  852. <dd></dd></dl>
  853. <dl class="std cmdoption">
  854. <dt class="sig sig-object std" id="cmdoption-1">
  855. <span class="sig-name descname"><span class="pre">--enable-framework</span></span><span class="sig-prename descclassname"><span class="pre">=INSTALLDIR</span></span><a class="headerlink" href="#cmdoption-1" title="Permalink to this definition">¶</a></dt>
  856. <dd><p>Create a Python.framework rather than a traditional Unix install. Optional
  857. <em>INSTALLDIR</em> specifies the installation path (default is no).</p>
  858. </dd></dl>
  859. <dl class="std cmdoption">
  860. <dt class="sig sig-object std" id="cmdoption-with-universal-archs">
  861. <span class="sig-name descname"><span class="pre">--with-universal-archs</span></span><span class="sig-prename descclassname"><span class="pre">=ARCH</span></span><a class="headerlink" href="#cmdoption-with-universal-archs" title="Permalink to this definition">¶</a></dt>
  862. <dd><p>Specify the kind of universal binary that should be created. This option is
  863. only valid when <a class="reference internal" href="#cmdoption-0"><code class="xref std std-option docutils literal notranslate"><span class="pre">--enable-universalsdk</span></code></a> is set.</p>
  864. <p>Options:</p>
  865. <ul class="simple">
  866. <li><p><code class="docutils literal notranslate"><span class="pre">universal2</span></code>;</p></li>
  867. <li><p><code class="docutils literal notranslate"><span class="pre">32-bit</span></code>;</p></li>
  868. <li><p><code class="docutils literal notranslate"><span class="pre">64-bit</span></code>;</p></li>
  869. <li><p><code class="docutils literal notranslate"><span class="pre">3-way</span></code>;</p></li>
  870. <li><p><code class="docutils literal notranslate"><span class="pre">intel</span></code>;</p></li>
  871. <li><p><code class="docutils literal notranslate"><span class="pre">intel-32</span></code>;</p></li>
  872. <li><p><code class="docutils literal notranslate"><span class="pre">intel-64</span></code>;</p></li>
  873. <li><p><code class="docutils literal notranslate"><span class="pre">all</span></code>.</p></li>
  874. </ul>
  875. </dd></dl>
  876. <dl class="std cmdoption">
  877. <dt class="sig sig-object std" id="cmdoption-with-framework-name">
  878. <span class="sig-name descname"><span class="pre">--with-framework-name</span></span><span class="sig-prename descclassname"><span class="pre">=FRAMEWORK</span></span><a class="headerlink" href="#cmdoption-with-framework-name" title="Permalink to this definition">¶</a></dt>
  879. <dd><p>Specify the name for the python framework on macOS only valid when
  880. <a class="reference internal" href="#cmdoption-1"><code class="xref std std-option docutils literal notranslate"><span class="pre">--enable-framework</span></code></a> is set (default: <code class="docutils literal notranslate"><span class="pre">Python</span></code>).</p>
  881. </dd></dl>
  882. </section>
  883. <section id="cross-compiling-options">
  884. <h3><span class="section-number">3.3.11. </span>Cross Compiling Options<a class="headerlink" href="#cross-compiling-options" title="Permalink to this headline">¶</a></h3>
  885. <p>Cross compiling, also known as cross building, can be used to build Python
  886. for another CPU architecture or platform. Cross compiling requires a Python
  887. interpreter for the build platform. The version of the build Python must match
  888. the version of the cross compiled host Python.</p>
  889. <dl class="std cmdoption">
  890. <dt class="sig sig-object std" id="cmdoption-build">
  891. <span class="sig-name descname"><span class="pre">--build</span></span><span class="sig-prename descclassname"><span class="pre">=BUILD</span></span><a class="headerlink" href="#cmdoption-build" title="Permalink to this definition">¶</a></dt>
  892. <dd><p>configure for building on BUILD, usually guessed by <strong class="program">config.guess</strong>.</p>
  893. </dd></dl>
  894. <dl class="std cmdoption">
  895. <dt class="sig sig-object std" id="cmdoption-host">
  896. <span class="sig-name descname"><span class="pre">--host</span></span><span class="sig-prename descclassname"><span class="pre">=HOST</span></span><a class="headerlink" href="#cmdoption-host" title="Permalink to this definition">¶</a></dt>
  897. <dd><p>cross-compile to build programs to run on HOST (target platform)</p>
  898. </dd></dl>
  899. <dl class="std cmdoption">
  900. <dt class="sig sig-object std" id="cmdoption-with-build-python">
  901. <span class="sig-name descname"><span class="pre">--with-build-python</span></span><span class="sig-prename descclassname"><span class="pre">=path/to/python</span></span><a class="headerlink" href="#cmdoption-with-build-python" title="Permalink to this definition">¶</a></dt>
  902. <dd><p>path to build <code class="docutils literal notranslate"><span class="pre">python</span></code> binary for cross compiling</p>
  903. <div class="versionadded">
  904. <p><span class="versionmodified added">New in version 3.11.</span></p>
  905. </div>
  906. </dd></dl>
  907. <dl class="std cmdoption">
  908. <dt class="sig sig-object std" id="cmdoption-arg-CONFIG_SITE">
  909. <span id="cmdoption-arg-config-site"></span><span class="sig-name descname"><span class="pre">CONFIG_SITE</span></span><span class="sig-prename descclassname"><span class="pre">=file</span></span><a class="headerlink" href="#cmdoption-arg-CONFIG_SITE" title="Permalink to this definition">¶</a></dt>
  910. <dd><p>An environment variable that points to a file with configure overrides.</p>
  911. <p>Example <em>config.site</em> file:</p>
  912. <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># config.site-aarch64</span>
  913. <span class="n">ac_cv_buggy_getaddrinfo</span><span class="o">=</span><span class="n">no</span>
  914. <span class="n">ac_cv_file__dev_ptmx</span><span class="o">=</span><span class="n">yes</span>
  915. <span class="n">ac_cv_file__dev_ptc</span><span class="o">=</span><span class="n">no</span>
  916. </pre></div>
  917. </div>
  918. </dd></dl>
  919. <p>Cross compiling example:</p>
  920. <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="n">CONFIG_SITE</span><span class="o">=</span><span class="n">config</span><span class="o">.</span><span class="n">site</span><span class="o">-</span><span class="n">aarch64</span> <span class="o">../</span><span class="n">configure</span> \
  921. <span class="o">--</span><span class="n">build</span><span class="o">=</span><span class="n">x86_64</span><span class="o">-</span><span class="n">pc</span><span class="o">-</span><span class="n">linux</span><span class="o">-</span><span class="n">gnu</span> \
  922. <span class="o">--</span><span class="n">host</span><span class="o">=</span><span class="n">aarch64</span><span class="o">-</span><span class="n">unknown</span><span class="o">-</span><span class="n">linux</span><span class="o">-</span><span class="n">gnu</span> \
  923. <span class="o">--</span><span class="k">with</span><span class="o">-</span><span class="n">build</span><span class="o">-</span><span class="n">python</span><span class="o">=../</span><span class="n">x86_64</span><span class="o">/</span><span class="n">python</span>
  924. </pre></div>
  925. </div>
  926. </section>
  927. </section>
  928. <section id="python-build-system">
  929. <h2><span class="section-number">3.4. </span>Python Build System<a class="headerlink" href="#python-build-system" title="Permalink to this headline">¶</a></h2>
  930. <section id="main-files-of-the-build-system">
  931. <h3><span class="section-number">3.4.1. </span>Main files of the build system<a class="headerlink" href="#main-files-of-the-build-system" title="Permalink to this headline">¶</a></h3>
  932. <ul class="simple">
  933. <li><p><code class="file docutils literal notranslate"><span class="pre">configure.ac</span></code> =&gt; <code class="file docutils literal notranslate"><span class="pre">configure</span></code>;</p></li>
  934. <li><p><code class="file docutils literal notranslate"><span class="pre">Makefile.pre.in</span></code> =&gt; <code class="file docutils literal notranslate"><span class="pre">Makefile</span></code> (created by <code class="file docutils literal notranslate"><span class="pre">configure</span></code>);</p></li>
  935. <li><p><code class="file docutils literal notranslate"><span class="pre">pyconfig.h</span></code> (created by <code class="file docutils literal notranslate"><span class="pre">configure</span></code>);</p></li>
  936. <li><p><code class="file docutils literal notranslate"><span class="pre">Modules/Setup</span></code>: C extensions built by the Makefile using
  937. <code class="file docutils literal notranslate"><span class="pre">Module/makesetup</span></code> shell script;</p></li>
  938. </ul>
  939. </section>
  940. <section id="main-build-steps">
  941. <h3><span class="section-number">3.4.2. </span>Main build steps<a class="headerlink" href="#main-build-steps" title="Permalink to this headline">¶</a></h3>
  942. <ul class="simple">
  943. <li><p>C files (<code class="docutils literal notranslate"><span class="pre">.c</span></code>) are built as object files (<code class="docutils literal notranslate"><span class="pre">.o</span></code>).</p></li>
  944. <li><p>A static <code class="docutils literal notranslate"><span class="pre">libpython</span></code> library (<code class="docutils literal notranslate"><span class="pre">.a</span></code>) is created from objects files.</p></li>
  945. <li><p><code class="docutils literal notranslate"><span class="pre">python.o</span></code> and the static <code class="docutils literal notranslate"><span class="pre">libpython</span></code> library are linked into the
  946. final <code class="docutils literal notranslate"><span class="pre">python</span></code> program.</p></li>
  947. <li><p>C extensions are built by the Makefile (see <code class="file docutils literal notranslate"><span class="pre">Modules/Setup</span></code>).</p></li>
  948. </ul>
  949. </section>
  950. <section id="main-makefile-targets">
  951. <h3><span class="section-number">3.4.3. </span>Main Makefile targets<a class="headerlink" href="#main-makefile-targets" title="Permalink to this headline">¶</a></h3>
  952. <ul class="simple">
  953. <li><p><code class="docutils literal notranslate"><span class="pre">make</span></code>: Build Python with the standard library.</p></li>
  954. <li><p><code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">platform:</span></code>: build the <code class="docutils literal notranslate"><span class="pre">python</span></code> program, but don’t build the
  955. standard library extension modules.</p></li>
  956. <li><p><code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">profile-opt</span></code>: build Python using Profile Guided Optimization (PGO).
  957. You can use the configure <a class="reference internal" href="#cmdoption-enable-optimizations"><code class="xref std std-option docutils literal notranslate"><span class="pre">--enable-optimizations</span></code></a> option to make
  958. this the default target of the <code class="docutils literal notranslate"><span class="pre">make</span></code> command (<code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">all</span></code> or just
  959. <code class="docutils literal notranslate"><span class="pre">make</span></code>).</p></li>
  960. <li><p><code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">buildbottest</span></code>: Build Python and run the Python test suite, the same
  961. way than buildbots test Python. Set <code class="docutils literal notranslate"><span class="pre">TESTTIMEOUT</span></code> variable (in seconds)
  962. to change the test timeout (1200 by default: 20 minutes).</p></li>
  963. <li><p><code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">install</span></code>: Build and install Python.</p></li>
  964. <li><p><code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">regen-all</span></code>: Regenerate (almost) all generated files;
  965. <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">regen-stdlib-module-names</span></code> and <code class="docutils literal notranslate"><span class="pre">autoconf</span></code> must be run separately
  966. for the remaining generated files.</p></li>
  967. <li><p><code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">clean</span></code>: Remove built files.</p></li>
  968. <li><p><code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">distclean</span></code>: Same than <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">clean</span></code>, but remove also files created
  969. by the configure script.</p></li>
  970. </ul>
  971. </section>
  972. <section id="c-extensions">
  973. <h3><span class="section-number">3.4.4. </span>C extensions<a class="headerlink" href="#c-extensions" title="Permalink to this headline">¶</a></h3>
  974. <p>Some C extensions are built as built-in modules, like the <code class="docutils literal notranslate"><span class="pre">sys</span></code> module.
  975. They are built with the <code class="docutils literal notranslate"><span class="pre">Py_BUILD_CORE_BUILTIN</span></code> macro defined.
  976. Built-in modules have no <code class="docutils literal notranslate"><span class="pre">__file__</span></code> attribute:</p>
  977. <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">sys</span>
  978. <span class="gp">&gt;&gt;&gt; </span><span class="n">sys</span>
  979. <span class="go">&lt;module &#39;sys&#39; (built-in)&gt;</span>
  980. <span class="gp">&gt;&gt;&gt; </span><span class="n">sys</span><span class="o">.</span><span class="vm">__file__</span>
  981. <span class="gt">Traceback (most recent call last):</span>
  982. File <span class="nb">&quot;&lt;stdin&gt;&quot;</span>, line <span class="m">1</span>, in <span class="n">&lt;module&gt;</span>
  983. <span class="gr">AttributeError</span>: <span class="n">module &#39;sys&#39; has no attribute &#39;__file__&#39;</span>
  984. </pre></div>
  985. </div>
  986. <p>Other C extensions are built as dynamic libraries, like the <code class="docutils literal notranslate"><span class="pre">_asyncio</span></code> module.
  987. They are built with the <code class="docutils literal notranslate"><span class="pre">Py_BUILD_CORE_MODULE</span></code> macro defined.
  988. Example on Linux x86-64:</p>
  989. <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">_asyncio</span>
  990. <span class="gp">&gt;&gt;&gt; </span><span class="n">_asyncio</span>
  991. <span class="go">&lt;module &#39;_asyncio&#39; from &#39;/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so&#39;&gt;</span>
  992. <span class="gp">&gt;&gt;&gt; </span><span class="n">_asyncio</span><span class="o">.</span><span class="vm">__file__</span>
  993. <span class="go">&#39;/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so&#39;</span>
  994. </pre></div>
  995. </div>
  996. <p><code class="file docutils literal notranslate"><span class="pre">Modules/Setup</span></code> is used to generate Makefile targets to build C extensions.
  997. At the beginning of the files, C extensions are built as built-in modules.
  998. Extensions defined after the <code class="docutils literal notranslate"><span class="pre">*shared*</span></code> marker are built as dynamic libraries.</p>
  999. <p>The <code class="xref c c-macro docutils literal notranslate"><span class="pre">PyAPI_FUNC()</span></code>, <code class="xref c c-macro docutils literal notranslate"><span class="pre">PyAPI_DATA()</span></code> and
  1000. <a class="reference internal" href="../c-api/intro.html#c.PyMODINIT_FUNC" title="PyMODINIT_FUNC"><code class="xref c c-macro docutils literal notranslate"><span class="pre">PyMODINIT_FUNC</span></code></a> macros of <code class="file docutils literal notranslate"><span class="pre">Include/exports.h</span></code> are defined
  1001. differently depending if the <code class="docutils literal notranslate"><span class="pre">Py_BUILD_CORE_MODULE</span></code> macro is defined:</p>
  1002. <ul class="simple">
  1003. <li><p>Use <code class="docutils literal notranslate"><span class="pre">Py_EXPORTED_SYMBOL</span></code> if the <code class="docutils literal notranslate"><span class="pre">Py_BUILD_CORE_MODULE</span></code> is defined</p></li>
  1004. <li><p>Use <code class="docutils literal notranslate"><span class="pre">Py_IMPORTED_SYMBOL</span></code> otherwise.</p></li>
  1005. </ul>
  1006. <p>If the <code class="docutils literal notranslate"><span class="pre">Py_BUILD_CORE_BUILTIN</span></code> macro is used by mistake on a C extension
  1007. built as a shared library, its <code class="samp docutils literal notranslate"><span class="pre">PyInit_</span><em><span class="pre">xxx</span></em><span class="pre">()</span></code> function is not exported,
  1008. causing an <a class="reference internal" href="../library/exceptions.html#ImportError" title="ImportError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ImportError</span></code></a> on import.</p>
  1009. </section>
  1010. </section>
  1011. <section id="compiler-and-linker-flags">
  1012. <h2><span class="section-number">3.5. </span>Compiler and linker flags<a class="headerlink" href="#compiler-and-linker-flags" title="Permalink to this headline">¶</a></h2>
  1013. <p>Options set by the <code class="docutils literal notranslate"><span class="pre">./configure</span></code> script and environment variables and used by
  1014. <code class="docutils literal notranslate"><span class="pre">Makefile</span></code>.</p>
  1015. <section id="preprocessor-flags">
  1016. <h3><span class="section-number">3.5.1. </span>Preprocessor flags<a class="headerlink" href="#preprocessor-flags" title="Permalink to this headline">¶</a></h3>
  1017. <dl class="std envvar">
  1018. <dt class="sig sig-object std" id="envvar-CONFIGURE_CPPFLAGS">
  1019. <span class="sig-name descname"><span class="pre">CONFIGURE_CPPFLAGS</span></span><a class="headerlink" href="#envvar-CONFIGURE_CPPFLAGS" title="Permalink to this definition">¶</a></dt>
  1020. <dd><p>Value of <span class="target" id="index-9"></span><a class="reference internal" href="#envvar-CPPFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">CPPFLAGS</span></code></a> variable passed to the <code class="docutils literal notranslate"><span class="pre">./configure</span></code> script.</p>
  1021. <div class="versionadded">
  1022. <p><span class="versionmodified added">New in version 3.6.</span></p>
  1023. </div>
  1024. </dd></dl>
  1025. <dl class="std envvar">
  1026. <dt class="sig sig-object std" id="envvar-CPPFLAGS">
  1027. <span class="sig-name descname"><span class="pre">CPPFLAGS</span></span><a class="headerlink" href="#envvar-CPPFLAGS" title="Permalink to this definition">¶</a></dt>
  1028. <dd><p>(Objective) C/C++ preprocessor flags, e.g. <code class="samp docutils literal notranslate"><span class="pre">-I</span><em><span class="pre">include_dir</span></em></code> if you have
  1029. headers in a nonstandard directory <em>include_dir</em>.</p>
  1030. <p>Both <span class="target" id="index-10"></span><a class="reference internal" href="#envvar-CPPFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">CPPFLAGS</span></code></a> and <span class="target" id="index-11"></span><a class="reference internal" href="#envvar-LDFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">LDFLAGS</span></code></a> need to contain the shell’s
  1031. value to be able to build extension modules using the
  1032. directories specified in the environment variables.</p>
  1033. </dd></dl>
  1034. <dl class="std envvar">
  1035. <dt class="sig sig-object std" id="envvar-BASECPPFLAGS">
  1036. <span class="sig-name descname"><span class="pre">BASECPPFLAGS</span></span><a class="headerlink" href="#envvar-BASECPPFLAGS" title="Permalink to this definition">¶</a></dt>
  1037. <dd><div class="versionadded">
  1038. <p><span class="versionmodified added">New in version 3.4.</span></p>
  1039. </div>
  1040. </dd></dl>
  1041. <dl class="std envvar">
  1042. <dt class="sig sig-object std" id="envvar-PY_CPPFLAGS">
  1043. <span class="sig-name descname"><span class="pre">PY_CPPFLAGS</span></span><a class="headerlink" href="#envvar-PY_CPPFLAGS" title="Permalink to this definition">¶</a></dt>
  1044. <dd><p>Extra preprocessor flags added for building the interpreter object files.</p>
  1045. <p>Default: <code class="docutils literal notranslate"><span class="pre">$(BASECPPFLAGS)</span> <span class="pre">-I.</span> <span class="pre">-I$(srcdir)/Include</span> <span class="pre">$(CONFIGURE_CPPFLAGS)</span> <span class="pre">$(CPPFLAGS)</span></code>.</p>
  1046. <div class="versionadded">
  1047. <p><span class="versionmodified added">New in version 3.2.</span></p>
  1048. </div>
  1049. </dd></dl>
  1050. </section>
  1051. <section id="compiler-flags">
  1052. <h3><span class="section-number">3.5.2. </span>Compiler flags<a class="headerlink" href="#compiler-flags" title="Permalink to this headline">¶</a></h3>
  1053. <dl class="std envvar">
  1054. <dt class="sig sig-object std" id="envvar-CC">
  1055. <span class="sig-name descname"><span class="pre">CC</span></span><a class="headerlink" href="#envvar-CC" title="Permalink to this definition">¶</a></dt>
  1056. <dd><p>C compiler command.</p>
  1057. <p>Example: <code class="docutils literal notranslate"><span class="pre">gcc</span> <span class="pre">-pthread</span></code>.</p>
  1058. </dd></dl>
  1059. <dl class="std envvar">
  1060. <dt class="sig sig-object std" id="envvar-CXX">
  1061. <span class="sig-name descname"><span class="pre">CXX</span></span><a class="headerlink" href="#envvar-CXX" title="Permalink to this definition">¶</a></dt>
  1062. <dd><p>C++ compiler command.</p>
  1063. <p>Example: <code class="docutils literal notranslate"><span class="pre">g++</span> <span class="pre">-pthread</span></code>.</p>
  1064. </dd></dl>
  1065. <dl class="std envvar">
  1066. <dt class="sig sig-object std" id="envvar-CFLAGS">
  1067. <span class="sig-name descname"><span class="pre">CFLAGS</span></span><a class="headerlink" href="#envvar-CFLAGS" title="Permalink to this definition">¶</a></dt>
  1068. <dd><p>C compiler flags.</p>
  1069. </dd></dl>
  1070. <dl class="std envvar">
  1071. <dt class="sig sig-object std" id="envvar-CFLAGS_NODIST">
  1072. <span class="sig-name descname"><span class="pre">CFLAGS_NODIST</span></span><a class="headerlink" href="#envvar-CFLAGS_NODIST" title="Permalink to this definition">¶</a></dt>
  1073. <dd><p><span class="target" id="index-12"></span><a class="reference internal" href="#envvar-CFLAGS_NODIST"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">CFLAGS_NODIST</span></code></a> is used for building the interpreter and stdlib C
  1074. extensions. Use it when a compiler flag should <em>not</em> be part of
  1075. <span class="target" id="index-13"></span><a class="reference internal" href="#envvar-CFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">CFLAGS</span></code></a> once Python is installed (<a class="reference external" href="https://github.com/python/cpython/issues/65320">gh-65320</a>).</p>
  1076. <p>In particular, <span class="target" id="index-14"></span><a class="reference internal" href="#envvar-CFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">CFLAGS</span></code></a> should not contain:</p>
  1077. <ul class="simple">
  1078. <li><p>the compiler flag <code class="docutils literal notranslate"><span class="pre">-I</span></code> (for setting the search path for include files).
  1079. The <code class="docutils literal notranslate"><span class="pre">-I</span></code> flags are processed from left to right, and any flags in
  1080. <span class="target" id="index-15"></span><a class="reference internal" href="#envvar-CFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">CFLAGS</span></code></a> would take precedence over user- and package-supplied <code class="docutils literal notranslate"><span class="pre">-I</span></code>
  1081. flags.</p></li>
  1082. <li><p>hardening flags such as <code class="docutils literal notranslate"><span class="pre">-Werror</span></code> because distributions cannot control
  1083. whether packages installed by users conform to such heightened
  1084. standards.</p></li>
  1085. </ul>
  1086. <div class="versionadded">
  1087. <p><span class="versionmodified added">New in version 3.5.</span></p>
  1088. </div>
  1089. </dd></dl>
  1090. <dl class="std envvar">
  1091. <dt class="sig sig-object std" id="envvar-COMPILEALL_OPTS">
  1092. <span class="sig-name descname"><span class="pre">COMPILEALL_OPTS</span></span><a class="headerlink" href="#envvar-COMPILEALL_OPTS" title="Permalink to this definition">¶</a></dt>
  1093. <dd><p>Options passed to the <a class="reference internal" href="../library/compileall.html#module-compileall" title="compileall: Tools for byte-compiling all Python source files in a directory tree."><code class="xref py py-mod docutils literal notranslate"><span class="pre">compileall</span></code></a> command line when building PYC files
  1094. in <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">install</span></code>. Default: <code class="docutils literal notranslate"><span class="pre">-j0</span></code>.</p>
  1095. <div class="versionadded">
  1096. <p><span class="versionmodified added">New in version 3.12.</span></p>
  1097. </div>
  1098. </dd></dl>
  1099. <dl class="std envvar">
  1100. <dt class="sig sig-object std" id="envvar-EXTRA_CFLAGS">
  1101. <span class="sig-name descname"><span class="pre">EXTRA_CFLAGS</span></span><a class="headerlink" href="#envvar-EXTRA_CFLAGS" title="Permalink to this definition">¶</a></dt>
  1102. <dd><p>Extra C compiler flags.</p>
  1103. </dd></dl>
  1104. <dl class="std envvar">
  1105. <dt class="sig sig-object std" id="envvar-CONFIGURE_CFLAGS">
  1106. <span class="sig-name descname"><span class="pre">CONFIGURE_CFLAGS</span></span><a class="headerlink" href="#envvar-CONFIGURE_CFLAGS" title="Permalink to this definition">¶</a></dt>
  1107. <dd><p>Value of <span class="target" id="index-16"></span><a class="reference internal" href="#envvar-CFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">CFLAGS</span></code></a> variable passed to the <code class="docutils literal notranslate"><span class="pre">./configure</span></code>
  1108. script.</p>
  1109. <div class="versionadded">
  1110. <p><span class="versionmodified added">New in version 3.2.</span></p>
  1111. </div>
  1112. </dd></dl>
  1113. <dl class="std envvar">
  1114. <dt class="sig sig-object std" id="envvar-CONFIGURE_CFLAGS_NODIST">
  1115. <span class="sig-name descname"><span class="pre">CONFIGURE_CFLAGS_NODIST</span></span><a class="headerlink" href="#envvar-CONFIGURE_CFLAGS_NODIST" title="Permalink to this definition">¶</a></dt>
  1116. <dd><p>Value of <span class="target" id="index-17"></span><a class="reference internal" href="#envvar-CFLAGS_NODIST"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">CFLAGS_NODIST</span></code></a> variable passed to the <code class="docutils literal notranslate"><span class="pre">./configure</span></code>
  1117. script.</p>
  1118. <div class="versionadded">
  1119. <p><span class="versionmodified added">New in version 3.5.</span></p>
  1120. </div>
  1121. </dd></dl>
  1122. <dl class="std envvar">
  1123. <dt class="sig sig-object std" id="envvar-BASECFLAGS">
  1124. <span class="sig-name descname"><span class="pre">BASECFLAGS</span></span><a class="headerlink" href="#envvar-BASECFLAGS" title="Permalink to this definition">¶</a></dt>
  1125. <dd><p>Base compiler flags.</p>
  1126. </dd></dl>
  1127. <dl class="std envvar">
  1128. <dt class="sig sig-object std" id="envvar-OPT">
  1129. <span class="sig-name descname"><span class="pre">OPT</span></span><a class="headerlink" href="#envvar-OPT" title="Permalink to this definition">¶</a></dt>
  1130. <dd><p>Optimization flags.</p>
  1131. </dd></dl>
  1132. <dl class="std envvar">
  1133. <dt class="sig sig-object std" id="envvar-CFLAGS_ALIASING">
  1134. <span class="sig-name descname"><span class="pre">CFLAGS_ALIASING</span></span><a class="headerlink" href="#envvar-CFLAGS_ALIASING" title="Permalink to this definition">¶</a></dt>
  1135. <dd><p>Strict or non-strict aliasing flags used to compile <code class="docutils literal notranslate"><span class="pre">Python/dtoa.c</span></code>.</p>
  1136. <div class="versionadded">
  1137. <p><span class="versionmodified added">New in version 3.7.</span></p>
  1138. </div>
  1139. </dd></dl>
  1140. <dl class="std envvar">
  1141. <dt class="sig sig-object std" id="envvar-CCSHARED">
  1142. <span class="sig-name descname"><span class="pre">CCSHARED</span></span><a class="headerlink" href="#envvar-CCSHARED" title="Permalink to this definition">¶</a></dt>
  1143. <dd><p>Compiler flags used to build a shared library.</p>
  1144. <p>For example, <code class="docutils literal notranslate"><span class="pre">-fPIC</span></code> is used on Linux and on BSD.</p>
  1145. </dd></dl>
  1146. <dl class="std envvar">
  1147. <dt class="sig sig-object std" id="envvar-CFLAGSFORSHARED">
  1148. <span class="sig-name descname"><span class="pre">CFLAGSFORSHARED</span></span><a class="headerlink" href="#envvar-CFLAGSFORSHARED" title="Permalink to this definition">¶</a></dt>
  1149. <dd><p>Extra C flags added for building the interpreter object files.</p>
  1150. <p>Default: <code class="docutils literal notranslate"><span class="pre">$(CCSHARED)</span></code> when <a class="reference internal" href="#cmdoption-enable-shared"><code class="xref std std-option docutils literal notranslate"><span class="pre">--enable-shared</span></code></a> is used, or an empty
  1151. string otherwise.</p>
  1152. </dd></dl>
  1153. <dl class="std envvar">
  1154. <dt class="sig sig-object std" id="envvar-PY_CFLAGS">
  1155. <span class="sig-name descname"><span class="pre">PY_CFLAGS</span></span><a class="headerlink" href="#envvar-PY_CFLAGS" title="Permalink to this definition">¶</a></dt>
  1156. <dd><p>Default: <code class="docutils literal notranslate"><span class="pre">$(BASECFLAGS)</span> <span class="pre">$(OPT)</span> <span class="pre">$(CONFIGURE_CFLAGS)</span> <span class="pre">$(CFLAGS)</span> <span class="pre">$(EXTRA_CFLAGS)</span></code>.</p>
  1157. </dd></dl>
  1158. <dl class="std envvar">
  1159. <dt class="sig sig-object std" id="envvar-PY_CFLAGS_NODIST">
  1160. <span class="sig-name descname"><span class="pre">PY_CFLAGS_NODIST</span></span><a class="headerlink" href="#envvar-PY_CFLAGS_NODIST" title="Permalink to this definition">¶</a></dt>
  1161. <dd><p>Default: <code class="docutils literal notranslate"><span class="pre">$(CONFIGURE_CFLAGS_NODIST)</span> <span class="pre">$(CFLAGS_NODIST)</span> <span class="pre">-I$(srcdir)/Include/internal</span></code>.</p>
  1162. <div class="versionadded">
  1163. <p><span class="versionmodified added">New in version 3.5.</span></p>
  1164. </div>
  1165. </dd></dl>
  1166. <dl class="std envvar">
  1167. <dt class="sig sig-object std" id="envvar-PY_STDMODULE_CFLAGS">
  1168. <span class="sig-name descname"><span class="pre">PY_STDMODULE_CFLAGS</span></span><a class="headerlink" href="#envvar-PY_STDMODULE_CFLAGS" title="Permalink to this definition">¶</a></dt>
  1169. <dd><p>C flags used for building the interpreter object files.</p>
  1170. <p>Default: <code class="docutils literal notranslate"><span class="pre">$(PY_CFLAGS)</span> <span class="pre">$(PY_CFLAGS_NODIST)</span> <span class="pre">$(PY_CPPFLAGS)</span> <span class="pre">$(CFLAGSFORSHARED)</span></code>.</p>
  1171. <div class="versionadded">
  1172. <p><span class="versionmodified added">New in version 3.7.</span></p>
  1173. </div>
  1174. </dd></dl>
  1175. <dl class="std envvar">
  1176. <dt class="sig sig-object std" id="envvar-PY_CORE_CFLAGS">
  1177. <span class="sig-name descname"><span class="pre">PY_CORE_CFLAGS</span></span><a class="headerlink" href="#envvar-PY_CORE_CFLAGS" title="Permalink to this definition">¶</a></dt>
  1178. <dd><p>Default: <code class="docutils literal notranslate"><span class="pre">$(PY_STDMODULE_CFLAGS)</span> <span class="pre">-DPy_BUILD_CORE</span></code>.</p>
  1179. <div class="versionadded">
  1180. <p><span class="versionmodified added">New in version 3.2.</span></p>
  1181. </div>
  1182. </dd></dl>
  1183. <dl class="std envvar">
  1184. <dt class="sig sig-object std" id="envvar-PY_BUILTIN_MODULE_CFLAGS">
  1185. <span class="sig-name descname"><span class="pre">PY_BUILTIN_MODULE_CFLAGS</span></span><a class="headerlink" href="#envvar-PY_BUILTIN_MODULE_CFLAGS" title="Permalink to this definition">¶</a></dt>
  1186. <dd><p>Compiler flags to build a standard library extension module as a built-in
  1187. module, like the <a class="reference internal" href="../library/posix.html#module-posix" title="posix: The most common POSIX system calls (normally used via module os). (Unix)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">posix</span></code></a> module.</p>
  1188. <p>Default: <code class="docutils literal notranslate"><span class="pre">$(PY_STDMODULE_CFLAGS)</span> <span class="pre">-DPy_BUILD_CORE_BUILTIN</span></code>.</p>
  1189. <div class="versionadded">
  1190. <p><span class="versionmodified added">New in version 3.8.</span></p>
  1191. </div>
  1192. </dd></dl>
  1193. <dl class="std envvar">
  1194. <dt class="sig sig-object std" id="envvar-PURIFY">
  1195. <span class="sig-name descname"><span class="pre">PURIFY</span></span><a class="headerlink" href="#envvar-PURIFY" title="Permalink to this definition">¶</a></dt>
  1196. <dd><p>Purify command. Purify is a memory debugger program.</p>
  1197. <p>Default: empty string (not used).</p>
  1198. </dd></dl>
  1199. </section>
  1200. <section id="linker-flags">
  1201. <h3><span class="section-number">3.5.3. </span>Linker flags<a class="headerlink" href="#linker-flags" title="Permalink to this headline">¶</a></h3>
  1202. <dl class="std envvar">
  1203. <dt class="sig sig-object std" id="envvar-LINKCC">
  1204. <span class="sig-name descname"><span class="pre">LINKCC</span></span><a class="headerlink" href="#envvar-LINKCC" title="Permalink to this definition">¶</a></dt>
  1205. <dd><p>Linker command used to build programs like <code class="docutils literal notranslate"><span class="pre">python</span></code> and <code class="docutils literal notranslate"><span class="pre">_testembed</span></code>.</p>
  1206. <p>Default: <code class="docutils literal notranslate"><span class="pre">$(PURIFY)</span> <span class="pre">$(CC)</span></code>.</p>
  1207. </dd></dl>
  1208. <dl class="std envvar">
  1209. <dt class="sig sig-object std" id="envvar-CONFIGURE_LDFLAGS">
  1210. <span class="sig-name descname"><span class="pre">CONFIGURE_LDFLAGS</span></span><a class="headerlink" href="#envvar-CONFIGURE_LDFLAGS" title="Permalink to this definition">¶</a></dt>
  1211. <dd><p>Value of <span class="target" id="index-18"></span><a class="reference internal" href="#envvar-LDFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">LDFLAGS</span></code></a> variable passed to the <code class="docutils literal notranslate"><span class="pre">./configure</span></code> script.</p>
  1212. <p>Avoid assigning <span class="target" id="index-19"></span><a class="reference internal" href="#envvar-CFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">CFLAGS</span></code></a>, <span class="target" id="index-20"></span><a class="reference internal" href="#envvar-LDFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">LDFLAGS</span></code></a>, etc. so users can use
  1213. them on the command line to append to these values without stomping the
  1214. pre-set values.</p>
  1215. <div class="versionadded">
  1216. <p><span class="versionmodified added">New in version 3.2.</span></p>
  1217. </div>
  1218. </dd></dl>
  1219. <dl class="std envvar">
  1220. <dt class="sig sig-object std" id="envvar-LDFLAGS_NODIST">
  1221. <span class="sig-name descname"><span class="pre">LDFLAGS_NODIST</span></span><a class="headerlink" href="#envvar-LDFLAGS_NODIST" title="Permalink to this definition">¶</a></dt>
  1222. <dd><p><span class="target" id="index-21"></span><a class="reference internal" href="#envvar-LDFLAGS_NODIST"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">LDFLAGS_NODIST</span></code></a> is used in the same manner as
  1223. <span class="target" id="index-22"></span><a class="reference internal" href="#envvar-CFLAGS_NODIST"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">CFLAGS_NODIST</span></code></a>. Use it when a linker flag should <em>not</em> be part of
  1224. <span class="target" id="index-23"></span><a class="reference internal" href="#envvar-LDFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">LDFLAGS</span></code></a> once Python is installed (<a class="reference external" href="https://github.com/python/cpython/issues/65320">gh-65320</a>).</p>
  1225. <p>In particular, <span class="target" id="index-24"></span><a class="reference internal" href="#envvar-LDFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">LDFLAGS</span></code></a> should not contain:</p>
  1226. <ul class="simple">
  1227. <li><p>the compiler flag <code class="docutils literal notranslate"><span class="pre">-L</span></code> (for setting the search path for libraries).
  1228. The <code class="docutils literal notranslate"><span class="pre">-L</span></code> flags are processed from left to right, and any flags in
  1229. <span class="target" id="index-25"></span><a class="reference internal" href="#envvar-LDFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">LDFLAGS</span></code></a> would take precedence over user- and package-supplied <code class="docutils literal notranslate"><span class="pre">-L</span></code>
  1230. flags.</p></li>
  1231. </ul>
  1232. </dd></dl>
  1233. <dl class="std envvar">
  1234. <dt class="sig sig-object std" id="envvar-CONFIGURE_LDFLAGS_NODIST">
  1235. <span class="sig-name descname"><span class="pre">CONFIGURE_LDFLAGS_NODIST</span></span><a class="headerlink" href="#envvar-CONFIGURE_LDFLAGS_NODIST" title="Permalink to this definition">¶</a></dt>
  1236. <dd><p>Value of <span class="target" id="index-26"></span><a class="reference internal" href="#envvar-LDFLAGS_NODIST"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">LDFLAGS_NODIST</span></code></a> variable passed to the <code class="docutils literal notranslate"><span class="pre">./configure</span></code>
  1237. script.</p>
  1238. <div class="versionadded">
  1239. <p><span class="versionmodified added">New in version 3.8.</span></p>
  1240. </div>
  1241. </dd></dl>
  1242. <dl class="std envvar">
  1243. <dt class="sig sig-object std" id="envvar-LDFLAGS">
  1244. <span class="sig-name descname"><span class="pre">LDFLAGS</span></span><a class="headerlink" href="#envvar-LDFLAGS" title="Permalink to this definition">¶</a></dt>
  1245. <dd><p>Linker flags, e.g. <code class="samp docutils literal notranslate"><span class="pre">-L</span><em><span class="pre">lib_dir</span></em></code> if you have libraries in a nonstandard
  1246. directory <em>lib_dir</em>.</p>
  1247. <p>Both <span class="target" id="index-27"></span><a class="reference internal" href="#envvar-CPPFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">CPPFLAGS</span></code></a> and <span class="target" id="index-28"></span><a class="reference internal" href="#envvar-LDFLAGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">LDFLAGS</span></code></a> need to contain the shell’s
  1248. value to be able to build extension modules using the
  1249. directories specified in the environment variables.</p>
  1250. </dd></dl>
  1251. <dl class="std envvar">
  1252. <dt class="sig sig-object std" id="envvar-LIBS">
  1253. <span class="sig-name descname"><span class="pre">LIBS</span></span><a class="headerlink" href="#envvar-LIBS" title="Permalink to this definition">¶</a></dt>
  1254. <dd><p>Linker flags to pass libraries to the linker when linking the Python
  1255. executable.</p>
  1256. <p>Example: <code class="docutils literal notranslate"><span class="pre">-lrt</span></code>.</p>
  1257. </dd></dl>
  1258. <dl class="std envvar">
  1259. <dt class="sig sig-object std" id="envvar-LDSHARED">
  1260. <span class="sig-name descname"><span class="pre">LDSHARED</span></span><a class="headerlink" href="#envvar-LDSHARED" title="Permalink to this definition">¶</a></dt>
  1261. <dd><p>Command to build a shared library.</p>
  1262. <p>Default: <code class="docutils literal notranslate"><span class="pre">&#64;LDSHARED&#64;</span> <span class="pre">$(PY_LDFLAGS)</span></code>.</p>
  1263. </dd></dl>
  1264. <dl class="std envvar">
  1265. <dt class="sig sig-object std" id="envvar-BLDSHARED">
  1266. <span class="sig-name descname"><span class="pre">BLDSHARED</span></span><a class="headerlink" href="#envvar-BLDSHARED" title="Permalink to this definition">¶</a></dt>
  1267. <dd><p>Command to build <code class="docutils literal notranslate"><span class="pre">libpython</span></code> shared library.</p>
  1268. <p>Default: <code class="docutils literal notranslate"><span class="pre">&#64;BLDSHARED&#64;</span> <span class="pre">$(PY_CORE_LDFLAGS)</span></code>.</p>
  1269. </dd></dl>
  1270. <dl class="std envvar">
  1271. <dt class="sig sig-object std" id="envvar-PY_LDFLAGS">
  1272. <span class="sig-name descname"><span class="pre">PY_LDFLAGS</span></span><a class="headerlink" href="#envvar-PY_LDFLAGS" title="Permalink to this definition">¶</a></dt>
  1273. <dd><p>Default: <code class="docutils literal notranslate"><span class="pre">$(CONFIGURE_LDFLAGS)</span> <span class="pre">$(LDFLAGS)</span></code>.</p>
  1274. </dd></dl>
  1275. <dl class="std envvar">
  1276. <dt class="sig sig-object std" id="envvar-PY_LDFLAGS_NODIST">
  1277. <span class="sig-name descname"><span class="pre">PY_LDFLAGS_NODIST</span></span><a class="headerlink" href="#envvar-PY_LDFLAGS_NODIST" title="Permalink to this definition">¶</a></dt>
  1278. <dd><p>Default: <code class="docutils literal notranslate"><span class="pre">$(CONFIGURE_LDFLAGS_NODIST)</span> <span class="pre">$(LDFLAGS_NODIST)</span></code>.</p>
  1279. <div class="versionadded">
  1280. <p><span class="versionmodified added">New in version 3.8.</span></p>
  1281. </div>
  1282. </dd></dl>
  1283. <dl class="std envvar">
  1284. <dt class="sig sig-object std" id="envvar-PY_CORE_LDFLAGS">
  1285. <span class="sig-name descname"><span class="pre">PY_CORE_LDFLAGS</span></span><a class="headerlink" href="#envvar-PY_CORE_LDFLAGS" title="Permalink to this definition">¶</a></dt>
  1286. <dd><p>Linker flags used for building the interpreter object files.</p>
  1287. <div class="versionadded">
  1288. <p><span class="versionmodified added">New in version 3.8.</span></p>
  1289. </div>
  1290. </dd></dl>
  1291. </section>
  1292. </section>
  1293. </section>
  1294. <div class="clearer"></div>
  1295. </div>
  1296. </div>
  1297. </div>
  1298. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  1299. <div class="sphinxsidebarwrapper">
  1300. <div>
  1301. <h3><a href="../contents.html">Table of Contents</a></h3>
  1302. <ul>
  1303. <li><a class="reference internal" href="#">3. Configure Python</a><ul>
  1304. <li><a class="reference internal" href="#build-requirements">3.1. Build Requirements</a></li>
  1305. <li><a class="reference internal" href="#generated-files">3.2. Generated files</a></li>
  1306. <li><a class="reference internal" href="#configure-options">3.3. Configure Options</a><ul>
  1307. <li><a class="reference internal" href="#general-options">3.3.1. General Options</a></li>
  1308. <li><a class="reference internal" href="#webassembly-options">3.3.2. WebAssembly Options</a></li>
  1309. <li><a class="reference internal" href="#install-options">3.3.3. Install Options</a></li>
  1310. <li><a class="reference internal" href="#performance-options">3.3.4. Performance options</a></li>
  1311. <li><a class="reference internal" href="#python-debug-build">3.3.5. Python Debug Build</a></li>
  1312. <li><a class="reference internal" href="#debug-options">3.3.6. Debug options</a></li>
  1313. <li><a class="reference internal" href="#linker-options">3.3.7. Linker options</a></li>
  1314. <li><a class="reference internal" href="#libraries-options">3.3.8. Libraries options</a></li>
  1315. <li><a class="reference internal" href="#security-options">3.3.9. Security Options</a></li>
  1316. <li><a class="reference internal" href="#macos-options">3.3.10. macOS Options</a></li>
  1317. <li><a class="reference internal" href="#cross-compiling-options">3.3.11. Cross Compiling Options</a></li>
  1318. </ul>
  1319. </li>
  1320. <li><a class="reference internal" href="#python-build-system">3.4. Python Build System</a><ul>
  1321. <li><a class="reference internal" href="#main-files-of-the-build-system">3.4.1. Main files of the build system</a></li>
  1322. <li><a class="reference internal" href="#main-build-steps">3.4.2. Main build steps</a></li>
  1323. <li><a class="reference internal" href="#main-makefile-targets">3.4.3. Main Makefile targets</a></li>
  1324. <li><a class="reference internal" href="#c-extensions">3.4.4. C extensions</a></li>
  1325. </ul>
  1326. </li>
  1327. <li><a class="reference internal" href="#compiler-and-linker-flags">3.5. Compiler and linker flags</a><ul>
  1328. <li><a class="reference internal" href="#preprocessor-flags">3.5.1. Preprocessor flags</a></li>
  1329. <li><a class="reference internal" href="#compiler-flags">3.5.2. Compiler flags</a></li>
  1330. <li><a class="reference internal" href="#linker-flags">3.5.3. Linker flags</a></li>
  1331. </ul>
  1332. </li>
  1333. </ul>
  1334. </li>
  1335. </ul>
  1336. </div>
  1337. <div>
  1338. <h4>Previous topic</h4>
  1339. <p class="topless"><a href="unix.html"
  1340. title="previous chapter"><span class="section-number">2. </span>Using Python on Unix platforms</a></p>
  1341. </div>
  1342. <div>
  1343. <h4>Next topic</h4>
  1344. <p class="topless"><a href="windows.html"
  1345. title="next chapter"><span class="section-number">4. </span>Using Python on Windows</a></p>
  1346. </div>
  1347. <div role="note" aria-label="source link">
  1348. <h3>This Page</h3>
  1349. <ul class="this-page-menu">
  1350. <li><a href="../bugs.html">Report a Bug</a></li>
  1351. <li>
  1352. <a href="https://github.com/python/cpython/blob/main/Doc/using/configure.rst"
  1353. rel="nofollow">Show Source
  1354. </a>
  1355. </li>
  1356. </ul>
  1357. </div>
  1358. </div>
  1359. </div>
  1360. <div class="clearer"></div>
  1361. </div>
  1362. <div class="related" role="navigation" aria-label="related navigation">
  1363. <h3>Navigation</h3>
  1364. <ul>
  1365. <li class="right" style="margin-right: 10px">
  1366. <a href="../genindex.html" title="General Index"
  1367. >index</a></li>
  1368. <li class="right" >
  1369. <a href="../py-modindex.html" title="Python Module Index"
  1370. >modules</a> |</li>
  1371. <li class="right" >
  1372. <a href="windows.html" title="4. Using Python on Windows"
  1373. >next</a> |</li>
  1374. <li class="right" >
  1375. <a href="unix.html" title="2. Using Python on Unix platforms"
  1376. >previous</a> |</li>
  1377. <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  1378. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  1379. <li class="switchers">
  1380. <div class="language_switcher_placeholder"></div>
  1381. <div class="version_switcher_placeholder"></div>
  1382. </li>
  1383. <li>
  1384. </li>
  1385. <li id="cpython-language-and-version">
  1386. <a href="../index.html">3.12.0 Documentation</a> &#187;
  1387. </li>
  1388. <li class="nav-item nav-item-1"><a href="index.html" >Python Setup and Usage</a> &#187;</li>
  1389. <li class="nav-item nav-item-this"><a href=""><span class="section-number">3. </span>Configure Python</a></li>
  1390. <li class="right">
  1391. <div class="inline-search" role="search">
  1392. <form class="inline-search" action="../search.html" method="get">
  1393. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  1394. <input type="submit" value="Go" />
  1395. </form>
  1396. </div>
  1397. |
  1398. </li>
  1399. <li class="right">
  1400. <label class="theme-selector-label">
  1401. Theme
  1402. <select class="theme-selector" oninput="activateTheme(this.value)">
  1403. <option value="auto" selected>Auto</option>
  1404. <option value="light">Light</option>
  1405. <option value="dark">Dark</option>
  1406. </select>
  1407. </label> |</li>
  1408. </ul>
  1409. </div>
  1410. <div class="footer">
  1411. &copy; <a href="../copyright.html">Copyright</a> 2001-2023, Python Software Foundation.
  1412. <br />
  1413. This page is licensed under the Python Software Foundation License Version 2.
  1414. <br />
  1415. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
  1416. <br />
  1417. See <a href="/license.html">History and License</a> for more information.<br />
  1418. <br />
  1419. The Python Software Foundation is a non-profit corporation.
  1420. <a href="https://www.python.org/psf/donations/">Please donate.</a>
  1421. <br />
  1422. <br />
  1423. Last updated on Oct 02, 2023.
  1424. <a href="/bugs.html">Found a bug</a>?
  1425. <br />
  1426. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
  1427. </div>
  1428. </body>
  1429. </html>