]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: fix --disable-all-programs --enable-schedutils
authorKarel Zak <kzak@redhat.com>
Mon, 20 Feb 2017 13:17:37 +0000 (14:17 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 20 Feb 2017 13:17:37 +0000 (14:17 +0100)
* add UL_ENABLE_ALIAS(NAME, MASTERNAME) to initialize $enable_<name>
  according to MASTERNAME. Note that we have to use $build_<mastername>,
  the $enable_<mastername> is just AC_ARG_ENABLE() stuff only. The
  $build_ is evaluated and modified by our UL_...() functions.

* add enable-schedutils.conf to have build-system regression test for
  this use-case

Addresses: https://github.com/karelzak/util-linux/issues/415
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
m4/ul.m4
tools/config-gen.d/enable-schedutils.conf [new file with mode: 0644]

index ad241fec2341b7ad63bb8c2f5d04427dacd6c430..be282f04c23dfb8e93ce4876049e136b29ece8b0 100644 (file)
@@ -1909,8 +1909,9 @@ AC_ARG_ENABLE([schedutils],
 )
 UL_BUILD_INIT([schedutils])
 
-UL_BUILD_INIT([ionice], [check])
-UL_REQUIRES_BUILD([ionice], [schedutils])
+
+UL_ENABLE_ALIAS([ionice], [schedutils])
+UL_BUILD_INIT([ionice])
 UL_REQUIRES_SYSCALL_CHECK([ionice],
        [UL_CHECK_SYSCALL([ioprio_set],
          [alpha],      [442],
@@ -1937,8 +1938,9 @@ UL_REQUIRES_SYSCALL_CHECK([ionice],
 
 AM_CONDITIONAL([BUILD_IONICE], [test "x$build_ionice" = xyes])
 
-UL_BUILD_INIT([taskset], [check])
-UL_REQUIRES_BUILD([taskset], [schedutils])
+
+UL_ENABLE_ALIAS([taskset], [schedutils])
+UL_BUILD_INIT([taskset])
 UL_REQUIRES_HAVE([taskset], [cpu_set_t], [cpu_set_t type])
 UL_REQUIRES_SYSCALL_CHECK([taskset],
        [UL_CHECK_SYSCALL([sched_getaffinity])],
@@ -1950,8 +1952,8 @@ have_schedsetter=no
 AS_IF([test "x$ac_cv_func_sched_setscheduler" = xyes], [have_schedsetter=yes],
       [test "x$ac_cv_func_sched_setattr" = xyes], [have_schedsetter=yes])
 
-UL_BUILD_INIT([chrt], [check])
-UL_REQUIRES_BUILD([chrt], [schedutils])
+UL_ENABLE_ALIAS([chrt], [schedutils])
+UL_BUILD_INIT([chrt])
 UL_REQUIRES_HAVE([chrt], [schedsetter], [sched_set functions])
 AM_CONDITIONAL([BUILD_CHRT], [test "x$build_chrt" = xyes])
 
index f8a0dd7cbf778ed00f42d60559c3b35b3e83a857..ed7227c512fc8562fc706713f22ab402c87f254b 100644 (file)
--- a/m4/ul.m4
+++ b/m4/ul.m4
@@ -429,6 +429,21 @@ AC_DEFUN([UL_DEFAULT_ENABLE], [
   fi
 ])
 
+
+dnl UL_ENABLE_ALIAS(NAME, MASTERNAME)
+dnl
+dnl Initializes $enable_<name> variable according to $build_<mastername>.  This
+dnl is usefull for example if you want to use one --enable-mastername option
+dnl for group of programs.
+dnl
+AC_DEFUN([UL_ENABLE_ALIAS], [
+  m4_define([suffix], $1)
+  m4_define([mastersuffix], $2)
+
+  enable_[]suffix=$build_[]mastersuffix
+])
+
+
 dnl UL_NCURSES_CHECK(NAME)
 dnl
 dnl Initializes $have_<name>, NCURSES_LIBS and NCURSES_CFLAGS variables according to
diff --git a/tools/config-gen.d/enable-schedutils.conf b/tools/config-gen.d/enable-schedutils.conf
new file mode 100644 (file)
index 0000000..08deee4
--- /dev/null
@@ -0,0 +1,3 @@
+include:disable-all.conf
+
+--enable-schedutils