From: Jan Kiszka <[email protected]>

gnu-efi upstream as well as distros install the linker scripts into the
lib folder. Thus, there is no reason to configure those two directories
separately.

Remove GNUEFI_LDS_DIR and make sure that GNUEFI_LIB_DIR is set to the
right default, using based on "$CC -print-multi-os-directory". Fix the
reporting at the end of configure as well.

This finally fixes the detection of the gnu-efi location on SUSE.

Signed-off-by: Jan Kiszka <[email protected]>
---
 Makefile.am     |  2 +-
 configure.ac    | 22 ++++++----------------
 docs/COMPILE.md |  1 -
 3 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a03d3ea..911971f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -138,7 +138,7 @@ efi_cflags += \
 endif
 
 efi_ldflags = \
-       -T $(GNUEFI_LDS_DIR)/elf_$(ARCH)_efi.lds \
+       -T $(GNUEFI_LIB_DIR)/elf_$(ARCH)_efi.lds \
        -shared \
        -Bsymbolic \
        -nostdlib \
diff --git a/configure.ac b/configure.ac
index bf4430d..6b8d50d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,26 +63,17 @@ 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))
+
 AC_ARG_WITH([gnuefi-lib-dir],
            AS_HELP_STRING([--with-gnuefi-lib-dir=DIRECTORY],
-                          [specify the lib directory of gnuefi, defaults to 
"$GNUEFI_SYS_DIR/usr/lib"]),
+                          [specify the lib directory of gnuefi, defaults to 
"$efiroot"]),
            [GNUEFI_LIB_DIR="$withval"],
-           [GNUEFI_LIB_DIR="$GNUEFI_SYS_DIR/usr/lib"])
+           [GNUEFI_LIB_DIR="$efiroot"])
 
 AC_SUBST(GNUEFI_LIB_DIR)
 AC_DEFINE_UNQUOTED(GNUEFI_LIB_DIR, ["$GNUEFI_LIB_DIR"], [The lib directory for 
gnuefi])
 
-efiroot=$(echo $(cd ${GNUEFI_LIB_DIR}/$($CC -print-multi-os-directory); pwd))
-
-AC_ARG_WITH([gnuefi-lds-dir],
-           AS_HELP_STRING([--with-gnuefi-lds-dir=DIRECTORY],
-                          [specify the lds directory of gnuefi, defaults to 
"$GNUEFI_LIB_DIR/$($CC -print-multi-os-directory)"]),
-           [GNUEFI_LDS_DIR="$withval"],
-           [GNUEFI_LDS_DIR="$efiroot"])
-
-AC_SUBST(GNUEFI_LDS_DIR)
-AC_DEFINE_UNQUOTED(GNUEFI_LDS_DIR, ["$GNUEFI_LDS_DIR"], [The lds directory for 
gnuefi])
-
 dnl Define ARCH_<NAME> conditionals
 SET_ARCH(I586, i586*)
 SET_ARCH(I686, i686*)
@@ -148,10 +139,9 @@ AC_MSG_RESULT([
         machine type:            $MACHINE_TYPE_NAME
 
         prefix:                  ${prefix}
-       exec_prefix:             ${exec_prefix}
+        exec_prefix:             ${exec_prefix}
         libexecdir:              ${libexecdir}
         libdir:                  ${libdir}
 
-        efi libs:                ${GNUEFI_LIBS}
-        efi lds:                 ${GNUEFI_LDS_DIR}
+        efi libs:                ${GNUEFI_LIB_DIR}
 ])
diff --git a/docs/COMPILE.md b/docs/COMPILE.md
index 51c2008..0429d81 100644
--- a/docs/COMPILE.md
+++ b/docs/COMPILE.md
@@ -40,7 +40,6 @@ autoreconf -fi ..
 ../configure --host=i586 --build=x86_64-unknown-linux-gnu \
  --with-gnuefi-sys-dir=<sys-root-dir> \
  --with-gnuefi-include-dir=<sys-root-dir>/usr/include/efi \
- --with-gnuefi-lds-dir=<sys-root-dir>/usr/lib \
  --with-gnuefi-lib-dir=<sys-root-dir>/usr/lib
 make
 ```
-- 
2.12.3

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/068944564e85d9b5ff08b09551044defc91f4765.1506284412.git.jan.kiszka%40siemens.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to