Skip to content

Commit

Permalink
elfutils: fix build and enable on non-linux systems
Browse files Browse the repository at this point in the history
Use gnulib for compatibility

Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
nbd168 committed Oct 29, 2023
1 parent 169757c commit 5331e85
Show file tree
Hide file tree
Showing 4 changed files with 932 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ tools-y += cmake
tools-y += cpio
tools-y += dosfstools
tools-y += e2fsprogs
tools-y += elfutils
tools-y += expat
tools-y += fakeroot
tools-y += findutils
Expand Down Expand Up @@ -95,6 +96,7 @@ $(curdir)/cbootimage/compile += $(curdir)/automake/compile
$(curdir)/cmake/compile += $(curdir)/libressl/compile $(curdir)/ninja/compile $(curdir)/expat/compile $(curdir)/xz/compile $(curdir)/zlib/compile $(curdir)/zstd/compile
$(curdir)/dosfstools/compile := $(curdir)/automake/compile
$(curdir)/e2fsprogs/compile := $(curdir)/libtool/compile
$(curdir)/elfutils/compile := $(curdir)/m4/compile $(curdir)/zlib/compile $(curdir)/gnulib/compile
$(curdir)/fakeroot/compile := $(curdir)/libtool/compile
$(curdir)/findutils/compile := $(curdir)/bison/compile
$(curdir)/firmware-utils/compile += $(curdir)/cmake/compile
Expand Down Expand Up @@ -137,9 +139,7 @@ ifeq ($(HOST_OS),Darwin)
tools-y += bash
else
$(curdir)/dwarves/compile += $(curdir)/elfutils/compile
$(curdir)/elfutils/compile := $(curdir)/m4/compile $(curdir)/zlib/compile
tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_DWARVES),y) += dwarves
tools-y += elfutils
endif

ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),)
Expand Down
20 changes: 18 additions & 2 deletions tools/elfutils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,32 @@ PKG_INSTALL:=1

include $(INCLUDE_DIR)/host-build.mk

ifeq ($(HOST_OS),Darwin)
HOST_CFLAGS += -I/opt/homebrew/include
endif

HOST_CFLAGS += -Wno-error

HOST_CONFIGURE_ARGS += \
--without-libintl-prefix \
--without-libiconv-prefix \
--disable-debuginfod \
--disable-libdebuginfod \
--disable-nls \
--disable-shared \
--enable-static \
--without-lzma \
--without-zstd

HOST_MAKE_FLAGS += \
SUBDIRS="lib libelf libcpu backends libebl libdwelf libdwfl libdw"
ifeq ($(HOST_OS),Darwin)
HOST_CONFIGURE_ARGS += --disable-symbol-versioning
endif

Hooks/HostConfigure/Pre := Host/Gnulib $(Hooks/HostConfigure/Pre)
define Host/Gnulib
cd $(HOST_BUILD_DIR); $(STAGING_DIR_HOST)/bin/gnulib-tool --libtool --source-base=libgnu --import argp obstack fts strchrnul progname tsearch;
ln -sf ../lib/eu-config.h $(HOST_BUILD_DIR)/libgnu/;
endef

define Host/Uninstall
-$(call Host/Compile/Default,uninstall)
Expand Down
Loading

0 comments on commit 5331e85

Please sign in to comment.