From K5Wiki
Revision as of 13:26, 22 December 2015 by Ghudson (talk | contribs) (Building from checked-out sources)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

There are several ways to build the MIT Kerberos source distribution for Linux and Unix operating systems. You can build starting from a source code tar file of a formal release, from a daily snapshot tar file, or from sources that you directly check out from the Subversion repository. Generally, end users will build from formal release tar files (or snapshots if they are adventurous), while only developers will build from checked-out sources. Naturally, building from checked-out sources is somewhat more involved, both procedurally and in terms of prerequisites.

Additionally, you may run the test suite, or build in maintainer mode, both of which have additional prerequisites. Maintainer mode allows for updates or rebuilds of elements not normally touched by the build process, such as regeneration of Makefile dependencies.

For more detailed build instructions (though possibly omitting some information on this wiki page), there is the krb5-1.7 install guide.


Required software packages are listed below by their Debian / Ubuntu package names; other OSes may have different names for these packages.

Basic build requirements

The following are build requirements that might not be present on all OS installations if only basic C development tools are installed.

  • byacc or bison (for getdate.y and FTP daemon)
  • ncurses-dev (for some of the BSD applications)
  • perl

Additional requirements for building from checked-out source

  • autoconf

Additional requirements for running "make check"

There are additional requirements for running "make check"; see Test suite for details.

Additional requirements for maintainer mode

  • bison (needed to regenerate some checked-in YACC-based source files)
  • gcc (and not some other compiler; needed for "make depend")

While not an issue for GNU platforms, GNU Make is required for some maintainer mode functionality if the platform's native "make" program is not GNU Make.

Building into a separate build directory

Often, especially when building in maintainer mode, it is best to build in a separate directory that is not the source directory. For correct functioning, some maintainer mode operations require that you build in a directory separate from the source tree.

To begin a build in a separate build directory, invoke configure from an empty directory outside of the source tree. configure will proceed to create all the required subdirectories and Makefiles, after which you can run make.

For example, if you unpacked a krb5-current snapshot into /var/src/krb5-current, you might do:

cd /var/src/krb5-current
mkdir build
cd build

Both relative paths and absolute paths to the configure script will work. configure will examine the pathname used to invoke it to deduce the locations of everything in the source tree it needs.

Building in a separate build directory when there are build products already in the source tree will probably fail in strange ways.

Building from checked-out sources

Building the core MIT Kerberos software from checked-out source requires additional steps than building from a release tarball. Among other things, configure scripts are not checked into the repository.

Make sure you have GNU autoconf installed, then run

cd src

This will create the configure scripts, allowing you to actually configure and build the source tree.

Maintainer mode

To build in maintainer mode, invoke the configure script like

.../configure --enable-maintainer-mode

This will activate some maintainer-specific Makefile rules, including automatic rebuilding of configure scripts and Makefiles.