void-packages/srcpkgs/efitools/patches/06-makefile-cross-compile.p...

38 lines
1.9 KiB
Diff

diff --git a/Make.rules.orig b/Make.rules
index b849cfc4c7..7fdcc6095c 100644
--- a/Make.rules.orig
+++ b/Make.rules
@@ -13,21 +13,25 @@ ARCH3264 =
else
$(error unknown architecture $(ARCH))
endif
-INCDIR = -I$(TOPDIR)include/ -I/usr/include/efi -I/usr/include/efi/$(ARCH) -I/usr/include/efi/protocol
-EFI_CPPFLAGS = -DCONFIG_$(ARCH)
-EFI_CFLAGS = -O2 -g $(ARCH3264) -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check
+INCDIR = -I$(TOPDIR)include \
+ -I$(XBPS_CROSS_BASE)/usr/include/efi \
+ -I$(XBPS_CROSS_BASE)/usr/include/efi/$(ARCH) \
+ -I$(XBPS_CROSS_BASE)/usr/include/efi/protocol
+
+EFI_CPPFLAGS = -DCONFIG_$(ARCH)
+EFI_CFLAGS = -O2 -g $(ARCH3264) -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -fno-stack-protector -ffreestanding -fno-stack-check
EFI_LDFLAGS = -nostdlib
CRTOBJ = crt0-efi-$(ARCH).o
-CRTPATHS = /lib /lib64 /lib/efi /lib64/efi /usr/lib /usr/lib64 /usr/lib/efi /usr/lib64/efi /usr/lib/gnuefi /usr/lib64/gnuefi
-CRTPATH = $(shell for f in $(CRTPATHS); do if [ -e $$f/$(CRTOBJ) ]; then echo $$f; break; fi; done)
+CRTPATHS = $(XBPS_CROSS_BASE)/usr/lib
+CRTPATH = $(XBPS_CROSS_BASE)/usr/lib
CRTOBJS = $(CRTPATH)/$(CRTOBJ)
# there's a bug in the gnu tools ... the .reloc section has to be
# aligned otherwise the file alignment gets screwed up
LDSCRIPT = elf_$(ARCH)_efi.lds
-EFI_LDFLAGS += -shared -Bsymbolic $(CRTOBJS) -L $(CRTPATH) -L /usr/lib -L /usr/lib64 -T $(LDSCRIPT)
+EFI_LDFLAGS += -shared -Bsymbolic $(CRTOBJS) -L $(CRTPATH)\
+ -L $(XBPS_CROSS_BASE)/usr/lib -L $(XBPS_CROSS_BASE)/usr/lib64 -T $(LDSCRIPT)
LOADLIBES = -lefi -lgnuefi $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
FORMAT = --target=efi-app-$(ARCH)
-OBJCOPY = objcopy
MYGUID = 11111111-2222-3333-4444-123456789abc
INSTALL = install
BINDIR = $(DESTDIR)/usr/bin