Imported Upstream version 1.20.1
[platform/upstream/krb5.git] / doc / html / build / doing_build.html
1
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml">
6   <head>
7     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8     <title>Doing the build &#8212; MIT Kerberos Documentation</title>
9     <link rel="stylesheet" href="../_static/agogo.css" type="text/css" />
10     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
11     <link rel="stylesheet" href="../_static/kerb.css" type="text/css" />
12     <script type="text/javascript">
13       var DOCUMENTATION_OPTIONS = {
14         URL_ROOT:    '../',
15         VERSION:     '1.20.1',
16         COLLAPSE_INDEX: false,
17         FILE_SUFFIX: '.html',
18         HAS_SOURCE:  true,
19         SOURCELINK_SUFFIX: '.txt'
20       };
21     </script>
22     <script type="text/javascript" src="../_static/jquery.js"></script>
23     <script type="text/javascript" src="../_static/underscore.js"></script>
24     <script type="text/javascript" src="../_static/doctools.js"></script>
25     <link rel="author" title="About these documents" href="../about.html" />
26     <link rel="index" title="Index" href="../genindex.html" />
27     <link rel="search" title="Search" href="../search.html" />
28     <link rel="copyright" title="Copyright" href="../copyright.html" />
29     <link rel="next" title="Options to configure" href="options2configure.html" />
30     <link rel="prev" title="Organization of the source directory" href="directory_org.html" /> 
31   </head>
32   <body>
33     <div class="header-wrapper">
34         <div class="header">
35             
36             
37             <h1><a href="../index.html">MIT Kerberos Documentation</a></h1>
38             
39             <div class="rel">
40                 
41         <a href="../index.html" title="Full Table of Contents"
42             accesskey="C">Contents</a> |
43         <a href="directory_org.html" title="Organization of the source directory"
44             accesskey="P">previous</a> |
45         <a href="options2configure.html" title="Options to configure"
46             accesskey="N">next</a> |
47         <a href="../genindex.html" title="General Index"
48             accesskey="I">index</a> |
49         <a href="../search.html" title="Enter search criteria"
50             accesskey="S">Search</a> |
51     <a href="mailto:krb5-bugs@mit.edu?subject=Documentation__Doing the build">feedback</a>
52             </div>
53         </div>
54     </div>
55
56     <div class="content-wrapper">
57       <div class="content">
58         <div class="document">
59             
60       <div class="documentwrapper">
61         <div class="bodywrapper">
62           <div class="body" role="main">
63             
64   <div class="section" id="doing-the-build">
65 <h1>Doing the build<a class="headerlink" href="#doing-the-build" title="Permalink to this headline">¶</a></h1>
66 <div class="section" id="building-within-a-single-tree">
67 <span id="do-build"></span><h2>Building within a single tree<a class="headerlink" href="#building-within-a-single-tree" title="Permalink to this headline">¶</a></h2>
68 <p>If you only need to build Kerberos for one platform, using a single
69 directory tree which contains both the source files and the object
70 files is the simplest.  However, if you need to maintain Kerberos for
71 a large number of platforms, you will probably want to use separate
72 build trees for each platform.  We recommend that you look at OS
73 Incompatibilities, for notes that we have on particular operating
74 systems.</p>
75 <p>If you don’t want separate build trees for each architecture, then use
76 the following abbreviated procedure:</p>
77 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">/</span><span class="n">u1</span><span class="o">/</span><span class="n">krb5</span><span class="o">-</span><span class="n">VERSION</span><span class="o">/</span><span class="n">src</span>
78 <span class="o">./</span><span class="n">configure</span>
79 <span class="n">make</span>
80 </pre></div>
81 </div>
82 <p>That’s it!</p>
83 </div>
84 <div class="section" id="building-with-separate-build-directories">
85 <h2>Building with separate build directories<a class="headerlink" href="#building-with-separate-build-directories" title="Permalink to this headline">¶</a></h2>
86 <p>If you wish to keep separate build directories for each platform, you
87 can do so using the following procedure.  (Note, this requires that
88 your make program support VPATH.  GNU’s make will provide this
89 functionality, for example.)  If your make program does not support
90 this, see the next section.</p>
91 <p>For example, if you wish to store the binaries in <code class="docutils literal"><span class="pre">tmpbuild</span></code> build
92 directory you might use the following procedure:</p>
93 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">mkdir</span> <span class="o">/</span><span class="n">u1</span><span class="o">/</span><span class="n">tmpbuild</span>
94 <span class="n">cd</span> <span class="o">/</span><span class="n">u1</span><span class="o">/</span><span class="n">tmpbuild</span>
95 <span class="o">/</span><span class="n">u1</span><span class="o">/</span><span class="n">krb5</span><span class="o">-</span><span class="n">VERSION</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">configure</span>
96 <span class="n">make</span>
97 </pre></div>
98 </div>
99 </div>
100 <div class="section" id="building-using-lndir">
101 <h2>Building using lndir<a class="headerlink" href="#building-using-lndir" title="Permalink to this headline">¶</a></h2>
102 <p>If you wish to keep separate build directories for each platform, and
103 you do not have access to a make program which supports VPATH, all is
104 not lost.  You can use the lndir program to create symbolic link trees
105 in your build directory.</p>
106 <p>For example, if you wish to create a build directory for solaris
107 binaries you might use the following procedure:</p>
108 <div class="highlight-default"><div class="highlight"><pre><span></span>mkdir /u1/krb5-VERSION/solaris
109 cd /u1/krb5-VERSION/solaris
110 /u1/krb5-VERSION/src/util/lndir `pwd`/../src
111 ./configure
112 make
113 </pre></div>
114 </div>
115 <p>You must give an absolute pathname to lndir because it has a bug that
116 makes it fail for relative pathnames.  Note that this version differs
117 from the latest version as distributed and installed by the
118 XConsortium with X11R6.  Either version should be acceptable.</p>
119 </div>
120 <div class="section" id="installing-the-binaries">
121 <h2>Installing the binaries<a class="headerlink" href="#installing-the-binaries" title="Permalink to this headline">¶</a></h2>
122 <p>Once you have built Kerberos, you should install the binaries. You can
123 do this by running:</p>
124 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">install</span>
125 </pre></div>
126 </div>
127 <p>If you want to install the binaries into a destination directory that
128 is not their final destination, which may be convenient if you want to
129 build a binary distribution to be deployed on multiple hosts, you may
130 use:</p>
131 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">install</span> <span class="n">DESTDIR</span><span class="o">=/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">destdir</span>
132 </pre></div>
133 </div>
134 <p>This will install the binaries under <em>DESTDIR/PREFIX</em>, e.g., the user
135 programs will install into <em>DESTDIR/PREFIX/bin</em>, the libraries into
136 <em>DESTDIR/PREFIX/lib</em>, etc.  <em>DESTDIR</em> must be an absolute path.</p>
137 <p>Some implementations of make allow multiple commands to be run in
138 parallel, for faster builds.  We test our Makefiles in parallel builds
139 with GNU make only; they may not be compatible with other parallel
140 build implementations.</p>
141 </div>
142 <div class="section" id="testing-the-build">
143 <h2>Testing the build<a class="headerlink" href="#testing-the-build" title="Permalink to this headline">¶</a></h2>
144 <p>The Kerberos V5 distribution comes with built-in regression tests.  To
145 run them, simply type the following command while in the top-level
146 build directory (i.e., the directory where you sent typed make to
147 start building Kerberos; see <a class="reference internal" href="#do-build"><span class="std std-ref">Building within a single tree</span></a>):</p>
148 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">check</span>
149 </pre></div>
150 </div>
151 <p>On some operating systems, you have to run <code class="docutils literal"><span class="pre">make</span> <span class="pre">install</span></code> before
152 running <code class="docutils literal"><span class="pre">make</span> <span class="pre">check</span></code>, or the test suite will pick up installed
153 versions of Kerberos libraries rather than the newly built ones.  You
154 can install into a prefix that isn’t in the system library search
155 path, though.  Alternatively, you can configure with
156 <strong>-</strong><strong>-disable-rpath</strong>, which renders the build tree less suitable
157 for installation, but allows testing without interference from
158 previously installed libraries.</p>
159 <p>There are additional regression tests available, which are not run
160 by <code class="docutils literal"><span class="pre">make</span> <span class="pre">check</span></code>.  These tests require manual setup and teardown of
161 support infrastructure which is not easily automated, or require
162 excessive resources for ordinary use.  The procedure for running
163 the manual tests is documented at
164 <a class="reference external" href="https://k5wiki.kerberos.org/wiki/Manual_Testing">https://k5wiki.kerberos.org/wiki/Manual_Testing</a>.</p>
165 </div>
166 <div class="section" id="cleaning-up-the-build">
167 <h2>Cleaning up the build<a class="headerlink" href="#cleaning-up-the-build" title="Permalink to this headline">¶</a></h2>
168 <ul class="simple">
169 <li>Use <code class="docutils literal"><span class="pre">make</span> <span class="pre">clean</span></code> to remove all files generated by running make
170 command.</li>
171 <li>Use <code class="docutils literal"><span class="pre">make</span> <span class="pre">distclean</span></code> to remove all files generated by running
172 ./configure script.  After running <code class="docutils literal"><span class="pre">make</span> <span class="pre">distclean</span></code> your source
173 tree (ideally) should look like the raw (just un-tarred) source
174 tree.</li>
175 </ul>
176 </div>
177 <div class="section" id="using-autoconf">
178 <h2>Using autoconf<a class="headerlink" href="#using-autoconf" title="Permalink to this headline">¶</a></h2>
179 <p>(If you are not a developer, you can ignore this section.)</p>
180 <p>In the Kerberos V5 source directory, there is a configure script which
181 automatically determines the compilation environment and creates the
182 proper Makefiles for a particular platform.  This configure script is
183 generated using autoconf, which you should already have installed if
184 you will be making changes to <code class="docutils literal"><span class="pre">src/configure.in</span></code>.</p>
185 <p>Normal users will not need to worry about running autoconf; the
186 distribution comes with the configure script already prebuilt.</p>
187 <p>The autoconf package comes with a script called <code class="docutils literal"><span class="pre">autoreconf</span></code> that
188 will automatically run <code class="docutils literal"><span class="pre">autoconf</span></code> and <code class="docutils literal"><span class="pre">autoheader</span></code> as needed.  You
189 should run <code class="docutils literal"><span class="pre">autoreconf</span></code> from the top source directory, e.g.:</p>
190 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="o">/</span><span class="n">u1</span><span class="o">/</span><span class="n">krb5</span><span class="o">-</span><span class="n">VERSION</span><span class="o">/</span><span class="n">src</span>
191 <span class="n">autoreconf</span> <span class="o">--</span><span class="n">verbose</span>
192 </pre></div>
193 </div>
194 </div>
195 </div>
196
197
198           </div>
199         </div>
200       </div>
201         </div>
202         <div class="sidebar">
203     <h2>On this page</h2>
204     <ul>
205 <li><a class="reference internal" href="#">Doing the build</a><ul>
206 <li><a class="reference internal" href="#building-within-a-single-tree">Building within a single tree</a></li>
207 <li><a class="reference internal" href="#building-with-separate-build-directories">Building with separate build directories</a></li>
208 <li><a class="reference internal" href="#building-using-lndir">Building using lndir</a></li>
209 <li><a class="reference internal" href="#installing-the-binaries">Installing the binaries</a></li>
210 <li><a class="reference internal" href="#testing-the-build">Testing the build</a></li>
211 <li><a class="reference internal" href="#cleaning-up-the-build">Cleaning up the build</a></li>
212 <li><a class="reference internal" href="#using-autoconf">Using autoconf</a></li>
213 </ul>
214 </li>
215 </ul>
216
217     <br/>
218     <h2>Table of contents</h2>
219     <ul class="current">
220 <li class="toctree-l1"><a class="reference internal" href="../user/index.html">For users</a></li>
221 <li class="toctree-l1"><a class="reference internal" href="../admin/index.html">For administrators</a></li>
222 <li class="toctree-l1"><a class="reference internal" href="../appdev/index.html">For application developers</a></li>
223 <li class="toctree-l1"><a class="reference internal" href="../plugindev/index.html">For plugin module developers</a></li>
224 <li class="toctree-l1 current"><a class="reference internal" href="index.html">Building Kerberos V5</a><ul class="current">
225 <li class="toctree-l2"><a class="reference internal" href="directory_org.html">Organization of the source directory</a></li>
226 <li class="toctree-l2 current"><a class="current reference internal" href="#">Doing the build</a></li>
227 <li class="toctree-l2"><a class="reference internal" href="options2configure.html">Options to <em>configure</em></a></li>
228 <li class="toctree-l2"><a class="reference internal" href="osconf.html">osconf.hin</a></li>
229 </ul>
230 </li>
231 <li class="toctree-l1"><a class="reference internal" href="../basic/index.html">Kerberos V5 concepts</a></li>
232 <li class="toctree-l1"><a class="reference internal" href="../formats/index.html">Protocols and file formats</a></li>
233 <li class="toctree-l1"><a class="reference internal" href="../mitK5features.html">MIT Kerberos features</a></li>
234 <li class="toctree-l1"><a class="reference internal" href="../build_this.html">How to build this documentation from the source</a></li>
235 <li class="toctree-l1"><a class="reference internal" href="../about.html">Contributing to the MIT Kerberos Documentation</a></li>
236 <li class="toctree-l1"><a class="reference internal" href="../resources.html">Resources</a></li>
237 </ul>
238
239     <br/>
240     <h4><a href="../index.html">Full Table of Contents</a></h4>
241     <h4>Search</h4>
242     <form class="search" action="../search.html" method="get">
243       <input type="text" name="q" size="18" />
244       <input type="submit" value="Go" />
245       <input type="hidden" name="check_keywords" value="yes" />
246       <input type="hidden" name="area" value="default" />
247     </form>
248         </div>
249         <div class="clearer"></div>
250       </div>
251     </div>
252
253     <div class="footer-wrapper">
254         <div class="footer" >
255             <div class="right" ><i>Release: 1.20.1</i><br />
256                 &copy; <a href="../copyright.html">Copyright</a> 1985-2022, MIT.
257             </div>
258             <div class="left">
259                 
260         <a href="../index.html" title="Full Table of Contents"
261             >Contents</a> |
262         <a href="directory_org.html" title="Organization of the source directory"
263             >previous</a> |
264         <a href="options2configure.html" title="Options to configure"
265             >next</a> |
266         <a href="../genindex.html" title="General Index"
267             >index</a> |
268         <a href="../search.html" title="Enter search criteria"
269             >Search</a> |
270     <a href="mailto:krb5-bugs@mit.edu?subject=Documentation__Doing the build">feedback</a>
271             </div>
272         </div>
273     </div>
274
275   </body>
276 </html>