Skip to content

Commit cba49f2

Browse files
committed
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.
1 parent d60c527 commit cba49f2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

configure.ac

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,13 @@ AC_SUBST([EFI_MACHINE_TYPE_NAME])
13061306
have_gnuefi=no
13071307
AC_ARG_ENABLE(gnuefi, AS_HELP_STRING([--enable-gnuefi], [enable optional gnuefi support]))
13081308
AS_IF([test "x$enable_gnuefi" != "xno"], [
1309-
AC_CHECK_HEADERS(efi/${EFI_ARCH}/efibind.h,
1309+
AC_ARG_WITH(efi-includedir,
1310+
AS_HELP_STRING([--with-efi-includedir=PATH], [path to EFI include directory]),
1311+
[EFI_INC_DIR="$withval"], [EFI_INC_DIR="/usr/include"]
1312+
)
1313+
AC_SUBST([EFI_INC_DIR])
1314+
1315+
AC_CHECK_HEADERS(${EFI_INC_DIR}/efi/${EFI_ARCH}/efibind.h,
13101316
[AC_DEFINE(HAVE_GNUEFI, 1, [Define if gnuefi is available])
13111317
have_gnuefi=yes],
13121318
[AS_IF([test "x$enable_gnuefi" = xyes],
@@ -1335,12 +1341,6 @@ AS_IF([test "x$enable_gnuefi" != "xno"], [
13351341
[AS_IF([test "x$enable_gnuefi" = xyes],
13361342
[AC_MSG_ERROR([*** gnuefi support requested but files not found])],
13371343
[have_gnuefi=no])])
1338-
1339-
AC_ARG_WITH(efi-includedir,
1340-
AS_HELP_STRING([--with-efi-includedir=PATH], [path to EFI include directory]),
1341-
[EFI_INC_DIR="$withval"], [EFI_INC_DIR="/usr/include"]
1342-
)
1343-
AC_SUBST([EFI_INC_DIR])
13441344
])
13451345
AM_CONDITIONAL(HAVE_GNUEFI, [test "x$have_gnuefi" = xyes])
13461346

0 commit comments

Comments
 (0)