Skip to content

Commit

Permalink
tools/elfutils: simplify portability patch
Browse files Browse the repository at this point in the history
Several changes to the elfutils source files
made during the process of figuring out how to
successfully build elfutils on macOS
turn out to not be necessary to do so,
and were most likely leftover bits during testing.

Remove the line changes that are not needed
and add some line changes to adapt to sources as is:

 - Remove now unnecessary bump to autoconf version prereq
 - AC_CONFIG_MACRO_DIRS is not necessary to define
   as ACLOCAL_AMFLAGS is already defined in Makefiles
 - let libtool "enable_static" variable also decide the value
   of the local conditional BUILD_STATIC
 - override configure variables instead of removing
   checks for libraries or additions to LDFLAGS
 - only exclude "hidden" attribute for macOS instead of deleting
 - preserve original list of sources to build for libelf
 - use openwrt Makefile to add gnulib headers
 - use openwrt Makefile to add LIBADD variables
 - remove deletion of variables and rules for shared objects
 - prefer recursively expanded variables over muliple renames
   each time that a word is added to its value
 - remove changes to subdirectories that are not built
   and remove changes to target files of those subdirectories
 - prefer basic text rename over variables in cases where
   there would be no line number difference
 - give LT_INIT forced default values that match upstream
 - move gl_EARLY and gl_INIT down relative to compiler checks
 - reorganize some line changes to save some lines

Signed-off-by: Michael Pratt <[email protected]>
Link: openwrt/openwrt#15690
Signed-off-by: Robert Marko <[email protected]>
  • Loading branch information
mcprat authored and robimarko committed Jun 19, 2024
1 parent e6d1062 commit 447093f
Show file tree
Hide file tree
Showing 2 changed files with 155 additions and 392 deletions.
9 changes: 9 additions & 0 deletions tools/elfutils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ export $(PKG_GNULIB_BASE)=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/$(PKG_GNULIB_BASE
export $(PKG_GNULIB_BASE)_tsearch=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/$(PKG_GNULIB_BASE)_la-tsearch.lo

HOST_MAKE_FLAGS += \
DEFAULT_INCLUDES='-I. -I$$$$(top_builddir) -I$$$$(top_srcdir)/$(PKG_GNULIB_BASE)' \
AM_LDFLAGS='$$$$(STACK_USAGE_NO_ERROR)' \
libelf_la_LIBADD='../lib/libeu.la -lz $$$$(zstd_LIBS) -lpthread' \
libdw_la_LIBADD='../libdwfl/libdwfl.la ../libdwelf/libdwelf.la ../libebl/libebl.la ../backends/libebl_backends.la ../libcpu/libcpu.la' \
LIBS+='$$$$(if $$$$(findstring $(lastword $(PKG_SUBDIRS)),$$$$(subdir)), $$$$($(PKG_GNULIB_BASE)))' \
LIBS+='$$$$(wildcard $$$$($(PKG_GNULIB_BASE)_tsearch))' \
REPLACE_FCNTL=0 REPLACE_FREE=0 REPLACE_FSTAT=0 REPLACE_OPEN=0 \
Expand Down Expand Up @@ -86,6 +89,12 @@ ifeq ($(HOST_OS),Darwin)
HOST_CONFIGURE_ARGS += --disable-symbol-versioning
endif

HOST_CONFIGURE_VARS += \
ac_cv_search_argp_parse=yes \
ac_cv_search_fts_close=yes \
ac_cv_search__obstack_free=yes \
ac_cv_buildid=yes

Hooks/HostConfigure/Pre := Host/Gnulib $(Hooks/HostConfigure/Pre)
define Host/Gnulib
$(STAGING_DIR_HOST)/bin/gnulib-tool $(PKG_GNULIB_ARGS) $(PKG_GNULIB_MODS);
Expand Down
Loading

0 comments on commit 447093f

Please sign in to comment.