build: Improve eltorito-efi configure option

This commit is contained in:
mintsuki 2022-02-08 15:43:21 +01:00
parent 16b944e360
commit 12ba281252

View File

@ -41,19 +41,24 @@ if ! test "x$GZIP_FOUND" = "xyes"; then
AC_MSG_ERROR([gzip not found, please install gzip before configuring]) AC_MSG_ERROR([gzip not found, please install gzip before configuring])
fi fi
BUILD_ELTORITO_EFI="yes" BUILD_ELTORITO_EFI="default"
AC_ARG_ENABLE([eltorito-efi], AC_ARG_ENABLE([eltorito-efi],
AS_HELP_STRING([--disable-eltorito-efi], [disable limine-eltorito-efi.bin build]), AS_HELP_STRING([--disable-eltorito-efi], [disable limine-eltorito-efi.bin build]),
BUILD_ELTORITO_EFI="$enableval") BUILD_ELTORITO_EFI="$enableval")
AC_CHECK_PROG([MTOOLS_FOUND], [mcopy], [yes]) if ! test "x$BUILD_ELTORITO_EFI" = "xno"; then
if ! test "x$MTOOLS_FOUND" = "xyes"; then AC_CHECK_PROG([MTOOLS_FOUND], [mcopy], [yes])
if ! test "x$MTOOLS_FOUND" = "xyes"; then
if test "x$BUILD_ELTORITO_EFI" = "xyes"; then
AC_MSG_ERROR([mtools not found, install mtools to build limine-eltorito-efi.bin])
fi
AC_MSG_WARN([mtools not found, install mtools to build limine-eltorito-efi.bin]) AC_MSG_WARN([mtools not found, install mtools to build limine-eltorito-efi.bin])
BUILD_ELTORITO_EFI="no" BUILD_ELTORITO_EFI="no"
fi
fi fi
if test "$BUILD_ELTORITO_EFI" = "yes"; then if ! test "x$BUILD_ELTORITO_EFI" = "xno"; then
AC_SUBST(build_eltorito_efi, [yes]) AC_SUBST(build_eltorito_efi, [yes])
fi fi