0003-build-sys-fix-disable-all-programs-enable-schedutils.patch 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. From 6f2eb03433bcb2d3c351efed848a1f8554a7ff78 Mon Sep 17 00:00:00 2001
  2. From: Karel Zak <kzak@redhat.com>
  3. Date: Mon, 20 Feb 2017 14:17:37 +0100
  4. Subject: [PATCH] build-sys: fix --disable-all-programs --enable-schedutils
  5. * add UL_ENABLE_ALIAS(NAME, MASTERNAME) to initialize $enable_<name>
  6. according to MASTERNAME. Note that we have to use $build_<mastername>,
  7. the $enable_<mastername> is just AC_ARG_ENABLE() stuff only. The
  8. $build_ is evaluated and modified by our UL_...() functions.
  9. * add enable-schedutils.conf to have build-system regression test for
  10. this use-case
  11. Addresses: https://github.com/karelzak/util-linux/issues/415
  12. Signed-off-by: Karel Zak <kzak@redhat.com>
  13. ---
  14. configure.ac | 14 ++++++++------
  15. m4/ul.m4 | 15 +++++++++++++++
  16. tools/config-gen.d/enable-schedutils.conf | 3 +++
  17. 3 files changed, 26 insertions(+), 6 deletions(-)
  18. create mode 100644 tools/config-gen.d/enable-schedutils.conf
  19. diff --git a/configure.ac b/configure.ac
  20. index ad241fe..be282f0 100644
  21. --- a/configure.ac
  22. +++ b/configure.ac
  23. @@ -1909,8 +1909,9 @@ AC_ARG_ENABLE([schedutils],
  24. )
  25. UL_BUILD_INIT([schedutils])
  26. -UL_BUILD_INIT([ionice], [check])
  27. -UL_REQUIRES_BUILD([ionice], [schedutils])
  28. +
  29. +UL_ENABLE_ALIAS([ionice], [schedutils])
  30. +UL_BUILD_INIT([ionice])
  31. UL_REQUIRES_SYSCALL_CHECK([ionice],
  32. [UL_CHECK_SYSCALL([ioprio_set],
  33. [alpha], [442],
  34. @@ -1937,8 +1938,9 @@ UL_REQUIRES_SYSCALL_CHECK([ionice],
  35. AM_CONDITIONAL([BUILD_IONICE], [test "x$build_ionice" = xyes])
  36. -UL_BUILD_INIT([taskset], [check])
  37. -UL_REQUIRES_BUILD([taskset], [schedutils])
  38. +
  39. +UL_ENABLE_ALIAS([taskset], [schedutils])
  40. +UL_BUILD_INIT([taskset])
  41. UL_REQUIRES_HAVE([taskset], [cpu_set_t], [cpu_set_t type])
  42. UL_REQUIRES_SYSCALL_CHECK([taskset],
  43. [UL_CHECK_SYSCALL([sched_getaffinity])],
  44. @@ -1950,8 +1952,8 @@ have_schedsetter=no
  45. AS_IF([test "x$ac_cv_func_sched_setscheduler" = xyes], [have_schedsetter=yes],
  46. [test "x$ac_cv_func_sched_setattr" = xyes], [have_schedsetter=yes])
  47. -UL_BUILD_INIT([chrt], [check])
  48. -UL_REQUIRES_BUILD([chrt], [schedutils])
  49. +UL_ENABLE_ALIAS([chrt], [schedutils])
  50. +UL_BUILD_INIT([chrt])
  51. UL_REQUIRES_HAVE([chrt], [schedsetter], [sched_set functions])
  52. AM_CONDITIONAL([BUILD_CHRT], [test "x$build_chrt" = xyes])
  53. diff --git a/m4/ul.m4 b/m4/ul.m4
  54. index f8a0dd7..ed7227c 100644
  55. --- a/m4/ul.m4
  56. +++ b/m4/ul.m4
  57. @@ -429,6 +429,21 @@ AC_DEFUN([UL_DEFAULT_ENABLE], [
  58. fi
  59. ])
  60. +
  61. +dnl UL_ENABLE_ALIAS(NAME, MASTERNAME)
  62. +dnl
  63. +dnl Initializes $enable_<name> variable according to $build_<mastername>. This
  64. +dnl is usefull for example if you want to use one --enable-mastername option
  65. +dnl for group of programs.
  66. +dnl
  67. +AC_DEFUN([UL_ENABLE_ALIAS], [
  68. + m4_define([suffix], $1)
  69. + m4_define([mastersuffix], $2)
  70. +
  71. + enable_[]suffix=$build_[]mastersuffix
  72. +])
  73. +
  74. +
  75. dnl UL_NCURSES_CHECK(NAME)
  76. dnl
  77. dnl Initializes $have_<name>, NCURSES_LIBS and NCURSES_CFLAGS variables according to
  78. diff --git a/tools/config-gen.d/enable-schedutils.conf b/tools/config-gen.d/enable-schedutils.conf
  79. new file mode 100644
  80. index 0000000..08deee4
  81. --- /dev/null
  82. +++ b/tools/config-gen.d/enable-schedutils.conf
  83. @@ -0,0 +1,3 @@
  84. +include:disable-all.conf
  85. +
  86. +--enable-schedutils
  87. --
  88. 2.7.4