Skip to content

Commit

Permalink
(#4493) libelf: Update gnu-config scripts to fix armv8 build
Browse files Browse the repository at this point in the history
closes #3446
  • Loading branch information
bobrofon authored Feb 9, 2021
1 parent 26014cc commit 2b63ff3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions recipes/libelf/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def configure(self):
def build_requirements(self):
if self.settings.os != "Windows":
self.build_requires("autoconf/2.69")
self.build_requires("gnu-config/cci.20201022")

def source(self):
tools.get(**self.conan_data["sources"][self.version])
Expand Down Expand Up @@ -86,13 +87,27 @@ def _package_autotools(self):
if self.settings.os == "Linux" and self.options.shared:
os.remove(os.path.join(self.package_folder, "lib", "libelf.a"))

@property
def _user_info_build(self):
# If using the experimental feature with different context for host and
# build, the 'user_info' attributes of the 'build_requires' packages
# will be located into the 'user_info_build' object. In other cases they
# will be located into the 'deps_user_info' object.
return getattr(self, "user_info_build", None) or self.deps_user_info

def build(self):
if self.settings.os == "Windows":
self._build_cmake()
else:
tools.replace_in_file(os.path.join(self._source_subfolder, "lib", "Makefile.in"),
"$(LINK_SHLIB)",
"$(LINK_SHLIB) $(LDFLAGS)")
# libelf sources contains really outdated 'config.sub' and
# 'config.guess' files. It not allows to build libelf for armv8 arch.
shutil.copy(self._user_info_build["gnu-config"].CONFIG_SUB,
os.path.join(self._source_subfolder, "config.sub"))
shutil.copy(self._user_info_build["gnu-config"].CONFIG_GUESS,
os.path.join(self._source_subfolder, "config.guess"))
self._build_autotools()

def package(self):
Expand Down

0 comments on commit 2b63ff3

Please sign in to comment.