[PATCH] add option to use pkg-config instead of hardcode path to /usr/lib

0 views
Skip to first unread message

Quirin Gylstorff

unread,
Apr 15, 2026, 9:03:11 AM (11 days ago) Apr 15
to efibootg...@googlegroups.com
From: Quirin Gylstorff <quirin.g...@siemens.com>

This fixes debian bug #1125737.

gnu-efi still installs to /usr/lib and that's
not a location pkg-config searches during cross compilation. The
solution here is to move its files to multiarch. Once doing that,
efibootguard fails to build from source, because it hard codes the
assumption that gnu-efi is installed to /usr/lib.

Reported-by: Helmut Grohne <hel...@subdivi.de>
Signed-off-by: Quirin Gylstorff <quirin.g...@siemens.com>
---
configure.ac | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 8f78875..c05f107 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,7 +72,11 @@ AC_ARG_WITH([gnuefi-include-dir],
AC_SUBST(GNUEFI_INC_DIR)
AC_DEFINE_UNQUOTED(GNUEFI_INC_DIR, ["$GNUEFI_INC_DIR"], [The include directory for gnuefi])

-efiroot=$(echo $(cd $GNUEFI_SYS_DIR/usr/lib/$($CC -print-multi-os-directory); pwd))
+PKG_PROG_PKG_CONFIG
+efiroot=$($PKG_CONFIG --variable=libdir gnu-efi)
+if test "x$efiroot" = x; then
+ efiroot=$(echo $(cd $GNUEFI_SYS_DIR/usr/lib/$($CC -print-multi-os-directory); pwd))
+fi

AC_ARG_WITH([gnuefi-lib-dir],
AS_HELP_STRING([--with-gnuefi-lib-dir=DIRECTORY],
--
2.53.0

Jan Kiszka

unread,
Apr 17, 2026, 1:21:18 AM (10 days ago) Apr 17
to Quirin Gylstorff, efibootg...@googlegroups.com
Approach looks ok, just make sure that you reorder the preexisting check
for PKG_PROG_PKG_CONFIG accordingly, avoiding duplicate statements.

Jan

--
Siemens AG, Foundational Technologies
Linux Expert Center
Reply all
Reply to author
Forward
0 new messages