Delete references to --with-system-db from README
[krb5.git] / doc / build.texinfo
1 @value{PRODUCT} uses a configuration system built using the Free
2 Software Foundation's @samp{autoconf} program.  This system makes
3 Kerberos V5 much simpler to build and reduces the amount of effort
4 required in porting Kerberos V5 to a new platform.
5
6 @menu
7 * Organization of the Source Directory::  Description of the source tree.
8 * Build Requirements::          How much disk space, etc. you need to
9                                            build Kerberos.
10 * Unpacking the Sources::       Preparing the source tree.
11 * Doing the Build::             Compiling Kerberos.
12 * Testing the Build::           Making sure Kerberos built correctly.
13 * Options to Configure::        Command-line options to Configure
14 * osconf.h::                    Header file-specific configurations
15 * Shared Library Support::      Building Shared Libraries for Kerberos V5
16 * OS Incompatibilities::        Special cases to watch for.
17 * Using Autoconf::              Modifying Kerberos V5's 
18                                             configuration scripts.
19 @end menu
20
21 @node Organization of the Source Directory, Build Requirements, Building Kerberos V5, Building Kerberos V5
22 @section Build Requirements
23
24 Below is a brief overview of the organization of the complete source
25 directory.  More detailed descriptions follow.
26
27 @table @b
28 @itemx appl
29 applications with @value{PRODUCT} extensions
30 @itemx clients
31 @value{PRODUCT} user programs
32 @itemx gen-manpages
33 manpages for @value{PRODUCT} and the @value{PRODUCT} login program
34 @itemx include
35 include files
36 @itemx kadmin
37 administrative interface to the Kerberos master database
38 @itemx kdc
39 the @value{PRODUCT} Authentication Service and Key Distribution Center
40 @itemx krb524
41 utilities for converting between Kerberos 4 and Kerberos 5
42 @itemx lib
43 libraries for use with/by @value{PRODUCT}
44 @itemx mac
45 source code for building @value{PRODUCT} on MacOS
46 @itemx prototype
47 templates for source code files
48 @itemx slave
49 utilities for propagating the database to slave KDCs
50 @itemx tests
51 test suite
52 @itemx util
53 various utilities for building/configuring the code, sending bug reports, etc.
54 @itemx windows
55 source code for building @value{PRODUCT} on Windows (see windows/README)
56 @end table
57
58 @menu
59 * The appl Directory::          
60 * The clients Directory::
61 * The gen-manpages Directory::
62 * The include Directory::
63 * The kadmin Directory::        
64 * The kdc Directory::           
65 * The krb524 Directory::        
66 * The lib Directory::
67 * The prototype Directory::
68 * The slave Directory::
69 * The util Directory::          
70 @end menu
71
72 @node The appl Directory, The clients Directory, Organization of the Source Directory, Organization of the Source Directory
73 @subsection The appl Directory
74
75 The Kerberos release provides certain UNIX utilities, modified to use
76 Kerberos authentication.  In the @i{appl/bsd} directory are the
77 Berkeley utilities @i{login}, @i{rlogin}, @i{rsh}, and @i{rcp}, as well as
78 the associated daemons @i{kshd} and @i{klogind}.  The @i{login} program
79 obtains ticket-granting tickets for users upon login; the other utilities
80 provide authenticated Unix network services.
81
82 The @i{appl} directory also contains Kerberized telnet and ftp programs,
83 as well as sample Kerberos application client and server programs.
84
85 @node The clients Directory, The gen-manpages Directory, The appl Directory, Organization of the Source Directory
86 @subsection The clients Directory
87
88 This directory contains the code for several user-oriented programs.
89
90 @table @b
91 @itemx kdestroy
92 This program destroys the user's active Kerberos authorization tickets.
93 @value{COMPANY} recommends that users @code{kdestroy} before logging out.
94
95 @itemx kinit
96 This program prompts users for their Kerberos principal name and password,
97 and attempts to get an initial ticket-granting-ticket for that principal.
98
99 @itemx klist
100 This program lists the Kerberos principal and Kerberos tickets held in
101 a credentials cache, or the keys held in a keytab file.
102
103 @itemx kpasswd
104 This program changes a user's Kerberos password.
105
106 @itemx ksu
107 This program is a Kerberized verions of the @code{su} program that is
108 meant to securely change the real and effective user ID to that of the
109 target user and to create a new security context.
110
111 @itemx kvno
112 This program acquires a service ticket for the specified Kerberos
113 principals and prints out the key version numbers of each.
114 @end table
115
116 @node The gen-manpages Directory, The include Directory, The clients Directory, Organization of the Source Directory
117 @subsection The gen-manpages Directory
118
119 There are two manual pages in this directory.  One is an introduction
120 to the Kerberos system.  The other describes the @code{.k5login} file
121 which allows users to give access with their UID to other users
122 authenticated by the Kerberos system.
123
124 @node The include Directory, The kadmin Directory, The gen-manpages Directory, Organization of the Source Directory
125 @subsection The include Directory
126
127 This directory contains the @i{include} files needed to build the
128 Kerberos system.
129
130 @node The kadmin Directory, The kdc Directory, The include Directory, Organization of the Source Directory
131 @subsection The kadmin Directory
132
133 In this directory is the code for the utilities @code{kadmin},
134 @code{kadmin.local}, @code{kdb5_util}, and @code{ktutil}.
135 @code{ktutil} is the Kerberos keytab file maintenance utility from
136 which a Kerberos administrator can read, write, or edit entries in a
137 Kerberos V5 keytab or Kerberos V4 srvtab.  @code{kadmin} and
138 @code{kadmin.local} are command-line interfaces to the Kerberos V5 KADM5
139 administration system.  @code{kadmin.local} runs on the master KDC and
140 does not use Kerberos to authenticate to the database, while
141 @code{kadmin} uses Kerberos authentication and an encrypted RPC.  The
142 two provide identical functionalities, which allow administrators to
143 modify the database of Kerberos principals.  @code{kdb5_util} allows
144 administrators to perform low-level maintenance procedures on Kerberos
145 and the KADM5 database.  With this utility, databases can be created,
146 destroyed, or dumped to and loaded from ASCII files.  It can also be
147 used to create master key stash files.
148
149 @node The kdc Directory, The krb524 Directory, The kadmin Directory, Organization of the Source Directory
150 @subsection The kdc Directory
151
152 This directory contains the code for the @code{krb5kdc} daemon, the
153 Kerberos Authentication Service and Key Distribution Center.
154
155 @node The krb524 Directory, The lib Directory, The kdc Directory, Organization of the Source Directory
156 @subsection The krb524 Directory
157
158 This directory contains the code for @code{krb524}, a service that
159 converts Kerberos V5 credentials into Kerberos V4 credentials suitable
160 for use with applications that for whatever reason do not use V5
161 directly.
162
163 @node The lib Directory, The prototype Directory, The krb524 Directory, Organization of the Source Directory
164 @subsection The lib Directory
165
166 The @i{lib} directory contain 10 subdirectories as well as some
167 definition and glue files.  The @i{crypto} subdirectory contains the
168 Kerberos V5 encryption library.  The @i{des425} subdirectory exports
169 the Kerberos V4 encryption API, and translates these functions into
170 calls to the Kerberos V5 encryption API.  The @i{gssapi} library
171 contains the Generic Security Services API, which is a library of
172 commands to be used in secure client-server communication.  The
173 @i{kadm5} directory contains the libraries for the KADM5 administration
174 utilities.  The Kerberos 5 database libraries are contained in
175 @i{kdb}.  The directories @i{krb4} and @i{krb5} contain the Kerberos 4
176 and Kerberos 5 APIs, respectively.  The @i{rpc} directory contains the
177 API for the Kerberos Remote Procedure Call protocol.
178
179 @node The prototype Directory, The slave Directory, The lib Directory, Organization of the Source Directory
180 @subsection The prototype Directory
181
182 This directory contains several template files.  The @code{prototype.h}
183 and @code{prototype.c} files contain the MIT copyright message and a
184 placeholder for the title and description of the file.
185 @code{prototype.h} also has a short template for writing @code{ifdef}
186 and @code{ifndef} preprocessor statements.  The @code{getopt.c} file
187 provides a template for writing code that will parse the options with
188 which a program was called.
189
190 @node The slave Directory, The util Directory, The prototype Directory, Organization of the Source Directory
191 @subsection The slave Directory
192
193 This directory contains code which allows for the propagation of the
194 Kerberos principal database from the master KDC to slave KDCs over an
195 encrypted, secure channel.  @code{kprop} is the program which actually
196 propagates the database dump file.  @code{kpropd} is the Kerberos V5
197 slave KDC update server which accepts connections from the @code{kprop}
198 program.  @code{kslave_update} is a script that takes the name of a
199 slave server, and propagates the database to that server if the
200 database has been modified since the last dump or if the database has
201 been dumped since the last propagation.
202
203 @node The util Directory,  , The slave Directory, Organization of the Source Directory
204 @subsection The util Directory
205
206 This directory contains several utility programs and libraries.  The
207 programs used to configure and build the code, such as @code{autoconf},
208 @code{lndir}, @code{kbuild}, @code{reconf},  and @code{makedepend},
209 are in this directory.  The @i{profile} directory contains most of the
210 functions which parse the Kerberos configuration files (@code{krb5.conf}
211 and @code{kdc.conf}).  Also in this directory are the Kerberos error table
212 library and utilities (@i{et}), the Sub-system library and utilities
213 (@i{ss}), database utilities (@i{db2}), pseudo-terminal utilities
214 (@i{pty}), and bug-reporting program @code{send-pr}.
215
216 @node Build Requirements, Unpacking the Sources, Organization of the Source Directory, Building Kerberos V5
217 @section Organization of the Source Directory
218
219 In order to build Kerberos V5, you will need approximately 60-70
220 megabytes of disk space.  The exact amount will vary depending on the
221 platform and whether the distribution is compiled with debugging symbol
222 tables or not.
223
224 If you wish to keep a separate @dfn{build tree}, which contains the compiled
225 @file{*.o} file and executables, separate from your source tree, you
226 will need a @samp{make} program which supports @samp{VPATH}, or
227 you will need to use a tool such as @samp{lndir} to produce a symbolic
228 link tree for your build tree.
229
230 @node Unpacking the Sources, Doing the Build, Build Requirements, Building Kerberos V5
231 @section Unpacking the Sources
232
233 The first step in each of these build procedures is to unpack the
234 source distribution.  The Kerberos V5 distribution comes in a tar file,
235 generally named @file{krb5-@value{RELEASE}.tar}, which contains a
236 compressed tar file consisting of the sources for all of Kerberos
237 (generally @file{krb5-@value{RELEASE}.tar.gz}) and a PGP signature for
238 this source tree (generally @file{krb5-@value{RELEASE}.tar.gz.asc}).
239 @value{COMPANY} highly recommends that you verify the integrity of the
240 source code using this signature.
241
242 Unpack the compressed tar file in some directory, such as
243 @file{/u1/krb5-@value{RELEASE}}.  (In the rest of this document, we
244 will assume that you have chosen to unpack the Kerberos V5 source
245 distribution in this directory.  Note that the tarfiles will by default
246 all unpack into the @file{./krb5-@value{RELEASE}} directory, so that if
247 your current directory is @file{/u1} when you unpack the tarfiles, you
248 will get @file{/u1/krb5-@value{RELEASE}/src}, etc.)
249
250
251 @node Doing the Build, Testing the Build, Unpacking the Sources, Building Kerberos V5
252 @section Doing the Build
253
254 You have a number of different options in how to build Kerberos.  If you
255 only need to build Kerberos for one platform, using a single directory
256 tree which contains both the source files and the object files is the
257 simplest.  However, if you need to maintain Kerberos for a large number
258 of platforms, you will probably want to use separate build trees for
259 each platform. We recommend that you look at @ref{OS
260 Incompatibilities}, for notes that we have on particular operating
261 systems. 
262
263 @menu
264 * Building Within a Single Tree::  
265 * Building with Separate Build Directories::  
266 * Building using lndir::        
267 @end menu
268
269 @node Building Within a Single Tree, Building with Separate Build Directories, Doing the Build, Doing the Build
270 @subsection Building Within a Single Tree
271
272 If you don't want separate build trees for each architecture, then
273 use the following abbreviated procedure.
274
275 @enumerate
276 @item
277  @code{cd /u1/krb5-@value{RELEASE}/src}
278 @item
279  @code{./configure}
280 @item
281  @code{make}
282 @end enumerate
283
284 That's it!
285
286 @node Building with Separate Build Directories, Building using lndir, Building Within a Single Tree, Doing the Build
287 @subsection Building with Separate Build Directories
288
289 If you wish to keep separate build directories for each platform, you
290 can do so using the following procedure.  (Note, this requires that your
291 @samp{make} program support @samp{VPATH}.  GNU's make will provide this
292 functionality, for example.)  If your @samp{make} program does not
293 support this, see the next section.
294
295 For example, if you wish to create a build directory for @code{pmax} binaries
296 you might use the following procedure:
297
298 @enumerate
299 @item 
300 @code{mkdir /u1/krb5-@value{RELEASE}/pmax}
301 @item
302  @code{cd /u1/krb5-@value{RELEASE}/pmax}
303 @item
304  @code{../src/configure}
305 @item
306  @code{make}
307 @end enumerate
308
309 @node Building using lndir,  , Building with Separate Build Directories, Doing the Build
310 @subsection Building Using @samp{lndir}
311
312 If you wish to keep separate build directories for each platform, and
313 you do not have access to a @samp{make} program which supports @samp{VPATH},
314 all is not lost.  You can use the @samp{lndir} program to create
315 symbolic link trees in your build directory.
316
317 For example, if you wish to create a build directory for solaris binaries
318 you might use the following procedure:
319
320 @enumerate
321 @item
322  @code{mkdir /u1/krb5-@value{RELEASE}/solaris}
323 @item
324  @code{cd /u1/krb5-@value{RELEASE}/solaris}
325 @item
326  @code{/u1/krb5-@value{RELEASE}/src/util/lndir `pwd`/../src}
327 @item
328  @code{./configure}
329 @item
330  @code{make}
331 @end enumerate
332
333 You must give an absolute pathname to @samp{lndir} because it has a bug that
334 makes it fail for relative pathnames. Note that this version differs
335 from the latest version as distributed and installed by the XConsortium
336 with X11R6. Either version should be acceptable.
337
338 @node Testing the Build, Options to Configure, Doing the Build, Building Kerberos V5
339 @section Testing the Build
340
341 The Kerberos V5 distribution comes with built-in regression tests.  To
342 run them, simply type the following command while in the top-level build
343 directory (i.e., the directory where you sent typed @samp{make} to start
344 building Kerberos; see @ref{Doing the Build}.): 
345
346 @example
347 % make check
348 @end example
349
350 @menu
351 * The DejaGnu Tests::           
352 * The KADM5 Tests::             
353 @end menu
354
355 @node The DejaGnu Tests, The KADM5 Tests, Testing the Build, Testing the Build
356 @subsection The DejaGnu Tests 
357
358 Some of the built-in regression tests are setup to use the DejaGnu
359 framework for running tests. These tests tend to be more comprehensive
360 than the normal built-in tests as they setup test servers and test
361 client/server activities. 
362
363 DejaGnu may be found wherever GNU software is archived.  
364
365 Most of the tests are setup to run as a non-privledged user.  For some
366 of the krb-root tests to work properly, either (a) the user running the
367 tests must not have a .k5login file in the home directory or (b) the
368 .k5login file must contain an entry for @code{<username>@@KRBTEST.COM}.
369 There are two series of tests (@samp{rlogind} and @samp{telnetd}) which
370 require the ability to @samp{rlogin} as root to the local
371 machine. Admittedly, this does require the use of a @file{.rhosts} file
372 or some authenticated means. @footnote{If you are fortunate enough to
373 have a previous version of Kerberos V5 or V4 installed, and the Kerberos
374 rlogin is first in your path, you can setup @file{.k5login} or
375 @file{.klogin} respectively to allow you access.}
376
377 If you cannot obtain root access to your machine, all the other tests
378 will still run. Note however, with DejaGnu 1.2, the "untested testcases"
379 will cause the testsuite to exit with a non-zero exit status which
380 @samp{make} will consider a failure of the testing process. Do not worry
381 about this, as these tests are the last run when @samp{make check} is
382 executed from the top level of the build tree.  This problem does not
383 exist with DejaGnu 1.3.
384
385 @node The KADM5 Tests,  , The DejaGnu Tests, Testing the Build
386 @subsection The KADM5 Tests
387
388 Regression tests for the KADM5 system, including the GSS-RPC, KADM5
389 client and server libraries, and kpasswd, are also included in this
390 release.  Each set of KADM5 tests is contained in a sub-directory called
391 @code{unit-test} directly below the system being tested.  For example,
392 lib/rpc/unit-test contains the tests for GSS-RPC.  The tests are all
393 based on DejaGnu (but they are not actually called part of "The DejaGnu
394 tests," whose naming predates the inclusion of the KADM5 system).  In
395 addition, they require the Tool Command Language (TCL) header files and
396 libraries to be available during compilation and some of the tests also
397 require Perl in order to operate.  If all of these resources are not
398 available during configuration, the KADM5 tests will not run.  The TCL
399 installation directory can be specified with the @code{--with-tcl}
400 configure option.  (See @xref{Options to Configure}.)  The runtest and
401 perl programs must be in the current execution path.
402
403 If you install DejaGnu, TCL, or Perl after configuring and building
404 Kerberos and then want to run the KADM5 tests, you will need to
405 re-configure the tree and run @code{make} at the top level again to make
406 sure all the proper programs are built.  To save time, you actually only
407 need to reconfigure and build in the directories src/kadmin/testing,
408 src/lib/rpc, src/lib/kadm5.
409
410 @node Options to Configure, osconf.h, Testing the Build, Building Kerberos V5
411 @section Options to Configure 
412
413 There are a number of options to @samp{configure} which you can use to
414 control how the Kerberos distribution is built.  The following table
415 lists the most commonly used options to Kerberos V5's @samp{configure}
416 program.
417
418 @table @code
419
420 @item --help
421
422 Provides help to configure. This will list the set of commonly used
423 options for building Kerberos.
424
425 @item --prefix=PREFIX
426
427 By default, Kerberos will install the package's files rooted at
428 `/usr/local' as in `/usr/local/bin', `/usr/local/sbin', etc. If you
429 desire a different location, use this option.
430
431 @item --exec-prefix=EXECPREFIX
432
433 This option allows one to separate the architecture independent programs
434 from the configuration files and manual pages. 
435
436 @item --localstatedir=LOCALSTATEDIR
437
438 This option sets the directory for locally modifiable single-machine
439 data.  In Kerberos, this mostly is useful for setting a location for the
440 KDC data files, as they will be installed in
441 @code{LOCALSTATEDIR/krb5kdc}, which is by default
442 @code{PREFIX/var/krb5kdc}.
443
444 @item CC=COMPILER
445
446 Use @code{COMPILER} as the C compiler.
447
448 @item CFLAGS=FLAGS
449
450 Use @code{FLAGS} as the default set of C compiler flags.
451
452 Note that if you use the native Ultrix compiler on a
453 DECstation you are likely to lose if you pass no flags to cc; md4.c
454 takes an estimated 3,469 billion years to compile if you provide neither
455 the @samp{-g} flag nor the @samp{-O} flag to @samp{cc}.
456
457 @item CPPFLAGS=CPPOPTS 
458
459 Use @code{CPPOPTS} as the default set of C preprocessor flags.  The most
460 common use of this option is to select certain @code{#define}'s for use
461 with the operating system's include files.
462
463 @item LD=LINKER
464
465 Use @code{LINKER} as the default loader if it should be different from C
466 compiler as specified above.
467
468 @item LDFLAGS=LDOPTS
469
470 This option allows one to specify optional arguments to be passed to the
471 linker. This might be used to specify optional library paths.
472
473 @item  --with-krb4
474
475 This option enables Kerberos V4 backwards compatibility using the
476 builtin Kerberos V4 library.
477
478 @item  --with-krb4=KRB4DIR 
479
480 This option enables Kerberos V4 backwards compatibility using a
481 pre-existing Kerberos V4 installation.  The directory specified by
482 @code{KRB4DIR} specifies where the V4 header files should be found
483 (@file{KRB4DIR/include}) as well as where the V4 Kerberos library should
484 be found (@file{KRB4DIR/lib}).
485
486 @item  --without-krb4
487
488 Disables Kerberos V4 backwards compatibility. This prevents Kerberos V4
489 clients from using the V5 services including the KDC. This would be
490 useful if you know you will never install or need to interact with V4
491 clients. 
492
493 @item --with-netlib[=libs]
494
495 Allows for suppression of or replacement of network libraries. By
496 default, Kerberos V5 configuration will look for @code{-lnsl} and
497 @code{-lsocket}. If your operating system has a broken resolver library
498 (see @ref{Solaris versions 2.0 through 2.3}) or fails to pass the tests in
499 @file{src/tests/resolv} you will need to use this option.
500
501 @item --with-tcl=TCLPATH
502
503 Some of the unit-tests in the build tree rely upon using a program in
504 Tcl. The directory specified by @code{TCLPATH} specifies where the Tcl
505 header file (@file{TCLPATH/include/tcl.h} as well as where the Tcl
506 library should be found (@file{TCLPATH/lib}).
507
508 @item --enable-shared
509
510 This option will turn on the building and use of shared library objects
511 in the Kerberos build. This option is only supported on certain
512 platforms. 
513
514 @item --enable-dns
515 @item --enable-dns-for-kdc
516 @item --enable-dns-for-realm
517
518 Enable the use of DNS to look up a host's Kerberos realm, or a realm's
519 KDCs, if the information is not provided in krb5.conf. See @ref{Hostnames
520 for the Master and Slave KDCs} for information about using DNS to
521 locate the KDCs, and @ref{Mapping Hostnames onto Kerberos Realms} for
522 information about using DNS to determine the default realm.  By default,
523 DNS lookups are enabled for the former but not for the latter.
524
525 @item --enable-kdc-replay-cache
526
527 Enable a cache in the KDC to detect retransmitted messages, and resend
528 the previous responses to them.  This protects against certain types of
529 attempts to extract information from the KDC through some of the
530 hardware preauthentication systems.
531
532 @item --with-system-et
533
534 Use an installed version of the error-table support software, the
535 @samp{compile_et} program, the @file{com_err.h} header file and the
536 @file{com_err} library.  If these are not in the default locations,
537 you may wish to specify @code{CPPFLAGS=-I/some/dir} and
538 @code{LDFLAGS=-L/some/other/dir} options at configuration time as
539 well.
540
541 If this option is not given, a version supplied with the Kerberos
542 sources will be built and installed along with the rest of the
543 Kerberos tree, for Kerberos applications to link against.
544
545 @item --with-system-ss
546
547 Use an installed version of the subsystem command-line interface
548 software, the @samp{mk_cmds} program, the @file{ss/ss.h} header file
549 and the @file{ss} library.  If these are not in the default locations,
550 you may wish to specify @code{CPPFLAGS=-I/some/dir} and
551 @code{LDFLAGS=-L/some/other/dir} options at configuration time as
552 well.  See also the @samp{SS_LIB} option.
553
554 If this option is not given, the @file{ss} library supplied with the
555 Kerberos sources will be compiled and linked into those programs that
556 need it; it will not be installed separately.
557
558 @item SS_LIB=libs...
559
560 If @samp{-lss} is not the correct way to link in your installed
561 @file{ss} library, for example if additional support libraries are
562 needed, specify the correct link options here.  Some variants of this
563 library are around which allow for Emacs-like line editing, but
564 different versions require different support libraries to be
565 explicitly specified.
566
567 This option is ignored if @samp{--with-system-ss} is not specified.
568
569 @item --with-system-db
570
571 Use an installed version of the Berkeley DB package, which must
572 provide an API compatible with version 1.85.  This option is
573 @emph{unsupported} and untested.  In particular, we do not know if the
574 database-rename code used in the dumpfile load operation will behave
575 properly.
576
577 If this option is not given, a version supplied with the Kerberos
578 sources will be built and installed.  (We are not updating this
579 version at this time because of licensing issues with newer versions
580 that we haven't investigated sufficiently yet.)
581
582 @item DB_HEADER=headername.h
583
584 If @samp{db.h} is not the correct header file to include to compile
585 against the Berkeley DB 1.85 API, specify the correct header file name
586 with this option.  For example, @samp{DB_HEADER=db3/db_185.h}.
587
588 @item DB_LIB=libs...
589
590 If @samp{-ldb} is not the correct library specification for the
591 Berkeley DB library version to be used, override it with this option.
592 For example, @samp{DB_LIB=-ldb-3.3}.
593
594 @end table
595
596 For example, in order to configure Kerberos on a Solaris machine using
597 the @samp{suncc} compiler with the optimizer turned on, run the configure
598 script with the following options:
599
600 @example
601 % ./configure CC=suncc CFLAGS=-O
602 @end example
603
604 For a slightly more complicated example, consider a system where
605 several packages to be used by Kerberos are installed in
606 @samp{/usr/foobar}, including Berkeley DB 3.3, and an @samp{ss}
607 library that needs to link against the @samp{curses} library.  The
608 configuration of Kerberos might be done thus:
609
610 @example
611 % ./configure CPPFLAGS=-I/usr/foobar/include LDFLAGS=-L/usr/foobar/lib \
612               --with-system-et --with-system-ss --with-system-db \
613               SS_LIB='-lss -lcurses' \
614               DB_HEADER=db3/db_185.h DB_LIB=-ldb-3.3
615 @end example
616
617 In previous releases, @code{--with-} options were used to specify the
618 compiler and linker and their options.
619
620 @node osconf.h, Shared Library Support, Options to Configure, Building Kerberos V5
621 @section @file{osconf.h}
622
623 There is one configuration file which you may wish to edit to control
624 various compile-time parameters in the Kerberos distribution:
625 @file{include/krb5/stock/osconf.h}. The list that follows is by no means
626 complete, just some of the more interesting variables.
627
628 Please note: The former configuration file @file{config.h} no longer
629 exists as its functionality has been merged into the auto-configuration
630 process. @xref{Options to Configure}.
631
632
633 @table @code
634
635 @item DEFAULT_PROFILE_PATH
636
637 The pathname to the file which contains the profiles for the known realms,
638 their KDCs, etc.  The default value is @value{DefaultDefaultProfilePath}.
639
640 The profile file format is no longer the same format as Kerberos V4's
641 @file{krb.conf} file. 
642
643 @item DEFAULT_KEYTAB_NAME
644
645 The type and pathname to the default server keytab file (the
646 equivalent of Kerberos V4's @file{/etc/srvtab}).  The default is
647 @value{DefaultDefaultKeytabName}.
648
649 @item DEFAULT_KDC_ENCTYPE
650
651 The default encryption type for the KDC.  The default value is
652 @value{DefaultMasterKeyType}.
653
654 @item KDCRCACHE
655
656 The name of the replay cache used by the KDC.  The default value is
657 @value{DefaultKDCRCache}.
658
659 @item RCTMPDIR
660
661 The directory which stores replay caches.  The default is to try
662 @value{DefaultRCTmpDirs}.
663
664 @item DEFAULT_KDB_FILE
665
666 The location of the default database.  The default value is
667 @value{DefaultDatabaseName}.
668
669 @end table
670
671 @node Shared Library Support, OS Incompatibilities, osconf.h, Building Kerberos V5
672 @section Shared Library Support
673
674 Shared library support is provided for a few operating systems. There
675 are restrictions as to which compiler to use when using shared
676 libraries. In all cases, executables linked with the shared libraries in
677 this build process will have built in the location of the libraries,
678 therefore obliterating the need for special LD_LIBRARY_PATH, et al environment
679 variables when using the programs. Except where noted, multiple versions
680 of the libraries may be installed on the same system and continue to
681 work.
682
683 Currently the supported platforms are Solaris 2.6-2.9 (aka SunOS
684 5.6-5.9), Irix 6.5, Redhat Linux, MacOS 8-10, and Microsoft Windows
685 (using DLLs).
686
687 Shared library support has been tested on the following platforms but
688 not exhaustively (they have been built but not necessarily tested in an
689 installed state): Tru64 (aka Alpha OSF/1 or Digital Unix) 4.0, and
690 HP/UX 10.20.
691
692 Platforms for which there is shared library support but not significant
693 testing include FreeBSD, OpenBSD, AIX (4.3.3), Linux, NetBSD 1.4.x
694 (i386), and SunOS 4.x.
695
696 To enable shared libraries on the above platforms, run the configure
697 script with the option @samp{--enable-shared}.
698
699 @ifset notdef
700
701 XXX What does this mean?
702
703 One special note is that if the Kerberos V4 compatibility is compiled
704 in, you @b{must not} specify an alternate Kerberos V4 library from the
705 one in the tree or you will be missing references.
706
707 @end ifset
708
709 @node OS Incompatibilities, Using Autoconf, Shared Library Support, Building Kerberos V5
710 @section Operating System Incompatibilities
711
712 This section details operating system incompatibilities with Kerberos V5
713 which have been reported to the developers at MIT.  If you find
714 additional incompatibilities, and/or discover work arounds to such
715 problems, please send a report via the @code{krb5-send-pr} program.
716 Thanks!
717
718 @menu
719 * AIX::                         
720 * Alpha OSF/1 V1.3::            
721 * Alpha OSF/1 (Digital Unix) V2.0++::  
722 * BSDI::                        
723 * HPUX::                        
724 * Solaris versions 2.0 through 2.3::  
725 * Solaris 2.X::                 
726 * SGI Irix 5.X::                
727 * Ultrix 4.2/3::                
728 @end menu
729
730 @node AIX, Alpha OSF/1 V1.3, OS Incompatibilities, OS Incompatibilities
731 @subsection AIX
732
733 The AIX 3.2.5 linker dumps core trying to build a shared
734 @samp{libkrb5.a} produced with the GNU C compiler.  The native AIX
735 compiler works fine.  This problem is fixed using the AIX 4.1 linker.
736
737 @node Alpha OSF/1 V1.3, Alpha OSF/1 (Digital Unix) V2.0++, AIX, OS Incompatibilities
738 @subsection Alpha OSF/1 V1.3
739
740 Using the native compiler, compiling with the @samp{-O} compiler flag
741 causes the @code{asn.1} library to be compiled incorrectly.  
742
743 Using GCC version 2.6.3 or later instead of the native compiler will also work
744 fine, both with or without optimization.
745
746 @node Alpha OSF/1 (Digital Unix) V2.0++, BSDI, Alpha OSF/1 V1.3, OS Incompatibilities
747 @subsection Alpha OSF/1 V2.0++
748
749 There used to be a bug when using the native compiler in compiling
750 @file{md4.c} when compiled without either the @samp{-O} or @samp{-g}
751 compiler options.  We have changed the code and there is no problem
752 under V2.1, but we do not have access to V2.0 to test and see if the
753 problem would exist there. (We welcome feedback on this issue). There
754 was never a problem in using GCC version 2.6.3.
755
756 In version 3.2 and beyond of the operating system, we have not seen any
757 problems with the native compiler. 
758
759 @c @node Alpha Tru64 UNIX 5.0
760 @c @subsection Alpha Tru64 UNIX 5.0
761 @c ... login.krb5 problems
762
763 @node BSDI, HPUX, Alpha OSF/1 (Digital Unix) V2.0++, OS Incompatibilities
764 @subsection BSDI
765
766 BSDI versions 1.0 and 1.1 reportedly has a bad @samp{sed} which causes
767 it to go into an infinite loop during the build.  The work around is
768 to use a @samp{sed} from somewhere else, such as GNU.  (This may be
769 true for some versions of other systems derived from BSD 4.4, such as
770 NetBSD and FreeBSD.)
771
772 @node HPUX, Solaris versions 2.0 through 2.3, BSDI, OS Incompatibilities
773 @subsection HPUX
774
775 The native (bundled) compiler for HPUX currently will not work,
776 because it is not a full ANSI C compiler.  The optional ANSI C
777 compiler should work as long as you give it the @samp{-Ae} flag
778 (i.e. @samp{./configure CC='cc -Ae'}).  This is equivalent to
779 @samp{./configure CC='c89 -D_HPUX_SOURCE'}, which was the previous
780 recommendation.  This has only been tested recently for HPUX 10.20.
781
782 @node Solaris versions 2.0 through 2.3, Solaris 2.X, HPUX, OS Incompatibilities
783 @subsection Solaris versions 2.0 through 2.3
784
785 The @code{gethostbyname()} routine is broken; it does not return a fully
786 qualified domain name, even if you are using the Domain Name Service
787 routines.  Since Kerberos V5 uses the fully qualified domain name as the
788 second component of a service principal (i.e,
789 @samp{host/tsx-11.mit.edu@@ATHENA.MIT.EDU}), this causes problems for servers
790 who try to figure out their own fully qualified domain name.  
791
792 Workarounds:  
793
794 @enumerate
795
796 @item
797    Supply your own resolver library. (such as bind-4.9.3pl1 available
798 from ftp.vix.com)
799
800 @item
801    Upgrade to Solaris 2.4
802
803 @item
804    Make sure your /etc/nsswitch.conf has `files' before `dns' like:
805
806 @example
807 hosts:      files dns
808 @end example
809
810 and then in /etc/hosts, make sure there is a line with your
811 workstation's IP address and hostname, with the fully qualified domain
812 name first.  Example:
813
814 @example
815 18.172.1.4      dcl.mit.edu dcl
816 @end example
817
818 Note that making this change may cause other programs in your
819 environment to break or behave differently.
820
821 @end enumerate
822
823 @node Solaris 2.X, SGI Irix 5.X, Solaris versions 2.0 through 2.3, OS Incompatibilities
824 @subsection Solaris 2.X
825
826 You @b{must} compile Kerberos V5 without the UCB compatibility
827 libraries.  This means that @file{/usr/ucblib} must not be in the
828 LD_LIBRARY_PATH environment variable when you compile it.  Alternatively
829 you can use the @code{-i} option to @samp{cc}, by using the specifying
830 @code{CFLAGS=-i} option to @samp{configure}.
831
832 If you are compiling for a 64-bit execution environment, you may need
833 to configure with the option @code{CFLAGS="-D_XOPEN_SOURCE=500
834 -D__EXTENSIONS__"}.  This is not well tested; at MIT we work primarily
835 with the 32-bit execution environment.
836
837 @node SGI Irix 5.X, Ultrix 4.2/3, Solaris 2.X, OS Incompatibilities
838 @subsection SGI Irix 5.X
839
840 If you are building in a tree separate from the source tree, the vendors
841 version of make does not work properly with regards to
842 @samp{VPATH}. It also has problems with standard inference rules in 5.2
843 (not tested yet in 5.3) so one needs to use GNU's make.
844
845 Under 5.2, there is a bug in the optional System V @code{-lsocket}
846 library in which the routine @code{gethostbyname()} is broken. The
847 system supplied version in @code{-lc} appears to work though so one may
848 simply specify @code{--with-netlib} option to @samp{configure}. 
849
850 In 5.3, @code{gethostbyname()} is no longer present in @code{-lsocket} and
851 is no longer an issue. 
852
853 @node Ultrix 4.2/3,  , SGI Irix 5.X, OS Incompatibilities
854 @subsection Ultrix 4.2/3
855
856 The DEC MIPS platform currently will not support the native compiler,
857 since the Ultrix compiler is not a full ANSI C compiler.  You should use
858 GCC instead.
859
860 @ifset notdef
861
862 On the DEC MIPS platform, using the native compiler, @file{md4.c} and
863 @file{md5.c} can not be compiled with the optimizer set at level 1.
864 That is, you must specify either @samp{CFLAGS=-O} and
865 @samp{CFLAGS=-g} to configure.  If you don't specify either, the
866 compile will never complete.
867
868 The optimizer isn't hung; it just takes an exponentially long time.
869 Compiling 6 out of the 48 algorithmic steps takes 3 seconds; compiling 7
870 steps takes 9 seconds; compiling 8 steps takes 27 seconds, and so on.
871 Calculations estimate it will finish in approximately 3,469 billion
872 years....
873
874 Using GCC instead of the native compiler will also work fine, both with
875 or without optimization.
876
877 @end ifset
878
879 @node Using Autoconf,  , OS Incompatibilities, Building Kerberos V5
880 @section Using @samp{Autoconf}
881
882 (If you are not a developer, you can skip this section.)
883
884 In most of the Kerberos V5 source directories, there is a
885 @file{configure} script which automatically determines the compilation
886 environment and creates the proper Makefiles for a particular
887 platform.  These @file{configure} files are generated using
888 @samp{autoconf}, which can be found in the @file{src/util/autoconf}
889 directory in the distribution.
890
891 Normal users will not need to worry about running @samp{autoconf}; the
892 distribution comes with the @file{configure} files already prebuilt.
893 Developers who wish to modify the @file{configure.in} files should see
894 @ref{Top, , Overview, autoconf, The Autoconf Manual}.  
895
896 Note that in order to run @samp{autoconf}, you must have GNU @samp{m4}
897 in your path.  Before you use the @samp{autoconf} in the Kerberos V5
898 source tree, you may also need to run @samp{configure}, and then run
899 @samp{make} in the @file{src/util/autoconf} directory in order to
900 properly set up @samp{autoconf}.
901
902 One tool which is provided for the convenience of developers can be
903 found in @file{src/util/reconf}.  This program should be run while the
904 current directory is the top source directory.  It will automatically
905 rebuild any @file{configure} files which need rebuilding.  If you know
906 that you have made a change that will require that all the
907 @file{configure} files need to be rebuilt from scratch, specify the
908 @code{--force} option:
909
910 @example
911 % cd /u1/krb5-@value{RELEASE}/src
912 % ./util/reconf --force
913 @end example
914
915 The developmental sources are a raw source tree (before it's been packaged
916 for public release), without the pre-built @file{configure} files.
917 In order to build from such a source tree, you must do:
918
919 @example
920 % cd krb5/util/autoconf
921 % ./configure
922 % make
923 % cd ../..
924 % util/reconf
925 @end example
926
927 Then follow the instructions for building packaged source trees (above).
928 To install the binaries into a binary tree, do:
929
930 @example
931 % cd /u1/krb5-@value{RELEASE}/src
932 % make all
933 % make install DESTDIR=somewhere-else
934 @end example
935