gnu-efi/0035-Make-make-make-DESTDIR-.-foo-install-work-right.patch
Peter Jones 90e6999a07 Update to 3.0.11 and add some fixes and enhancements.
- Update to the stuff in master to fix the issue at:
  https://bodhi.fedoraproject.org/updates/FEDORA-2020-050993b283#comment-1208958
- Update to 3.0.11 (via patches generated from git)
- Plus newer upstream fixes (also via patches generated from git)
- Fix shell exit failures in make
- Fix .reloc section generation
- Fix CHAR8 definition
- Fix "make DESTDIR=..."
- Change the installed .a/.o layout
- Provide makefiles for consumers to use.
- Make the -devel noarch since it's just headers.
- Add a bunch of compatibility symlinks for our older packages.
  These will go away once we've migrated everything using them in fedora
  to use the newer make system...

Signed-off-by: Peter Jones <pjones@redhat.com>
2020-01-28 13:34:07 -05:00

42 lines
1.3 KiB
Diff

From c0963d33ad37ff62da31208b1688d164bd8a1449 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Fri, 25 Oct 2019 15:39:35 -0400
Subject: [PATCH 35/46] Make: make "make DESTDIR=../foo install" work right.
This makes the normal DESTDIR= variable work on the command line, and
makes relative paths always relative to the top-level directory.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
Make.defaults | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/Make.defaults b/Make.defaults
index 696028dd6c2..157559d20ee 100755
--- a/Make.defaults
+++ b/Make.defaults
@@ -47,7 +47,19 @@ ARCHES=aa64 arm ia32 ia64 mips64el x64
# Where to install the package. GNU-EFI will create and access
# lib and include under the root
#
-INSTALLROOT := /
+DESTDIR ?= /
+ifeq ($(origin INSTALLROOT),undefined)
+INSTALLROOT = $(DESTDIR)
+endif
+
+empty :=
+space := $(empty) $(empty)
+stripped = $(subst $(space),/,$(strip $(subst /,$(space),$(1))))
+unstripped = $(subst $(space),/,$(subst /,$(space),$(1)))
+is_absolute = $(subst $(call stripped,$(1)),$(empty),$(call unstripped,$(1)))
+
+override INSTALLROOT:=$(if $(call is_absolute,$(INSTALLROOT)),,$(TOPDIR)/)$(INSTALLROOT)
+
PREFIX := /usr/local
LIBDIR := $(PREFIX)/lib
INSTALL := install
--
2.24.1