0003-Add-disable-doc-option.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From 141628519d227b59be3977b16ebaab0feb22b295 Mon Sep 17 00:00:00 2001
  2. From: Maksim Kiselev <bigunclemax@gmail.com>
  3. Date: Sun, 20 Aug 2023 11:35:57 +0300
  4. Subject: [PATCH] Add '--disable-doc' option
  5. Introduce a configure option to disable documentation installation
  6. in case if it is not required.
  7. Upstream: https://github.com/intel/ledmon/pull/154
  8. Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
  9. ---
  10. Makefile.am | 8 ++++++--
  11. configure.ac | 11 ++++++++++-
  12. 2 files changed, 16 insertions(+), 3 deletions(-)
  13. diff --git a/Makefile.am b/Makefile.am
  14. index ddcd200..644a8d2 100644
  15. --- a/Makefile.am
  16. +++ b/Makefile.am
  17. @@ -20,6 +20,10 @@ if SYSTEMD_CONDITION
  18. OPTIONAL_SUBDIR = systemd
  19. endif
  20. -SUBDIRS = doc src $(OPTIONAL_SUBDIR)
  21. +if WITH_DOC
  22. + DOC_SUBDIR = doc
  23. + dist_doc_DATA = README.md
  24. +endif
  25. +
  26. +SUBDIRS = src $(DOC_SUBDIR) $(OPTIONAL_SUBDIR)
  27. EXTRA_DIST = config/config.h systemd/ledmon.service.in
  28. -dist_doc_DATA = README.md
  29. diff --git a/configure.ac b/configure.ac
  30. index 05baa62..114957f 100644
  31. --- a/configure.ac
  32. +++ b/configure.ac
  33. @@ -74,6 +74,15 @@ AM_CONDITIONAL([SYSTEMD_CONDITION], [test "$SYSTEMD_STR" = yes])
  34. # target directory for ledmon service file
  35. AC_SUBST([SYSTEMD_PATH], "$(pkg-config systemd --variable=systemdsystemunitdir)")
  36. +# Add configure option to disable documentation building
  37. +AC_ARG_ENABLE([doc],
  38. + [AS_HELP_STRING([--disable-doc],
  39. + [do not install ledmon documentaion])],
  40. + [with_doc=${enableval}],
  41. + [with_doc=yes])
  42. +
  43. +AM_CONDITIONAL([WITH_DOC], [test "x$with_doc" = "xyes"])
  44. +
  45. AC_CONFIG_FILES([Makefile
  46. doc/Makefile
  47. src/Makefile
  48. @@ -86,5 +95,5 @@ $PACKAGE_NAME $VERSION configuration:
  49. Preprocessor flags: ${AM_CPPFLAGS} ${CPPFLAGS}
  50. C compiler flags: ${AM_CFLAGS} ${CFLAGS}
  51. Common install location: ${prefix}
  52. - configure parameters: --enable-systemd=${SYSTEMD_STR}
  53. + configure parameters: --enable-systemd=${SYSTEMD_STR} --enable-doc=${with_doc}
  54. ])
  55. --
  56. 2.39.2