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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. From 73e4da5ca780196d23db8029dcd28f87a0402711 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. ---
  22. Makefile.am | 6 +++++-
  23. configure.ac | 6 ++++++
  24. 2 files changed, 11 insertions(+), 1 deletion(-)
  25. diff --git a/Makefile.am b/Makefile.am
  26. index 9c47afa..edf8dfc 100644
  27. --- a/Makefile.am
  28. +++ b/Makefile.am
  29. @@ -26,8 +26,12 @@ AM_MAKEFLAGS = --no-print-directory
  30. pkginclude_HEADERS = version.h
  31. +if ENABLE_PROGS
  32. +PROGS_SUBDIR = src
  33. +endif
  34. +
  35. SUBDIRS = config lib libelf libcpu backends libebl libdwelf libdwfl libdw \
  36. - libasm debuginfod src po doc tests
  37. + libasm debuginfod $(PROGS_SUBDIR) po doc tests
  38. EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
  39. COPYING COPYING-GPLV2 COPYING-LGPLV3
  40. diff --git a/configure.ac b/configure.ac
  41. index d345495..0dd4b1e 100644
  42. --- a/configure.ac
  43. +++ b/configure.ac
  44. @@ -393,6 +393,12 @@ AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]),
  45. [tests_use_rpath=$enableval], [tests_use_rpath=no])
  46. AM_CONDITIONAL(TESTS_RPATH, test "$tests_use_rpath" = yes)
  47. +AC_ARG_ENABLE([progs],
  48. + AS_HELP_STRING([--enable-progs], [enable progs]),
  49. + enable_progs=$enableval,
  50. + enable_progs=yes)
  51. +AM_CONDITIONAL(ENABLE_PROGS, test "$enable_progs" = yes)
  52. +
  53. dnl zlib is mandatory.
  54. save_LIBS="$LIBS"
  55. LIBS=
  56. @@ -579,7 +585,7 @@ saved_LIBS="$LIBS"
  57. AC_SEARCH_LIBS([_obstack_free], [obstack])
  58. LIBS="$saved_LIBS"
  59. case "$ac_cv_search__obstack_free" in
  60. - no) AC_MSG_FAILURE([failed to find _obstack_free]) ;;
  61. + no) obstack_LIBS= ;;
  62. -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
  63. *) obstack_LIBS= ;;
  64. esac
  65. --
  66. 2.30.1