logo_kerberos.gif

Difference between revisions of "Building"

From K5Wiki
Jump to: navigation, search
(New page: 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 ...)
 
(Building from checked-out sources)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  +
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 [http://web.mit.edu/kerberos/krb5-1.7/krb5-1.7/doc/krb5-install.html krb5-1.7 install guide].
  +
  +
== Prerequisites ==
  +
  +
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 <code>configure</code> from an empty directory outside of the source tree. <code>configure</code> will proceed to create all the required subdirectories and Makefiles, after which you can run <code>make</code>.
  +
  +
For example, if you unpacked a krb5-current snapshot into <code>/var/src/krb5-current</code>, you might do:
  +
  +
<pre>
  +
cd /var/src/krb5-current
  +
mkdir build
  +
cd build
  +
../src/configure
  +
</pre>
  +
  +
Both relative paths and absolute paths to the configure script will work. <code>configure</code> 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.
 
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.
   
Line 5: Line 59:
 
<pre>
 
<pre>
 
cd src
 
cd src
./util/reconf
 
  +
autoreconf
 
</pre>
 
</pre>
   
 
This will create the configure scripts, allowing you to actually configure and build the source tree.
 
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
  +
  +
<pre>
  +
.../configure --enable-maintainer-mode
  +
</pre>
  +
  +
This will activate some maintainer-specific Makefile rules, including automatic rebuilding of configure scripts and Makefiles.
   
 
[[Category:Lore]]
 
[[Category:Lore]]

Latest revision as of 12:26, 22 December 2015

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.

Prerequisites

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
../src/configure

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
autoreconf

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.