freebsd-ports/sysutils/shim/files/patch-Makefile
Vinícius Zavam b3cd746e21 sysutils/shim: introduce new ARCH support (i386)
Makefile
        bump PORTREVISION;
        USE_CSTD: gnu89 became gnu99 [0];

    files/
        *: if ARCH=i386, replaces ARCH with ia32;
        elf_ia32_efi.lds: sync OUTPUT_FORMAT [1];
        MokManager.c: used UINT32 for MokNum.

Reported by:	pkg-fallout
Approved by:	araujo (mentor)
Differential Revision:	https://reviews.freebsd.org/D18572

[0] shim.c:2176:3: error: this decimal constant is unsigned only in ISO C90
[1] patch-elf_x86_64_efi.lds always appended -freebsd as OUTPUT_FORMAT
2018-12-19 17:30:22 +00:00

56 lines
2.1 KiB
Text

--- Makefile.orig 2015-06-30 18:20:12 UTC
+++ Makefile
@@ -1,5 +1,5 @@
VERSION = 0.9
-RELEASE :=
+RELEASE := ""
ifneq ($(RELEASE),"")
RELEASE="-$(RELEASE)"
endif
@@ -9,15 +9,23 @@ LD = $(CROSS_COMPILE)ld
OBJCOPY = $(CROSS_COMPILE)objcopy
ARCH = $(shell $(CC) -dumpmachine | cut -f1 -d- | sed s,i[3456789]86,ia32,)
+
+ifeq ($(ARCH),amd64)
+ override ARCH := x86_64
+endif
+ifeq ($(ARCH),i386)
+ override ARCH := ia32
+endif
+
OBJCOPY_GTE224 = $(shell expr `$(OBJCOPY) --version |grep ^"GNU objcopy" | sed 's/^.* //g' | cut -f1-2 -d.` \>= 2.24)
SUBDIRS = Cryptlib lib
-LIB_PATH = /usr/lib64
+LIB_PATH = /usr/lib -L$(LOCALBASE)/lib
-EFI_INCLUDE := /usr/include/efi
-EFI_INCLUDES = -nostdinc -ICryptlib -ICryptlib/Include -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol -I$(shell pwd)/include
-EFI_PATH := /usr/lib64/gnuefi
+EFI_INCLUDE := $(LOCALBASE)/include/efi
+EFI_INCLUDES = -nostdinc -ICryptlib -ICryptlib/Include -I$(EFI_INCLUDE) -I$(EFI_INCLUDE)/$(ARCH) -I$(EFI_INCLUDE)/protocol -I$(shell pwd)/include -I/usr/include
+EFI_PATH := $(LOCALBASE)/lib
LIB_GCC = $(shell $(CC) -print-libgcc-file-name)
EFI_LIBS = -lefi -lgnuefi --start-group Cryptlib/libcryptlib.a Cryptlib/OpenSSL/libopenssl.a --end-group $(LIB_GCC)
@@ -65,7 +73,7 @@ endif
LDFLAGS = --hash-style=sysv -nostdlib -znocombreloc -T $(EFI_LDS) -shared -Bsymbolic -L$(EFI_PATH) -L$(LIB_PATH) -LCryptlib -LCryptlib/OpenSSL $(EFI_CRT_OBJS) --build-id=sha1
-TARGET = shim.efi MokManager.efi.signed fallback.efi.signed
+TARGET = shim.efi MokManager.efi fallback.efi
OBJS = shim.o netboot.o cert.o replacements.o version.o
KEYS = shim_cert.h ocsp.* ca.* shim.crt shim.csr shim.p12 shim.pem shim.key shim.cer
SOURCES = shim.c shim.h netboot.c include/PeImage.h include/wincert.h include/console.h replacements.c replacements.h version.c version.h
@@ -156,9 +164,6 @@ endif
-j .note.gnu.build-id \
$(FORMAT) $^ $@.debug
-%.efi.signed: %.efi certdb/secmod.db
- pesign -n certdb -i $< -c "shim" -s -o $@ -f
-
clean:
$(MAKE) -C Cryptlib clean
$(MAKE) -C Cryptlib/OpenSSL clean