562dd6c70a
efivar contains tools and libraries to manipulate EFI variables. This package has some restrictions to build. It needs uchar.h which apparently does not come in uClibc, and it also needs __bswap_constant_*() definitions which are only present in glibc. So, this package was limited to build with glibc toolchains. Although it probably makes sense mostly on x86, x86-64 and aarch64 architectures, there are no architecture specific limitations which would prevent it to build for other architectures, so this restriction was not imposed. This package has been build-tested additionaly on many architectures which support glibc, such as mips, MicroBlaze, sparc64, ppc64. There were some build flag issues found when building to some of these some architectures, although the flags can be also added in the general case, so they were added by default. It has also been found that in some host systems it failed to build due to not generating the .pc files. This has been tracked to the use of make 3.81, so a patch was prepared for it and was submitted upstream. There's also a dependency on the linux/nvme.h header, which is somewhat conturbed, as it has appeared in user space linux headers 3.12 and in 4.4 it was renamed. This has been solved by restricting it to build with linux headers >= 3.12 and a patch from upstream was picked which fixes it for linux headers >= 4.4. Signed-off-by: Erico Nunes <nunes.erico@gmail.com> [Thomas: - Pass TARGET_LDFLAGS in LDFLAGS. - Pass -shared-libgcc only on Microblaze.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
57 lines
1.6 KiB
Makefile
57 lines
1.6 KiB
Makefile
################################################################################
|
|
#
|
|
# efivar
|
|
#
|
|
################################################################################
|
|
|
|
EFIVAR_VERSION = 0.23
|
|
EFIVAR_SITE = $(call github,rhinstaller,efivar,$(EFIVAR_VERSION))
|
|
EFIVAR_LICENSE = LGPLv2.1
|
|
EFIVAR_LICENSE_FILES = COPYING
|
|
EFIVAR_DEPENDENCIES = popt
|
|
EFIVAR_INSTALL_STAGING = YES
|
|
|
|
# BINTARGETS is set to skip efivar-static which requires static popt,
|
|
# and since we depend on glibc, we will never be built in a
|
|
# static-only environment.
|
|
# -fPIC is needed at least on MIPS, otherwise fails to build shared
|
|
# -library.
|
|
EFIVAR_MAKE_OPTS = \
|
|
libdir=/usr/lib \
|
|
BINTARGETS=efivar \
|
|
LDFLAGS="$(TARGET_LDFLAGS) -fPIC"
|
|
|
|
# Explicitly linking with shared libgcc is required on MicroBlaze,
|
|
# otherwise it fails due to FDE encoding in static libgcc.
|
|
ifeq ($(BR2_microblaze),y)
|
|
EFIVAR_MAKE_OPTS += SOFLAGS="-shared -shared-libgcc"
|
|
endif
|
|
|
|
define EFIVAR_BUILD_CMDS
|
|
# makeguids is an internal host tool and must be built separately with
|
|
# $(HOST_CC), otherwise it gets cross-built.
|
|
$(HOST_MAKE_ENV) $(HOST_CONFIGURE_OPTS) \
|
|
CFLAGS="$(HOST_CFLAGS) -std=c99" \
|
|
$(MAKE) -C $(@D)/src makeguids
|
|
|
|
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
|
|
$(EFIVAR_MAKE_OPTS) \
|
|
all
|
|
endef
|
|
|
|
define EFIVAR_INSTALL_STAGING_CMDS
|
|
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
|
|
$(EFIVAR_MAKE_OPTS) \
|
|
DESTDIR="$(STAGING_DIR)" \
|
|
install
|
|
endef
|
|
|
|
define EFIVAR_INSTALL_TARGET_CMDS
|
|
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D) \
|
|
$(EFIVAR_MAKE_OPTS) \
|
|
DESTDIR="$(TARGET_DIR)" \
|
|
install
|
|
endef
|
|
|
|
$(eval $(generic-package))
|