[PATCH] Add libebgenv pkg-config

7 views
Skip to first unread message

Christian Storm

unread,
Feb 25, 2022, 8:26:18 AM2/25/22
to efibootg...@googlegroups.com, Christian Storm
From: Christian Storm <christi...@siemens.com>

Add pkg-config for libebgenv to ease run-time detection
of the library flags as well as version checks.

Signed-off-by: Christian Storm <christi...@siemens.com>
---
Makefile.am | 5 +++++
configure.ac | 16 ++++++++++------
libebgenv.pc.in | 24 ++++++++++++++++++++++++
3 files changed, 39 insertions(+), 6 deletions(-)
create mode 100644 libebgenv.pc.in

diff --git a/Makefile.am b/Makefile.am
index f8e094a..6d6a049 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -71,6 +71,11 @@ $(GEN_VERSION_H): $(top_srcdir)/Makefile.in FORCE

CLEANFILES += $(GEN_VERSION_H)

+#
+# pkg-config
+#
+pkgconfig_DATA = libebgenv.pc
+
#
# Static libraries
#
diff --git a/configure.ac b/configure.ac
index 1b36199..a1a83e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -178,19 +178,22 @@ AC_ARG_ENABLE([bootloader],
[enable_bootloader="no"],
[enable_bootloader="yes"])

+dnl pkg-config
+PKG_PROG_PKG_CONFIG()
+if test "x$PKG_CONFIG" = "xno"; then
+ AC_MSG_ERROR([You need to install pkg-config])
+fi
+
AS_IF([test "x$enable_bootloader" != "xno"],
[
PKG_CHECK_MODULES(LIBPCI, libpci)
-
- dnl pkg-config
- PKG_PROG_PKG_CONFIG()
- if test "x$PKG_CONFIG" = "xno"; then
- AC_MSG_ERROR([You need to install pkg-config])
- fi
PKG_CHECK_MODULES(LIBCHECK, check)
])
AM_CONDITIONAL([BOOTLOADER], [test "x$enable_bootloader" != "xno"])

+PKG_INSTALLDIR
+AC_SUBST(LIBEBGENV_VERSION, $(echo $VERSION | cut -dv -f2))
+
dnl Python
AC_PATH_PROGS(PYTHON, [python3 python3.9 python3.8 python3.7 python3.6 python2.7 python2], no)
if test "x$PYTHON" = "xno"; then
@@ -201,6 +204,7 @@ fi
AC_CONFIG_FILES([
Makefile
tools/tests/Makefile
+ libebgenv.pc
])

AC_OUTPUT
diff --git a/libebgenv.pc.in b/libebgenv.pc.in
new file mode 100644
index 0000000..17bee8e
--- /dev/null
+++ b/libebgenv.pc.in
@@ -0,0 +1,24 @@
+# EFI Boot Guard
+# Copyright (c) Siemens AG, 2019-2022
+#
+# Authors:
+# Christian Storm <christi...@siemens.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2. See
+# the COPYING file in the top-level directory.
+#
+# SPDX-License-Identifier: GPL-2.0
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libebgenv
+URL: https://github.com/siemens/efibootguard
+Description: Library to access the EFI Boot Guard environment
+Version: @LIBEBGENV_VERSION@
+Requires.private: zlib
+Libs: -L${libdir} -lebgenv
+Cflags: -I${includedir}
+
--
2.35.1

Jan Kiszka

unread,
Mar 1, 2022, 2:22:21 AM3/1/22
to Christian Storm, efibootg...@googlegroups.com
Thanks, applied, just fixing up this extra newline at EOF above.

Jan

--
Siemens AG, Technology
Competence Center Embedded Linux
Reply all
Reply to author
Forward
0 new messages