chiark / gitweb /
build-sys: fix check for efi-lds file
authorMirco Tischler <mt-ml@gmx.de>
Thu, 5 Mar 2015 00:22:01 +0000 (01:22 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 5 Mar 2015 00:33:29 +0000 (19:33 -0500)
Using the DIR macro breaks caching and has no benefit as it only offers
performance improvements when AS_FOR is used with a single element list.
Also --with-lds-dir= was broken as we never set have_efi_lds in this case.
Fix this and check if PATH actually contains the efi-lds file.

configure.ac

index 419b5d4e8d2db24d2a972e169184c3fb39979970..14518bc52b1dd60fd7a2e1d4c776a8807170c529 100644 (file)
@@ -1182,9 +1182,10 @@ AS_IF([test "x$enable_gnuefi" != "xno"], [
         have_efi_lds=no
         AC_ARG_WITH(efi-ldsdir,
                 AS_HELP_STRING([--with-efi-ldsdir=PATH], [Path to EFI lds directory]),
         have_efi_lds=no
         AC_ARG_WITH(efi-ldsdir,
                 AS_HELP_STRING([--with-efi-ldsdir=PATH], [Path to EFI lds directory]),
-                [EFI_LDS_DIR="$withval"],
+                [EFI_LDS_DIR="$withval" && AC_CHECK_FILE([${EFI_LDS_DIR}/elf_${EFI_ARCH}_efi.lds],
+                        [have_efi_lds=yes])],
                 [AS_FOR([DIR], [EFI_LDS_DIR], ["${efiroot}/gnuefi" "${efiroot}"],
                 [AS_FOR([DIR], [EFI_LDS_DIR], ["${efiroot}/gnuefi" "${efiroot}"],
-                        [AC_CHECK_FILE([DIR/elf_${EFI_ARCH}_efi.lds],
+                        [AC_CHECK_FILE([${EFI_LDS_DIR}/elf_${EFI_ARCH}_efi.lds],
                                        [have_efi_lds=yes && break])])])
         AS_IF([test "x$have_efi_lds" = xyes],
               [AC_SUBST([EFI_LDS_DIR])],
                                        [have_efi_lds=yes && break])])])
         AS_IF([test "x$have_efi_lds" = xyes],
               [AC_SUBST([EFI_LDS_DIR])],