0001-Add-a-enable-disable-progs-configure-option.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. From 571445ec4643865566d2c5a9e27d9b78b8b00107 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Mon, 29 May 2017 23:03:48 +0300
  4. Subject: [PATCH] Add a --{enable,disable}-progs configure option
  5. Add a --{enable,disable}-progs configuration option to elfutils. This
  6. allows to selectively disable the compilation of the elfutils programs
  7. (in which case only the libraries are built and installed). This is
  8. useful because the programs are often not needed, and also because
  9. building the programs against uClibc causes several issues (lack of
  10. obstack_printf() in uClibc for example).
  11. Based on the former patch by Thomas Petazzoni.
  12. [Vincent: tweak patch for 0.166]
  13. [Bernd: rebased patch for 0.177]
  14. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  15. Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
  16. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  17. [Rebased on 0.183]
  18. Signed-off-by: Peter Seiderer <ps.report@gmx.net>
  19. [Fabrice: don't error out if obstack is not found]
  20. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  21. [Rebased on 0.192]
  22. Signed-off-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
  23. ---
  24. Makefile.am | 6 +++++-
  25. configure.ac | 8 +++++++-
  26. 2 files changed, 12 insertions(+), 2 deletions(-)
  27. diff --git a/Makefile.am b/Makefile.am
  28. index 92130b57..00f5176b 100644
  29. --- a/Makefile.am
  30. +++ b/Makefile.am
  31. @@ -26,8 +26,12 @@ AM_MAKEFLAGS = --no-print-directory
  32. pkginclude_HEADERS = version.h
  33. +if ENABLE_PROGS
  34. +PROGS_SUBDIR = src
  35. +endif
  36. +
  37. SUBDIRS = config lib libelf libcpu backends libebl libdwelf libdwfl libdw \
  38. - libasm debuginfod src po doc tests
  39. + libasm debuginfod $(PROGS_SUBDIR) po doc tests
  40. EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING SECURITY \
  41. COPYING COPYING-GPLV2 COPYING-LGPLV3 CONDUCT
  42. diff --git a/configure.ac b/configure.ac
  43. index f191488f..87d91f8f 100644
  44. --- a/configure.ac
  45. +++ b/configure.ac
  46. @@ -426,6 +426,12 @@ AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]),
  47. [tests_use_rpath=$enableval], [tests_use_rpath=no])
  48. AM_CONDITIONAL(TESTS_RPATH, test "$tests_use_rpath" = yes)
  49. +AC_ARG_ENABLE([progs],
  50. + AS_HELP_STRING([--enable-progs], [enable progs]),
  51. + enable_progs=$enableval,
  52. + enable_progs=yes)
  53. +AM_CONDITIONAL(ENABLE_PROGS, test "$enable_progs" = yes)
  54. +
  55. dnl zlib is mandatory.
  56. save_LIBS="$LIBS"
  57. LIBS=
  58. @@ -670,7 +676,7 @@ saved_LIBS="$LIBS"
  59. AC_SEARCH_LIBS([_obstack_free], [obstack])
  60. LIBS="$saved_LIBS"
  61. case "$ac_cv_search__obstack_free" in
  62. - no) AC_MSG_FAILURE([failed to find _obstack_free]) ;;
  63. + no) obstack_LIBS= ;;
  64. -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
  65. *) obstack_LIBS= ;;
  66. esac
  67. --
  68. 2.47.1