From cba49f2deab481045408d5452ac8c84fc03bccd5 Mon Sep 17 00:00:00 2001 From: Matt Clarkson Date: Thu, 6 Apr 2017 14:12:11 +0100 Subject: [PATCH] build-sys: correctly search for gnu-efi header When the user provides the --with-efi-includedir we incorrectly search for the header at /usr/include not the provided location. This patch changes the check to use the provided value so that non-standard header locations are supported. This situation occurs commonly when cross-compiling systemd because the GNU EFI headers and library will not be installed into the root locations but highly likely a temporary system root. --- configure.ac | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 3835413..a95e984 100644 --- a/configure.ac +++ b/configure.ac @@ -1306,7 +1306,13 @@ AC_SUBST([EFI_MACHINE_TYPE_NAME]) have_gnuefi=no AC_ARG_ENABLE(gnuefi, AS_HELP_STRING([--enable-gnuefi], [enable optional gnuefi support])) AS_IF([test "x$enable_gnuefi" != "xno"], [ - AC_CHECK_HEADERS(efi/${EFI_ARCH}/efibind.h, + AC_ARG_WITH(efi-includedir, + AS_HELP_STRING([--with-efi-includedir=PATH], [path to EFI include directory]), + [EFI_INC_DIR="$withval"], [EFI_INC_DIR="/usr/include"] + ) + AC_SUBST([EFI_INC_DIR]) + + AC_CHECK_HEADERS(${EFI_INC_DIR}/efi/${EFI_ARCH}/efibind.h, [AC_DEFINE(HAVE_GNUEFI, 1, [Define if gnuefi is available]) have_gnuefi=yes], [AS_IF([test "x$enable_gnuefi" = xyes], @@ -1335,12 +1341,6 @@ AS_IF([test "x$enable_gnuefi" != "xno"], [ [AS_IF([test "x$enable_gnuefi" = xyes], [AC_MSG_ERROR([*** gnuefi support requested but files not found])], [have_gnuefi=no])]) - - AC_ARG_WITH(efi-includedir, - AS_HELP_STRING([--with-efi-includedir=PATH], [path to EFI include directory]), - [EFI_INC_DIR="$withval"], [EFI_INC_DIR="/usr/include"] - ) - AC_SUBST([EFI_INC_DIR]) ]) AM_CONDITIONAL(HAVE_GNUEFI, [test "x$have_gnuefi" = xyes]) -- 2.7.4