]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: support 'dist' and 'syntax-check' targets without libselinux
authorPádraig Brady <P@draigBrady.com>
Sat, 10 Jan 2026 16:37:13 +0000 (16:37 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 11 Jan 2026 12:56:22 +0000 (12:56 +0000)
Following on from commit v9.8-60-g8ba47d09a ...
Without libselinux installed, runcon and chcon stub binaries
will not be built by default.  We separate these utilities out
to a separate "not built unless appropriate" class, so that
we can add these to EXTRA_MANS so that the 'check-x-vs-1'
target doesn't fail, and the 'dist' target includes
these man pages.

* build-aux/gen-lists-of-programs.sh: Separate out
build_if_appropriate_progs, and propagate that through
to no_install_progs_default which populates EXTRA_MANS.
* src/local.mk: Separate out build_if_appropriate__progs
for clarity and consistency.

build-aux/gen-lists-of-programs.sh
src/local.mk

index 1892b1aebee696e5b27892bcf5eed27043478c78..5d307219aa3a13da96879eb03f0a8c2cd088b78c 100755 (executable)
@@ -26,20 +26,26 @@ disabled_by_default_progs='
 # Programs that can be built only when certain requisite system
 # features are detected at configure time.
 build_if_possible_progs='
-    chcon
     chroot
     df
     hostid
     libstdbuf.so
     nice
     pinky
-    runcon
     stdbuf
     stty
     timeout
     users
     who
 '
+# Programs that are built only when certain requisite system
+# features are detected at configure time.  I.e., they can
+# be built on all systems, but are only effective on some.
+# These will be built to create man pages for distribution.
+build_if_appropriate_progs='
+   chcon
+   runcon
+'
 
 # All the other programs, to be built by default, and that should
 # be buildable without problems on any target system.
@@ -149,7 +155,8 @@ case $#,$1 in
       echo "gl_ADD_PROG([optional_bin_progs], [$p])"
     done
     # Extra 'echo' to normalize whitespace.
-    echo "no_install_progs_default='`echo $disabled_by_default_progs`'"
+    echo "no_install_progs_default='`echo $disabled_by_default_progs \
+                                          $build_if_appropriate_progs`'"
     sed 's/^ *//' <<END
         # Given the name of a variable containing a space-separated
         # list of install-by-default programs and the actual list of
@@ -177,6 +184,10 @@ END
     for p in $build_if_possible_progs; do
       echo build_if_possible__progs += $progsdir/$p
     done
+    echo build_if_appropriate__progs =
+    for p in $build_if_appropriate_progs; do
+      echo build_if_appropriate__progs += $progsdir/$p
+    done
     echo default__progs =
     for p in $normal_progs; do
       echo default__progs += $progsdir/$p
@@ -184,7 +195,7 @@ END
     ;;
   1,--list-progs)
     for p in $disabled_by_default_progs $build_if_possible_progs \
-        $normal_progs; do
+        $build_if_appropriate_progs $normal_progs; do
       echo $p
     done
     ;;
index 5e2a4b9e897d8ba32eccadc93a5ea9a4a4b2c12d..7e78d81faa06b4c08f1efb12f51b8e923b8c2528 100644 (file)
@@ -28,6 +28,7 @@ include $(srcdir)/src/cu-progs.mk
 EXTRA_PROGRAMS = \
    $(no_install__progs) \
    $(build_if_possible__progs) \
+   $(build_if_appropriate__progs) \
    $(default__progs)
 
 # The user can tweak these lists at configure time.