forked from opencomputeproject/onie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gnu-efi-3.0.6: add library to build system
This patch adds the gnu-efi library to the ONIE build system. Signed-off-by: Curt Brune <[email protected]>
- Loading branch information
Curt Brune
committed
Feb 27, 2018
1 parent
329681a
commit 10c8ed1
Showing
5 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#------------------------------------------------------------------------------- | ||
# | ||
# Copyright (C) 2017 Curt Brune <[email protected]> | ||
# | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
#------------------------------------------------------------------------------- | ||
# | ||
# This is a makefile fragment that defines the build of gnu-efi | ||
# | ||
|
||
GNU_EFI_VERSION = 3.0.6 | ||
GNU_EFI_TARBALL = gnu-efi-$(GNU_EFI_VERSION).tar.bz2 | ||
GNU_EFI_TARBALL_URLS += $(ONIE_MIRROR) https://downloads.sourceforge.net/project/gnu-efi | ||
GNU_EFI_BUILD_DIR = $(USER_BUILDDIR)/gnu-efi | ||
GNU_EFI_DIR = $(GNU_EFI_BUILD_DIR)/gnu-efi-$(GNU_EFI_VERSION) | ||
|
||
GNU_EFI_SRCPATCHDIR = $(PATCHDIR)/gnu-efi | ||
GNU_EFI_DOWNLOAD_STAMP = $(DOWNLOADDIR)/gnu-efi-download | ||
GNU_EFI_SOURCE_STAMP = $(USER_STAMPDIR)/gnu-efi-source | ||
GNU_EFI_PATCH_STAMP = $(USER_STAMPDIR)/gnu-efi-patch | ||
GNU_EFI_BUILD_STAMP = $(USER_STAMPDIR)/gnu-efi-build | ||
GNU_EFI_INSTALL_STAMP = $(STAMPDIR)/gnu-efi-install | ||
GNU_EFI_STAMP = $(GNU_EFI_SOURCE_STAMP) \ | ||
$(GNU_EFI_PATCH_STAMP) \ | ||
$(GNU_EFI_BUILD_STAMP) \ | ||
$(GNU_EFI_INSTALL_STAMP) | ||
|
||
GNU_EFI_LIB_PATH = $(DEV_SYSROOT)/usr/lib | ||
GNU_EFI_INCLUDE = $(DEV_SYSROOT)/usr/include/efi | ||
|
||
|
||
PHONY += gnu-efi gnu-efi-download gnu-efi-source gnu-efi-patch \ | ||
gnu-efi-build gnu-efi-install gnu-efi-clean gnu-efi-download-clean | ||
|
||
gnu-efi: $(GNU_EFI_STAMP) | ||
|
||
DOWNLOAD += $(GNU_EFI_DOWNLOAD_STAMP) | ||
gnu-efi-download: $(GNU_EFI_DOWNLOAD_STAMP) | ||
$(GNU_EFI_DOWNLOAD_STAMP): $(PROJECT_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Getting upstream gnu-efi ====" | ||
$(Q) $(SCRIPTDIR)/fetch-package $(DOWNLOADDIR) $(UPSTREAMDIR) \ | ||
$(GNU_EFI_TARBALL) $(GNU_EFI_TARBALL_URLS) | ||
$(Q) touch $@ | ||
|
||
SOURCE += $(GNU_EFI_SOURCE_STAMP) | ||
gnu-efi-source: $(GNU_EFI_SOURCE_STAMP) | ||
$(GNU_EFI_SOURCE_STAMP): $(USER_TREE_STAMP) $(GNU_EFI_DOWNLOAD_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Extracting upstream gnu-efi ====" | ||
$(Q) $(SCRIPTDIR)/extract-package $(GNU_EFI_BUILD_DIR) $(DOWNLOADDIR)/$(GNU_EFI_TARBALL) | ||
$(Q) touch $@ | ||
|
||
gnu-efi-patch: $(GNU_EFI_PATCH_STAMP) | ||
$(GNU_EFI_PATCH_STAMP): $(GNU_EFI_SRCPATCHDIR)/* $(GNU_EFI_SOURCE_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Patching gnu-efi ====" | ||
$(Q) $(SCRIPTDIR)/apply-patch-series $(GNU_EFI_SRCPATCHDIR)/series $(GNU_EFI_DIR) | ||
$(Q) touch $@ | ||
|
||
ifndef MAKE_CLEAN | ||
GNU_EFI_NEW_FILES = $(shell test -d $(GNU_EFI_DIR) && test -f $(GNU_EFI_BUILD_STAMP) && \ | ||
find -L $(GNU_EFI_DIR) -newer $(GNU_EFI_BUILD_STAMP) -type f -print -quit) | ||
endif | ||
|
||
gnu-efi-build: $(GNU_EFI_BUILD_STAMP) | ||
$(GNU_EFI_BUILD_STAMP): $(GNU_EFI_PATCH_STAMP) $(GNU_EFI_NEW_FILES) \ | ||
| $(DEV_SYSROOT_INIT_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Building gnu-efi-$(GNU_EFI_VERSION) ====" | ||
$(Q) PATH='$(CROSSBIN):$(PATH)' \ | ||
$(MAKE) -j1 -C $(GNU_EFI_DIR) \ | ||
CROSS_COMPILE=$(CROSSPREFIX) | ||
$(Q) PATH='$(CROSSBIN):$(PATH)' \ | ||
$(MAKE) -j1 -C $(GNU_EFI_DIR)/apps \ | ||
CROSS_COMPILE=$(CROSSPREFIX) | ||
$(Q) touch $@ | ||
|
||
gnu-efi-install: $(GNU_EFI_INSTALL_STAMP) | ||
$(GNU_EFI_INSTALL_STAMP): $(SYSROOT_INIT_STAMP) $(GNU_EFI_BUILD_STAMP) | ||
$(Q) rm -f $@ && eval $(PROFILE_STAMP) | ||
$(Q) echo "==== Installing gnu-efi in $(DEV_SYSROOT) ====" | ||
$(Q) PATH='$(CROSSBIN):$(PATH)' \ | ||
$(MAKE) -j1 -C $(GNU_EFI_DIR) \ | ||
CROSS_COMPILE=$(CROSSPREFIX) \ | ||
INSTALLROOT=$(DEV_SYSROOT) PREFIX=/usr \ | ||
install | ||
$(Q) touch $@ | ||
|
||
USERSPACE_CLEAN += gnu-efi-clean | ||
gnu-efi-clean: | ||
$(Q) rm -rf $(GNU_EFI_BUILD_DIR) | ||
$(Q) rm -f $(GNU_EFI_STAMP) | ||
$(Q) echo "=== Finished making $@ for $(PLATFORM)" | ||
|
||
DOWNLOAD_CLEAN += gnu-efi-download-clean | ||
gnu-efi-download-clean: | ||
$(Q) rm -f $(GNU_EFI_DOWNLOAD_STAMP) $(DOWNLOADDIR)/$(GNU_EFI_TARBALL) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This series applies on GIT commit 57632e2e12d41deed491f5d1e90353b6e335c7ce | ||
update-makefile-patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
update makefile patch | ||
|
||
Minor updates to the Makefile to pass in ONIE build environment | ||
variables. | ||
|
||
diff --git a/Make.defaults b/Make.defaults | ||
index d825397..7c2f7d2 100755 | ||
--- a/Make.defaults | ||
+++ b/Make.defaults | ||
@@ -75,6 +75,11 @@ ifeq ($(ARCH),amd64) | ||
override ARCH := x86_64 | ||
endif | ||
|
||
+# Seed compiler and linker flags ONIE build environment flags | ||
+CFLAGS = $(ONIE_CFLAGS) | ||
+CPPFLAGS = $(ONIE_CPPFLAGS) | ||
+LDFLAGS = $(ONIE_LDFLAGS) | ||
+ | ||
# | ||
# Where to build the package | ||
# | ||
diff --git a/apps/Makefile b/apps/Makefile | ||
index cfae62d..3377d2a 100644 | ||
--- a/apps/Makefile | ||
+++ b/apps/Makefile | ||
@@ -45,14 +45,14 @@ TOPDIR = $(SRCDIR)/.. | ||
CDIR=$(TOPDIR)/.. | ||
LINUX_HEADERS = /usr/src/sys/build | ||
CPPFLAGS += -D__KERNEL__ -I$(LINUX_HEADERS)/include | ||
-CRTOBJS = ../gnuefi/crt0-efi-$(ARCH).o | ||
+CRTOBJS = ../$(ARCH)/gnuefi/crt0-efi-$(ARCH).o | ||
|
||
LDSCRIPT = $(TOPDIR)/gnuefi/elf_$(ARCH)_efi.lds | ||
ifneq (,$(findstring FreeBSD,$(OS))) | ||
LDSCRIPT = $(TOPDIR)/gnuefi/elf_$(ARCH)_fbsd_efi.lds | ||
endif | ||
|
||
-LDFLAGS += -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS) | ||
+LDFLAGS += -shared -Bsymbolic -L../$(ARCH)/lib -L../$(ARCH)/gnuefi $(CRTOBJS) | ||
|
||
LOADLIBES += -lefi -lgnuefi | ||
LOADLIBES += $(LIBGCC) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
9f0f75b64c84423f3386da6f3200f5ed7471d9cb gnu-efi-3.0.6.tar.bz2 |