From 827a7af51bb120579a7addbcda216300988a3b1e Mon Sep 17 00:00:00 2001 From: "Maxiwell S. Garcia" Date: Mon, 23 Sep 2019 19:30:21 -0300 Subject: configure: Add libelf as a requirement With this library, petitboot is able to open the ELF binary to check information, like annotation in ELF notes section. Minor libelf-dw dependency additions by Jeremy Kerr . Signed-off-by: Maxiwell S. Garcia Signed-off-by: Jeremy Kerr --- configure.ac | 10 ++++++++++ discover/Makefile.am | 3 ++- docker/Dockerfile.builder | 2 ++ utils/Makefile.am | 3 ++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 5d541fb..6683be6 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,15 @@ 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.])] +) + +AC_CHECK_HEADERS([elfutils/libdw.h], + [], + [AC_MSG_FAILURE([elfutils/libdw.h not found. Try installing the package libdw-dev or elfutils-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 +485,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) \ diff --git a/docker/Dockerfile.builder b/docker/Dockerfile.builder index 321629f..8757871 100644 --- a/docker/Dockerfile.builder +++ b/docker/Dockerfile.builder @@ -25,6 +25,8 @@ RUN apt-get update && apt-get install -y \ libncurses-dev \ libssl-dev \ libuv-dev \ + libelf-dev \ + libdw-dev \ pkg-config \ strace \ && rm -rf /var/lib/apt/lists/* diff --git a/utils/Makefile.am b/utils/Makefile.am index a523430..8788150 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -18,7 +18,8 @@ dist_pkglibexec_SCRIPTS = utils/pb-console sbin_PROGRAMS += utils/pb-event utils/pb-config utils_pb_config_LDADD = $(top_builddir)/lib/libpbcore.la \ - $(top_builddir)/discover/platform.ro + $(top_builddir)/discover/platform.ro \ + $(ELF_LIBS) utils_hooks_30_dtb_updates_SOURCES = utils/hooks/30-dtb-updates.c utils_hooks_30_dtb_updates_LDADD = $(top_builddir)/lib/libpbcore.la \ -- cgit v1.2.1