summaryrefslogtreecommitdiffstats
path: root/doc/build/doing_build.rst
blob: 3c686cc71665e9af2b329e39cf532f04bc15463f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
Doing the build
===============

Using autoconf
--------------

(If you are not a developer, you can skip this section.)

In the Kerberos V5 source directory, there is a configure script which
automatically determines the compilation environment and creates the
proper Makefiles for a particular platform.  This configure script is
generated using autoconf, which you should already have installed.

Normal users will not need to worry about running autoconf; the
distribution comes with the configure script already prebuilt.

One tool which is provided for the convenience of developers can be
found in ``src/util/reconf``.  This program should be run while the
current directory is the top source directory.  It will automatically
rebuild the configure script if it needs rebuilding.  If you know that
you have made a change that will require that the configure file be
rebuilt from scratch, specify the **-**\ **-force** option::

    cd /u1/krb5-VERSION/src
    ./util/reconf --force

Then follow the instructions for building packaged source trees
(below).  To install the binaries into a binary tree, do::

    cd /u1/krb5-VERSION/src
    make all
    make install DESTDIR=somewhere-else

You have a number of different options in how to build Kerberos.

.. _do_build:

Building within a single tree
-----------------------------

If you only need to build Kerberos for one platform, using a single
directory tree which contains both the source files and the object
files is the simplest.  However, if you need to maintain Kerberos for
a large number of platforms, you will probably want to use separate
build trees for each platform.  We recommend that you look at OS
Incompatibilities, for notes that we have on particular operating
systems.

If you don't want separate build trees for each architecture, then use
the following abbreviated procedure::

    cd /u1/krb5-VERSION/src
    ./configure
    make

That's it!

Building with separate build directories
----------------------------------------

If you wish to keep separate build directories for each platform, you
can do so using the following procedure.  (Note, this requires that
your make program support VPATH.  GNU's make will provide this
functionality, for example.)  If your make program does not support
this, see the next section.

For example, if you wish to store the binaries in ``tmpbuild`` build
directory you might use the following procedure::

   mkdir /u1/tmpbuild
   cd /u1/tmpbuild
   /u1/krb5-VERSION/src/configure
   make


Building using lndir
--------------------

If you wish to keep separate build directories for each platform, and
you do not have access to a make program which supports VPATH, all is
not lost.  You can use the lndir program to create symbolic link trees
in your build directory.

For example, if you wish to create a build directory for solaris
binaries you might use the following procedure::

    mkdir /u1/krb5-VERSION/solaris
    cd /u1/krb5-VERSION/solaris
    /u1/krb5-VERSION/src/util/lndir `pwd`/../src
    ./configure
    make

You must give an absolute pathname to lndir because it has a bug that
makes it fail for relative pathnames.  Note that this version differs
from the latest version as distributed and installed by the
XConsortium with X11R6.  Either version should be acceptable.


Installing the binaries
-----------------------

Once you have built Kerberos, you should install the binaries. You can
do this by running::

    make install

If you want to install the binaries into a destination directory that
is not their final destination, which may be convenient if you want to
build a binary distribution to be deployed on multiple hosts, you may
use::

    make install DESTDIR=/path/to/destdir

This will install the binaries under *DESTDIR/PREFIX*, e.g., the user
programs will install into *DESTDIR/PREFIX/bin*, the libraries into
*DESTDIR/PREFIX/lib*, etc.

Some implementations of make allow multiple commands to be run in
parallel, for faster builds.  We test our Makefiles in parallel builds
with GNU make only; they may not be compatible with other parallel
build implementations.


Testing the build
-----------------

The Kerberos V5 distribution comes with built-in regression tests.  To
run them, simply type the following command while in the top-level
build directory (i.e., the directory where you sent typed make to
start building Kerberos; see :ref:`do_build`)::

    make check

However, there are several prerequisites that must be satisfied first:

* Configure and build Kerberos with Tcl support. Tcl is used to drive
  the test suite.  This often means passing **-**\ **-with-tcl** to
  configure to tell it the location of the Tcl configuration
  script. (See :ref:`options2configure`.)
* In addition to Tcl, DejaGnu must be available on the system for some
  of the tests to run.  The test suite will still run the other tests
  if DejaGnu is not present, but the test coverage will be reduced
  accordingly.
* On some operating systems, you have to run ``make install`` before
  running ``make check``, or the test suite will pick up installed
  versions of Kerberos libraries rather than the newly built ones.
  You can install into a prefix that isn't in the system library
  search path, though. Alternatively, you can configure with
  **-**\ **-disable-rpath**, which renders the build tree less suitable for
  installation, but allows testing without interference from
  previously installed libraries.

There are additional regression tests available, which are not run
by ``make check``.  These tests require manual setup and teardown of
support infrastructure which is not easily automated, or require
excessive resources for ordinary use.  The procedure for running
the manual tests is documented at
http://k5wiki.kerberos.org/wiki/Manual_Testing.


Cleaning up the build
---------------------

* Use ``make clean`` to remove all files generated by running make
  command.
* Use ``make distclean`` to remove all files generated by running
  ./configure script.  After running ``make distclean`` your source
  tree (ideally) should look like the raw (just un-tarred) source tree
  with executed ``util/reconf`` command.