diff mbox series

[1/3] configure: Add libelf as a requirement

Message ID 20190909141908.8903-2-maxiwell@linux.ibm.com
State Superseded
Headers show
Series discover: Check if the kernel image has Ultravisor support | expand

Commit Message

Maxiwell S. Garcia Sept. 9, 2019, 2:19 p.m. UTC
With this library, petitboot is able to open the ELF binary to check
information, like annotation in ELF notes section.

Signed-off-by: Maxiwell S. Garcia <maxiwell@linux.ibm.com>
---
 configure.ac         | 6 ++++++
 discover/Makefile.am | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/configure.ac b/configure.ac
index 5d541fb..f3382e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,6 +66,11 @@  AC_CHECK_LIB([udev], [udev_new],
 	[AC_MSG_FAILURE([The libudev development library is required by petitboot.  Try installing the package libudev-dev or libudev-devel.])]
 )
 
+AC_CHECK_LIB([elf], [elf_begin],
+	[ELF_LIBS=-lelf],
+	[AC_MSG_FAILURE([The libelf development library is required by petitboot.  Try installing the package libelf-dev or elfutils-libelf-devel.])]
+)
+
 PKG_CHECK_EXISTS(libudev >= 218, [old_udev=no], [old_udev=yes])
 if test "$old_udev" = "yes" ; then
       AC_DEFINE(UDEV_LOGGING, 1, [Support old udev logging interface])
@@ -476,6 +481,7 @@  AS_IF(
 )
  
 AC_SUBST([UDEV_LIBS])
+AC_SUBST([ELF_LIBS])
 AC_SUBST([DEVMAPPER_LIBS])
 AC_SUBST([CRYPT_LIBS])
 AC_SUBST([FDT_LIBS])
diff --git a/discover/Makefile.am b/discover/Makefile.am
index bfe33fa..e2d0e93 100644
--- a/discover/Makefile.am
+++ b/discover/Makefile.am
@@ -58,7 +58,8 @@  discover_pb_discover_LDADD = \
 	discover/native/native-parser.ro \
 	discover/platform.ro \
 	$(core_lib) \
-	$(UDEV_LIBS)
+	$(UDEV_LIBS) \
+	$(ELF_LIBS)
 
 discover_pb_discover_LDFLAGS = \
 	$(AM_LDFLAGS) \