]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - Documentation/howto-build-sys.txt
whereis: use xstrncpy()
[thirdparty/util-linux.git] / Documentation / howto-build-sys.txt
index 7565c45b8c4a56ef5af8cec075c9cd373064d3a9..46d2793a125e7b699b86dc8d66444ddae92a2fec 100644 (file)
@@ -1,9 +1,37 @@
 util-linux build system
 =======================
 
+ - the build system is non-recursive, individual subdirectories use
+   Makemodule.am files. These files are merged together by automake
+   into one global Makefile in the top-level directory
+
+ - all final build results (binaries, libtool scripts) are stored in top-level
+   source directory
+
+ - all Makemodule.am files have to be designed as top-level makefiles, it
+   means with full paths (e.g. foo_SOURCES = subdir/foo.c)
+
+ - always use '+=' operator for global variables (e.g. bin_PROGRAMS += foo)
+
+ - use libcommon.la (without path!) for lib/ stuff (e.g. foo_LDADD = libcommon.la)
+
+ - for libblkid, libuuid and libmount use lib<name>.la in _LDADD and
+   -I$(ul_lib<name>_incdir) in _CFLAGS, for example
+
+       foo_LDADD = libmount.la
+       foo_CFLAGS = -I$(ul_libmount_incdir)
+
+ - always use suffixes for hooks, for example
+
+       install-exec-hook-foo:
+               ln -sf foo foooo
+
+       INSTALL_EXEC_HOOKS += install-exec-hook-foo
+
+
  - all util-linux specific autoconf macros use UL_ prefix
 
- - utils in Makedile.am files are enabled/disabled according to BUILD_<NAME>
+ - utils in Makefile.am files are enabled/disabled according to BUILD_<NAME>
    conditions (AM_CONDITIONAL), for example:
 
        if BUILD_HWCLOCK
@@ -32,6 +60,13 @@ util-linux build system
 
        "no"    - the util/feature is unwanted
 
+   The default status is always defined by UL_DEFAULT_ENABLE() and it might be
+   globally modified by $ul_default_estate (see AC_ARG_ENABLE([all-programs])).
+
+ - it's possible to disable all programs, but enable just one (or more)
+   explicitly specified, for example:
+
+        ./configure --disable-all-programs --enable-hwclock
 
  - some basic scenarios for the ./configure script are defined in the
    tools/config-gen.d/ directory. If you want to use these predefined scenarios