diff --git a/packages/devel/elfutils/package.mk b/packages/devel/elfutils/package.mk index da1dacf708..ebca5fb122 100644 --- a/packages/devel/elfutils/package.mk +++ b/packages/devel/elfutils/package.mk @@ -14,14 +14,35 @@ PKG_LONGDESC="A collection of utilities to handle ELF objects." PKG_TOOLCHAIN="autotools" PKG_BUILD_FLAGS="+pic" +if [ "${LIBREELEC_VERSION}" = "devel" ]; then + PKG_PROGRAMS="--enable-programs --program-prefix=" + PKG_PROGRAMS_LIST="readelf" +else + PKG_PROGRAMS="--disable-programs" + PKG_PROGRAMS_LIST= +fi + +PKG_CONFIGURE_OPTS_HOST="utrace_cv_cc_biarch=false \ + --disable-programs \ + --disable-nls \ + --with-zlib \ + --without-bzlib \ + --without-lzma" + PKG_CONFIGURE_OPTS_TARGET="utrace_cv_cc_biarch=false \ + ${PKG_PROGRAMS} \ --disable-nls \ --with-zlib \ --without-bzlib \ --without-lzma" -PKG_CONFIGURE_OPTS_HOST="utrace_cv_cc_biarch=false \ - --disable-nls \ - --with-zlib \ - --without-bzlib \ - --without-lzma" +post_makeinstall_target() { + # don't install progs into sysroot + rm -fr ${SYSROOT_PREFIX}/usr/bin + + if [ -n "${PKG_PROGRAMS_LIST}" ]; then + for PKG_TEMP in $(find ${INSTALL}/usr/bin -type f); do + listcontains "${PKG_PROGRAMS_LIST}" ${PKG_TEMP#${INSTALL}/usr/bin/} || rm ${PKG_TEMP} + done + fi +} diff --git a/packages/devel/elfutils/patches/elfutils-001-dont-build-executables.patch b/packages/devel/elfutils/patches/elfutils-001-dont-build-executables.patch deleted file mode 100644 index 4267bde764..0000000000 --- a/packages/devel/elfutils/patches/elfutils-001-dont-build-executables.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- elfutils-0.176/Makefile.am.orig 2019-04-01 12:59:25.141077178 +0200 -+++ elfutils-0.176/Makefile.am 2019-04-01 12:59:34.157100775 +0200 -@@ -28,7 +28,7 @@ - - # Add doc back when we have some real content. - SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \ -- backends src po tests -+ backends po tests - - EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \ - COPYING COPYING-GPLV2 COPYING-LGPLV3 diff --git a/packages/devel/elfutils/patches/elfutils-001-make-executables-optional.patch b/packages/devel/elfutils/patches/elfutils-001-make-executables-optional.patch new file mode 100644 index 0000000000..9bd4edcf47 --- /dev/null +++ b/packages/devel/elfutils/patches/elfutils-001-make-executables-optional.patch @@ -0,0 +1,45 @@ +From ca1a78e042fa55f378f3402559f9cfb41c603406 Mon Sep 17 00:00:00 2001 +From: MilhouseVH +Date: Wed, 4 Dec 2019 09:19:19 +0000 +Subject: [PATCH] make executables optional + +--- + Makefile.am | 5 ++++- + configure.ac | 5 +++++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index 2ff444e..314083f 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -28,7 +28,10 @@ pkginclude_HEADERS = version.h + + # Add doc back when we have some real content. + SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \ +- backends src po tests ++ backends po tests ++if BUILD_PROGRAMS ++ SUBDIRS += src ++endif + + EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \ + COPYING COPYING-GPLV2 COPYING-LGPLV3 +diff --git a/configure.ac b/configure.ac +index b4e012d..0fd46cc 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -85,6 +85,11 @@ AS_IF([test "$use_locks" = yes], + + AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.]) + ++AC_ARG_ENABLE([programs], ++AS_HELP_STRING([--enable-programs], [Build and install programs when enabled (default: disabled)]), ++ [build_programs=$enableval], [build_programs=no]) ++AM_CONDITIONAL(BUILD_PROGRAMS, test "$build_programs" = yes) ++ + AC_PROG_CC + AC_PROG_RANLIB + AC_PROG_YACC +-- +2.20.1 +