Link against gnu-efi from Debian

Adjust EFIINC, LIBDIR and LIBEFI variables in mk/efi.mk to point to the
files installed by Debian's gnu-efi package.
- The LIBDIR path depends on the build hosts' architecture, so the
  DEB_HOST_ARCH variable needs to be exported to determine the correct
  paths.

Forwarded: not-needed

Gbp-Pq: Name 0004-gnu-efi-from-debian.patch
This commit is contained in:
Lukas Schwaighofer 2017-10-03 18:29:13 +02:00 committed by openKylinBot
parent 245b84eac7
commit 34a6204277
1 changed files with 10 additions and 3 deletions

View File

@ -8,8 +8,15 @@ core = $(topdir)/core
# gnuefi sets up architecture specifics in ia32 or x86_64 sub directories
# set up the LIBDIR and EFIINC for building for the appropriate architecture
GCCOPT := $(call gcc_ok,-fno-stack-protector,)
EFIINC = $(objdir)/include/efi
LIBDIR = $(objdir)/lib
EFIINC = /usr/include/efi
LIBDIR = /usr/lib
ifeq ($(DEB_HOST_ARCH)/$(ARCH),amd64/i386)
LIBDIR = /usr/lib32
endif
ifeq ($(DEB_HOST_ARCH)/$(ARCH),i386/x86_64)
LIBDIR = /usr/lib64
endif
ifeq ($(ARCH),i386)
ARCHOPT = -m32 -march=i386
@ -44,7 +51,7 @@ SFLAGS = $(GCCOPT) $(GCCWARN) $(ARCHOPT) \
-nostdinc -iwithprefix include \
-I$(com32)/libutil/include -I$(com32)/include -I$(com32)/include/sys $(GPLINCLUDE)
LIBEFI = $(objdir)/lib/libefi.a
LIBEFI = $(LIBDIR)/libefi.a
$(LIBEFI):
@echo Building gnu-efi for $(EFI_SUBARCH)