]> git.ipfire.org Git - thirdparty/util-linux.git/blame - Documentation/howto-compilation.txt
lib/pty: reset mainloop timeout on signal
[thirdparty/util-linux.git] / Documentation / howto-compilation.txt
CommitLineData
22a3b8c9
SK
1The common case
2
3 ./autogen.sh && ./configure && make
4
5 If something fails read the last lines. Typical reason to
6 fail is a missing dependency, such as libtool or gettext.
7
8Autotools
9
10 `./autogen.sh' generates all files needed to compile
11 and install the code (run it after checkout from git)
12
13 `make distclean' removes all unnecessary files, but the
14 code can still be recompiled with "./configure; make"
15
16 `make dist-gzip' (or -bzip2) creates a tarball that can
17 be configured and compiled without running `./autogen.sh'
18
19Compiling
20
21 Use SUID_CFLAGS and SUID_LDFLAGS when you want to define
22 special compiler options for typical suid programs, for
23 example:
24
25 ./configure SUID_CFLAGS="-fpie" SUID_LDFLAGS="-pie"
26
27 The SUID_* feature is currently supported for chfn, chsh,
b5b8805f 28 newgrp, su, write, mount, and umount.
22a3b8c9 29
03d00d49
KZ
30 Use DAEMON_CFLAGS and DAEMON_LDFLAGS when you want to define
31 special compiler options for daemons; supported for uuidd.
22a3b8c9 32
03d00d49
KZ
33 Use SOLIB_CFLAGS and SOLIB_LDFLAGS when you want to define
34 special compiler options for shared libraries; supported for
35 libmount, libblkid and libuuid.
22a3b8c9
SK
36
37 FIXME: add notes about klib and uClib.
38
e236f61d
KZ
39
40Compile certain portion
41
42 See ./configure --help and use --disable-* and --enable-* options.
43
44 It's also possible to disable all the programs and enable only wanted.
45 For example:
2bb3aa36 46
e236f61d
KZ
47 ./configure --disable-all-programs --enable-fallocate
48
49 Note that the configure script tracks dependencies between libs and
50 tools. Always see warning messages and follow error messages if any
51 dependence is necessary. For example to compile mount(8) you need also
52 libmount, libblkid and libuuid:
53
54 ./configure --disable-all-programs --enable-mount --enable-libmount \
55 --enable-libblkid --enable-libuuid
56
57
22a3b8c9
SK
58Static linking
59
60 Use --enable-static-programs[=LIST] configure option when
61 you want to use statically linked programs.
62
63 Note, mount(8) uses get{pw,gr}nam() and getpwuid()
64 functions for translation from username and groupname to
65 UID and GID. These functions could be implemented by
66 dynamically loaded independent modules (NSS) in your libc
67 (e.g. glibc). These modules are not statically linked to
68 mount(8) and mount.static is still using dlopen() like
69 dynamically linked version.
70
71 The translation won't work in environment where NSS
72 modules are not installed.
73
74 For example normal system (NSS modules are available):
75
76 # ./mount.static -v -f -n -ouid=kzak /mnt/foo
77 LABEL=/mnt/foo on /mnt/foo type vfat (rw,uid=500)
78 ^^^^^^^
79 and without NSS modules:
80
81 # chroot . ./mount.static -v -f -n -ouid=kzak /mnt/win
82 LABEL=/mnt/win on /mnt/win type vfat (rw,uid=kzak)
83 ^^^^^^^^