1 util-linux build system
2 =======================
4 - the build system is non-recursive, individual subdirectories use
5 Makemodule.am files. These files are merged together by automake
6 into one global Makefile in the top-level directory
8 - all final build results (binaries, libtool scripts) are stored in top-level
11 - all Makemodule.am files have to be designed as top-level makefiles, it
12 means with full paths (e.g. foo_SOURCES = subdir/foo.c)
14 - always use '+=' operator for global variables (e.g. bin_PROGRAMS += foo)
16 - use libcommon.la (without path!) for lib/ stuff (e.g. foo_LDADD = libcommon.la)
18 - for libblkid, libuuid and libmount use lib<name>.la in _LDADD and
19 -I$(ul_lib<name>_incdir) in _CFLAGS, for example
21 foo_LDADD = libmount.la
22 foo_CFLAGS = -I$(ul_libmount_incdir)
24 - always use suffixes for hooks, for example
26 install-exec-hook-foo:
29 INSTALL_EXEC_HOOKS += install-exec-hook-foo
32 - all util-linux specific autoconf macros use UL_ prefix
34 - utils in Makefile.am files are enabled/disabled according to BUILD_<NAME>
35 conditions (AM_CONDITIONAL), for example:
41 - "if BUILD_<NAME>" blocks are never nested within another "if BUILD_<NAME>",
42 all dependencies have to be resolved in configure.ac (see UL_REQUIRES_BUILD())
44 - all BUILD_<NAME> in configure.am are always based on build_<name> variables,
47 AM_CONDITIONAL([BUILD_HWCLOCK], test "x$build_hwclock" = xyes)
49 the $build_<name> should be available in whole configure script
51 - AC_ARG_ENABLE() status is always stored in $enable_<name> variable, possible
54 "check" - util/feature is optional, if any subcomponent (function, lib,
55 ...) is missing a warning is printed and the util/feature is
58 "yes" - util/feature is required, if any subcomponent (function, lib,
59 ...) is missing an error is printed and ./configure aborted
61 "no" - the util/feature is unwanted
63 The default status is always defined by UL_DEFAULT_ENABLE() and it might be
64 globally modified by $ul_default_estate (see AC_ARG_ENABLE([all-programs])).
66 - it's possible to disable all programs, but enable just one (or more)
67 explicitly specified, for example:
69 ./configure --disable-all-programs --enable-hwclock
71 - some basic scenarios for the ./configure script are defined in the
72 tools/config-gen.d/ directory. If you want to use these predefined scenarios
75 ./tools/config-gen [<scenario> ...]
79 ./tools/config-gen all selinux
81 will build all utils with enabled selinux support. You can also define some
84 CFLAGS=$(rpm --eval '%optflags') ./tools/config-gen all
86 will use the default distro flags.
88 WARNING: config-gen is not designed for end-user or downstream distributions!
89 It's for development purpose only. All end-users and downstream have
90 to use standard ./configure script only.
92 - the tools/config-gen script is also used for build system regression tests,
93 the test is not enabled by default, you have to use
95 tests/run.sh build-sys --force