Author: Dharanendiran <dharanendiran@timesys.com>
Date: Sun, 27 Sep 2026 06:38:18 +0530

Based on:
https://gitlab.com/buildroot.org/buildroot/-/raw/e125a47fabaf87de1730dcc7ec0f1f0283b49801/package/elfutils/0001-Add-a-enable-disable-progs-configure-option.patch

---
 Makefile.in |  3 ++-
 configure   | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/Makefile.in b/Makefile.in
index 2f88e12..9bde365 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -520,8 +520,9 @@ ACLOCAL_AMFLAGS = -I m4
 # Don't make make repeat.
 AM_MAKEFLAGS = --no-print-directory
 pkginclude_HEADERS = version.h
+@ENABLE_PROGS_TRUE@PROGS_SUBDIR = src
 SUBDIRS = config lib libelf libcpu backends libebl libdwelf libdwfl \
-	  libdwfl_stacktrace libdw libasm debuginfod src po doc tests
+	  libdwfl_stacktrace libdw libasm debuginfod $(PROGS_SUBDIR) po doc tests
 
 EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING SECURITY \
 	     COPYING COPYING-GPLV2 COPYING-LGPLV3 CONDUCT
diff --git a/configure b/configure
index 6fcc254..385c522 100755
--- a/configure
+++ b/configure
@@ -772,6 +772,8 @@ BZLIB_FALSE
 BZLIB_TRUE
 ZLIB_FALSE
 ZLIB_TRUE
+ENABLE_PROGS_FALSE
+ENABLE_PROGS_TRUE
 TESTS_RPATH_FALSE
 TESTS_RPATH_TRUE
 BUILD_STATIC_FALSE
@@ -942,6 +944,7 @@ with_valgrind
 enable_valgrind_annotations
 enable_install_elfh
 enable_tests_rpath
+enable_progs
 with_zlib
 with_bzlib
 with_lzma
@@ -1651,6 +1654,7 @@ Optional Features:
                           insert extra annotations for better valgrind support
   --enable-install-elfh   install elf.h in include dir
   --enable-tests-rpath    build $ORIGIN-using rpath into tests
+  --enable-progs          enable progs
   --disable-demangler     Disable libstdc++ demangle support
   --disable-textrelcheck  Disable textrelcheck being a fatal error
   --disable-symbol-versioning
@@ -8331,6 +8335,24 @@ else
 fi
 
 
+# Check whether --enable-progs was given.
+if test ${enable_progs+y}
+then :
+  enableval=$enable_progs; enable_progs=$enableval
+else case e in #(
+  e) enable_progs=yes ;;
+esac
+fi
+
+ if test "$enable_progs" = yes; then
+  ENABLE_PROGS_TRUE=
+  ENABLE_PROGS_FALSE='#'
+else
+  ENABLE_PROGS_TRUE='#'
+  ENABLE_PROGS_FALSE=
+fi
+
+
 save_LIBS="$LIBS"
 LIBS=
 
@@ -15281,6 +15303,10 @@ if test -z "${TESTS_RPATH_TRUE}" && test -z "${TESTS_RPATH_FALSE}"; then
   as_fn_error $? "conditional \"TESTS_RPATH\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${ENABLE_PROGS_TRUE}" && test -z "${ENABLE_PROGS_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_PROGS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${ZLIB_TRUE}" && test -z "${ZLIB_FALSE}"; then
   as_fn_error $? "conditional \"ZLIB\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
-- 
2.25.1

