<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html; charset=UTF-8"/><title>AppendixB. Porting and Maintenance</title><metaname="generator"content="DocBook XSL-NS Stylesheets V1.78.1"/><metaname="keywords"content="ISO C++, library"/><metaname="keywords"content="ISO C++, runtime, library"/><linkrel="home"href="../index.html"title="The GNU C++ Library"/><linkrel="up"href="appendix.html"title="PartIV. Appendices"/><linkrel="prev"href="source_design_notes.html"title="Design Notes"/><linkrel="next"href="documentation_hacking.html"title="Writing and Generating Documentation"/></head><body><divclass="navheader"><tablewidth="100%"summary="Navigation header"><tr><thcolspan="3"align="center">AppendixB.
</h1></div></div></div><divclass="toc"><p><strong>Table of Contents</strong></p><dlclass="toc"><dt><spanclass="section"><ahref="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><spanclass="section"><ahref="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><spanclass="section"><ahref="appendix_porting.html#build_hacking.overview">Overview</a></span></dt><dd><dl><dt><spanclass="section"><ahref="appendix_porting.html#build_hacking.overview.basic">General Process</a></span></dt><dt><spanclass="section"><ahref="appendix_porting.html#build_hacking.overview.map">What Comes from Where</a></span></dt></dl></dd><dt><spanclass="section"><ahref="appendix_porting.html#build_hacking.configure">Configure</a></span></dt><dd><dl><dt><spanclass="section"><ahref="appendix_porting.html#build_hacking.configure.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><spanclass="section"><ahref="appendix_porting.html#build_hacking.configure.conventions">Coding and Commenting Conventions</a></span></dt><dt><spanclass="section"><ahref="appendix_porting.html#build_hacking.configure.acinclude">The acinclude.m4 layout</a></span></dt><dt><spanclass="section"><ahref="appendix_porting.html#build_hacking.configure.enable"><codeclass="constant">GLIBCXX_ENABLE</code>, the <codeclass="literal">--enable</code> maker</a></span></dt></dl></dd><dt><spanclass="section"><ahref="appendix_porting.html#build_hacking.make">Make</a></span></dt></dl></dd><dt><spanclass="section"><ahref="documentation_hacking.html">Writing and Generating Documentation</a></span></dt><dd><dl><dt><spanclass="section"><ahref="documentation_hacking.html#doc.intro">Introduction</a></span></dt><dt><spanclass="section"><ahref="documentation_hacking.html#doc.generation">Generating Documentation</a></span></dt><dt><spanclass="section"><ahref="documentation_hacking.html#doc.doxygen">Doxygen</a></span></dt><dd><dl><dt><spanclass="section"><ahref="documentation_hacking.html#doxygen.prereq">Prerequisites</a></span></dt><dt><spanclass="section"><ahref="documentation_hacking.html#doxygen.rules">Generating the Doxygen Files</a></span></dt><dt><spanclass="section"><ahref="documentation_hacking.html#doxygen.debug">Debugging Generation</a></span></dt><dt><spanclass="section"><ahref="documentation_hacking.html#doxygen.markup">Markup</a></span></dt></dl></dd><dt><spanclass="section"><ahref="documentation_hacking.html#doc.docbook">Docbook</a></span></dt><dd><dl><dt><spanclass="section"><ahref="documentation_hacking.html#docbook.prereq">Prerequisites</a></span></dt><dt><spanclass="section"><ahref="documentation_hacking.html#docbook.rules">Generating the DocBook Files</a></span></dt><dt><spanclass="section"><ahref="documentation_hacking.html#docbook.debug">Debugging Generation</a></span></dt><dt><spanclass="section"><ahref="documentation_hacking.html#docbook.validation">Editing and Validation</a></span></dt><dt><spanclass="section"><ahref="documentation_hacking.html#docbook.examples">File Organization and Basics</a></span></dt><dt><spanclass="section"><ahref="documentation_hacking.html#docbook.markup">Markup By Example</a></span></dt></dl></dd></dl></dd><dt><spanclass="section"><ahref="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><spanclass="section"><ahref="internals.html#internals.os">Operating System</a></span></dt><dt><spanclass="section"><ahref="internals.html#internals.cpu">CPU</a></span></dt><dt><spanclass="section"><ahref="internals.html#internals.char_types">Character Types</a></span></dt><dt><spanclass="section"><ahref="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><spanclass="section"><ahref="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><spanclass="section"><ahref="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><spanclass="section"><ahref="test.html">Test</a></span></dt><dd><dl><dt><spanc
</a></span></dt></dl></dd></dl></dd></dl></dd><dt><spanclass="section"><ahref="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><spanclass="section"><ahref="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><spanclass="section"><ahref="abi.html#abi.versioning">Versioning</a></span></dt><dd><dl><dt><spanclass="section"><ahref="abi.html#abi.versioning.goals">Goals</a></span></dt><dt><spanclass="section"><ahref="abi.html#abi.versioning.history">History</a></span></dt><dt><spanclass="section"><ahref="abi.html#abi.versioning.prereq">Prerequisites</a></span></dt><dt><spanclass="section"><ahref="abi.html#abi.versioning.config">Configuring</a></span></dt><dt><spanclass="section"><ahref="abi.html#abi.versioning.active">Checking Active</a></span></dt></dl></dd><dt><spanclass="section"><ahref="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><spanclass="section"><ahref="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><spanclass="section"><ahref="abi.html#abi.impl">Implementation</a></span></dt><dt><spanclass="section"><ahref="abi.html#abi.testing">Testing</a></span></dt><dd><dl><dt><spanclass="section"><ahref="abi.html#abi.testing.single">Single ABI Testing</a></span></dt><dt><spanclass="section"><ahref="abi.html#abi.testing.multi">Multiple ABI Testing</a></span></dt></dl></dd><dt><spanclass="section"><ahref="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><spanclass="section"><ahref="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><spanclass="section"><ahref="api.html#api.rel_300"><codeclass="constant">3.0</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_310"><codeclass="constant">3.1</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_320"><codeclass="constant">3.2</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_330"><codeclass="constant">3.3</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_340"><codeclass="constant">3.4</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_400"><codeclass="constant">4.0</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_410"><codeclass="constant">4.1</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_420"><codeclass="constant">4.2</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_430"><codeclass="constant">4.3</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_440"><codeclass="constant">4.4</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_450"><codeclass="constant">4.5</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_460"><codeclass="constant">4.6</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_470"><codeclass="constant">4.7</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_480"><codeclass="constant">4.8</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_490"><codeclass="constant">4.9</code></a></span></dt><dt><spanclass="section"><ahref="api.html#api.rel_50"><codeclass="constant">5</code></a></span></dt></dl></dd><dt><spanclass="section"><ahref="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><spanclass="section"><ahref="backwards.html#backwards.first">First</a></span></dt><dd><dl><dt><spanclass="section"><ahref="backwards.html#backwards.first.ios_base">No <codeclass="code">ios_base</code></a></span></dt><dt><spanclass="section"><ahref="backwards.html#backwards.first.cout_cin">No <codeclass="code">cout</code> in <codeclass="filename"><ostream.h></code>, no <codeclass="code">cin</code> in <codeclass="filename"><istream.h></code></a></span></dt></dl></dd><dt><spanclass="section"><ahref="backwards.html#backwards.second">Second</a></span></dt><dd><dl><dt><spanclass="section"><ahref="backwards.html#backwards.second.std">Namespace <codeclass="code">std::</code> not s
Removal of <codeclass="code">ostream::form</code> and <codeclass="code">istream::scan</code>
extensions
</a></span></dt><dt><spanclass="section"><ahref="backwards.html#backwards.second.stringstreams">No <codeclass="code">basic_stringbuf</code>, <codeclass="code">basic_stringstream</code></a></span></dt><dt><spanclass="section"><ahref="backwards.html#backwards.second.wchar">Little or no wide character support</a></span></dt><dt><spanclass="section"><ahref="backwards.html#backwards.second.iostream_templates">No templatized iostreams</a></span></dt><dt><spanclass="section"><ahref="backwards.html#backwards.second.thread_safety">Thread safety issues</a></span></dt></dl></dd><dt><spanclass="section"><ahref="backwards.html#backwards.third">Third</a></span></dt><dd><dl><dt><spanclass="section"><ahref="backwards.html#backwards.third.headers">Pre-ISO headers moved to backwards or removed</a></span></dt><dt><spanclass="section"><ahref="backwards.html#backwards.third.hash">Extension headers hash_map, hash_set moved to ext or backwards</a></span></dt><dt><spanclass="section"><ahref="backwards.html#backwards.third.nocreate_noreplace">No <codeclass="code">ios::nocreate/ios::noreplace</code>.
</a></span></dt></dl></dd></dl></dd></dl></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aid="appendix.porting.build_hacking"></a>Configure and Build Hacking</h2></div></div></div><divclass="section"><divclass="titlepage"><div><div><h3class="title"><aid="build_hacking.prereq"></a>Prerequisites</h3></div></div></div><p>
As noted <aclass="link"href="http://gcc.gnu.org/install/prerequisites.html"target="_top">previously</a>,
The configure process begins the act of building libstdc++, and is
started via:
</p><preclass="screen">
<codeclass="computeroutput">
configure
</code>
</pre><p>
The <codeclass="filename">configure</code> file is a script generated (via
<spanclass="command"><strong>autoconf</strong></span>) from the file
<codeclass="filename">configure.ac</code>.
</p><p>
After the configure process is complete,
</p><preclass="screen">
<codeclass="computeroutput">
make all
</code>
</pre><p>
in the build directory starts the build process. The <codeclass="literal">all</code> target comes from the <codeclass="filename">Makefile</code> file, which is generated via <spanclass="command"><strong>configure</strong></span> from the <codeclass="filename">Makefile.in</code> file, which is in turn generated (via
<spanclass="command"><strong>automake</strong></span>) from the file
</p></div><divclass="section"><divclass="titlepage"><div><div><h4class="title"><aid="build_hacking.overview.map"></a>What Comes from Where</h4></div></div></div><divclass="figure"><aid="fig.build_hacking.deps"></a><pclass="title"><strong>FigureB.1.Configure and Build File Dependencies</strong></p><divclass="figure-contents"><divclass="mediaobject"align="center"><imgsrc="../images/confdeps.png"align="middle"alt="Dependency Graph for Configure and Build Files"/></div></div></div><brclass="figure-break"/><p>
Regenerate all generated files by using the command
<codeclass="code">autoreconf</code> at the top level of the libstdc++ source
directory.
</p></div></div><divclass="section"><divclass="titlepage"><div><div><h3class="title"><aid="build_hacking.configure"></a>Configure</h3></div></div></div><divclass="section"><divclass="titlepage"><div><div><h4class="title"><aid="build_hacking.configure.scripts"></a>Storing Information in non-AC files (like configure.host)</h4></div></div></div><p>
</p></div><divclass="section"><divclass="titlepage"><div><div><h4class="title"><aid="build_hacking.configure.conventions"></a>Coding and Commenting Conventions</h4></div></div></div><p>
</p></div><divclass="section"><divclass="titlepage"><div><div><h4class="title"><aid="build_hacking.configure.enable"></a><codeclass="constant">GLIBCXX_ENABLE</code>, the <codeclass="literal">--enable</code> maker</h4></div></div></div><p>
All the <codeclass="literal">GLIBCXX_ENABLE_FOO</code> macros use a common
helper, <codeclass="literal">GLIBCXX_ENABLE</code>. (You don't have to use
it, but it's easy.) The helper does two things for us:
They're called <aclass="link"href="http://www.gnu.org/software/autoconf/manual/autoconf.html#Quadrigraphs"target="_top"><spanclass="emphasis"><em>quadrigraphs</em></span></a>