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