2
1

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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. From dfea82b761b2ea4708fbf9370a5467ae4be525ca 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. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  14. Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
  15. ---
  16. Makefile.am | 6 +++++-
  17. configure.ac | 6 ++++++
  18. 2 files changed, 11 insertions(+), 1 deletion(-)
  19. diff --git a/Makefile.am b/Makefile.am
  20. index 2ff444e7bf1d..70443abb4fb6 100644
  21. --- a/Makefile.am
  22. +++ b/Makefile.am
  23. @@ -26,9 +26,13 @@ AM_MAKEFLAGS = --no-print-directory
  24. pkginclude_HEADERS = version.h
  25. +if ENABLE_PROGS
  26. +PROGS_SUBDIR = src
  27. +endif
  28. +
  29. # Add doc back when we have some real content.
  30. SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \
  31. - backends src po tests
  32. + backends $(PROGS_SUBDIR) po tests
  33. EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
  34. COPYING COPYING-GPLV2 COPYING-LGPLV3
  35. diff --git a/configure.ac b/configure.ac
  36. index c2c1d90b2133..7b4c38381cca 100644
  37. --- a/configure.ac
  38. +++ b/configure.ac
  39. @@ -259,6 +259,12 @@ AC_SUBST([LIBEBL_SUBDIR])
  40. AC_DEFINE_UNQUOTED(LIBEBL_SUBDIR, "$LIBEBL_SUBDIR")
  41. AH_TEMPLATE([LIBEBL_SUBDIR], [$libdir subdirectory containing libebl modules.])
  42. +AC_ARG_ENABLE([progs],
  43. + AS_HELP_STRING([--enable-progs], [enable progs]),
  44. + enable_progs=$enableval,
  45. + enable_progs=yes)
  46. +AM_CONDITIONAL(ENABLE_PROGS, test "$enable_progs" = yes)
  47. +
  48. dnl zlib is mandatory.
  49. save_LIBS="$LIBS"
  50. LIBS=
  51. --
  52. 2.11.0