| 1 |
The 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 |
|
| 8 |
make install-strip |
| 9 |
|
| 10 |
Note that on the production systems it is strongly recommended to use |
| 11 |
"make install-strip" to install binaries and libraries. The result |
| 12 |
from the standard "make install" may produce large binaries with |
| 13 |
unnecessary symbols. |
| 14 |
|
| 15 |
Autotools |
| 16 |
|
| 17 |
`./autogen.sh' generates all files needed to compile |
| 18 |
and install the code (run it after checkout from git) |
| 19 |
|
| 20 |
`make distclean' removes all unnecessary files, but the |
| 21 |
code can still be recompiled with "./configure; make" |
| 22 |
|
| 23 |
`make dist-gzip' (or -bzip2) creates a tarball that can |
| 24 |
be configured and compiled without running `./autogen.sh' |
| 25 |
|
| 26 |
Compiling |
| 27 |
|
| 28 |
Use SUID_CFLAGS and SUID_LDFLAGS when you want to define |
| 29 |
special compiler options for typical suid programs, for |
| 30 |
example: |
| 31 |
|
| 32 |
./configure SUID_CFLAGS="-fpie" SUID_LDFLAGS="-pie" |
| 33 |
|
| 34 |
The SUID_* feature is currently supported for chfn, chsh, |
| 35 |
newgrp, su, write, mount, and umount. |
| 36 |
|
| 37 |
Use DAEMON_CFLAGS and DAEMON_LDFLAGS when you want to define |
| 38 |
special compiler options for daemons; supported for uuidd. |
| 39 |
|
| 40 |
Use SOLIB_CFLAGS and SOLIB_LDFLAGS when you want to define |
| 41 |
special compiler options for shared libraries; supported for |
| 42 |
libmount, libblkid and libuuid. |
| 43 |
|
| 44 |
FIXME: add notes about klib and uClib. |
| 45 |
|
| 46 |
|
| 47 |
Compile certain portion |
| 48 |
|
| 49 |
See ./configure --help and use --disable-* and --enable-* options. |
| 50 |
|
| 51 |
It's also possible to disable all the programs and enable only wanted. |
| 52 |
For example: |
| 53 |
|
| 54 |
./configure --disable-all-programs --enable-fallocate |
| 55 |
|
| 56 |
Note that the configure script tracks dependencies between libs and |
| 57 |
tools. Always see warning messages and follow error messages if any |
| 58 |
dependence is necessary. For example to compile mount(8) you need also |
| 59 |
libmount, libblkid and libuuid: |
| 60 |
|
| 61 |
./configure --disable-all-programs --enable-mount --enable-libmount \ |
| 62 |
--enable-libblkid --enable-libuuid |
| 63 |
|
| 64 |
|
| 65 |
Static linking |
| 66 |
|
| 67 |
Use --enable-static-programs[=LIST] configure option when |
| 68 |
you want to use statically linked programs. |
| 69 |
|
| 70 |
Note, mount(8) uses get{pw,gr}nam() and getpwuid() |
| 71 |
functions for translation from username and groupname to |
| 72 |
UID and GID. These functions could be implemented by |
| 73 |
dynamically loaded independent modules (NSS) in your libc |
| 74 |
(e.g. glibc). These modules are not statically linked to |
| 75 |
mount(8) and mount.static is still using dlopen() like |
| 76 |
dynamically linked version. |
| 77 |
|
| 78 |
The translation won't work in environment where NSS |
| 79 |
modules are not installed. |
| 80 |
|
| 81 |
For example normal system (NSS modules are available): |
| 82 |
|
| 83 |
# ./mount.static -v -f -n -ouid=kzak /mnt/foo |
| 84 |
LABEL=/mnt/foo on /mnt/foo type vfat (rw,uid=500) |
| 85 |
^^^^^^^ |
| 86 |
and without NSS modules: |
| 87 |
|
| 88 |
# chroot . ./mount.static -v -f -n -ouid=kzak /mnt/win |
| 89 |
LABEL=/mnt/win on /mnt/win type vfat (rw,uid=kzak) |
| 90 |
^^^^^^^^ |