Skip to content

Building and installing

le photograveur edited this page Jun 10, 2023 · 12 revisions

Heimdal uses GNU Autoconf to configure for specific hosts, and GNU Automake to manage makefiles. If this is new to you the short instruction is to run the configure script in the top level directory and when that finishes make. If you want to build the distribution in a different directory from the source directory, you will need a make that implements VPATH correctly, such as GNU make.

System requirements to build the distribution

  • A compiler that supports a “loose” ANSI C mode, such as gcc or clang
  • lex or flex
  • awk
  • yacc or (yacc via) bison
  • a socket library
  • Berkeley DB or any of the BDB replacements for building the server side. NDBM on Solaris does not support large data, so there is no write support for NDBM any longer.
  • Perl with JSON.pm
  • Python

Building

If everything is in place:

$ sh autogen.sh  # if building from git
$ ./configure
$ make

When everything is built, you can install by doing

$ make install

The default location for installation is /usr/heimdal, but this can be changed by running ./configure with --prefix argument.

$ ./configure --prefix=/some/other/place

If you need to change the default behavior, configure understands the following options:

  • --without-berkeley-db: DB is preferred before NDBM, but if you for some reason want to use NDBM instead, you can use this option.
  • --disable-otp: By default some of the application programs will build with support for one-time passwords (OTP). Use this option to disable that support.
  • --with-readline=dir: Gives the path for the GNU Readline library, which will be used in some programs. If no readline library is found, the (simpler) editline library will be used instead.
  • --with-hesiod=dir Enables hesiod support in push.
  • --without-ipv6 Disable the IPv6 support.
  • --with-openldap Compile Heimdal with support for storing the database in LDAP. Requires OpenLDAP.
  • --enable-bigendian or --enable-littleendian: Normally, the build process will figure out by itself if the machine is big or little endian. It might fail in some cases when cross-compiling. If it does fail to figure it out, use the relevant of these two options.
  • --disable-mmap: Do not use the mmap system call. Normally, configure detects if there is a working mmap and it is only used if there is one. Only try this option if it fails to work anyhow.

Cross compiling Heimdal NetBSD/evbarm on NetBSD/i386

This description uses NetBSD® as a guide to cross compile Heimdal. We use NetBSD to show how do do it because NetBSD is very friendly to cross compilers.

We assume you are running as root on a i386 installation for simplicity.

  1. Download NetBSD evbarm packages for base.tgz and comp.tgz and unpack them:
    $ mkdir /root/evbarm
    $ for a in base comp ; do \
        ftp http://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.1/evbarm/binary/sets/$a.tgz; \
        $ tar zxCf /root/evbarm $a.tgz ; \
      done
    
  2. Download NetBSD compiler source packages: src.tgz, gnusrc.tgz, sharesrc.tgz, syssrc.tgz
    $ for a in src gnusrc sharesrc syssrc ; do \ 
        ftp http://ftp.netbsd.org/pub/NetBSD/NetBSD-5.0.1/source/sets/$a.tgz; \
        tar xvCf / $a.tgz; \
      done
    
  3. Build cross compiler:
    $ mkdir /usr/obj
    $ cd /usr/src
    $ ./build.sh -m evbarm tools
    
  4. Add tools to PATH
    $ PATH=/usr/src/tooldir.NetBSD-5.0.1-i386/bin:$PATH
    
  5. Get Heimdal source:
    $ cd
    $ git clone git://svn.h5l.org/heimdal.git
    $ cd heimdal
    $ autoreconf -f -i
    
  6. Build native Heimdal, builds needed tools
    $ mkdir native
    $ cd native
    $ ../configure --prefix=/usr/heimdal
    $ make
    $ make install
    $ cd ..
    $ cp /usr/heimdal/bin/compile_et /usr/heimdal/libexec/heimdal/
    
  7. Cross compile Heimdal and install. The -XCClinker and perl snipet is to convince libtool to cross compile properly.
    $ mkdir evbarm
    $ cd evbarm
    $ ../configure --disable-shared --prefix=/usr/heimdal --host=arm--netbsdelf \
        --with-cross-tools=/usr/heimdal/libexec/heimdal
        CPPFLAGS='-nostdinc -isystem /root/evbarm/usr/include' \
        LDFLAGS='-XCClinker -B/root/evbarm/usr/lib'
    $ perl -pi -e 's@(^sys_lib_search_path .*)"$\1 /root/evbarm/usr/lib"' libtool
    $ make
    $ make install DESTDIR=/root/evbarm
    $ file /root/evbarm/usr/heimdal/bin/kinit
    
Clone this wiki locally