openwrt/package/system/usign/Makefile
Andre Heider 07730ff346
treewide: add support for "lto" in PKG_BUILD_FLAGS
This reduces open coding and allows to easily add a knob to enable
it treewide, where chosen packages can still opt-out via "no-lto".

Some packages used LTO, but not the linker plugin. This unifies 'em
all to attempt to produce better code.
Quoting man gcc(1):
"This improves the quality of optimization by exposing more code to the
link-time optimizer."

Also use -flto=auto instead of -flto=jobserver, as it's not guaranteed
that every buildsystem uses +$(MAKE) correctly.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-03-21 18:28:22 +01:00

45 lines
1004 B
Makefile

include $(TOPDIR)/rules.mk
PKG_NAME:=usign
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/usign.git
PKG_SOURCE_DATE:=2020-05-23
PKG_SOURCE_VERSION:=f1f65026a94137c91b5466b149ef3ea3f20091e9
PKG_MIRROR_HASH:=3f6569a5e63fdfd032976ac0f79d736d3935101ac1b97fb370514b013c5e6bb6
CMAKE_INSTALL:=1
PKG_CHECK_FORMAT_SECURITY:=1
PKG_BUILD_FLAGS:=no-mips16 lto
PKG_LICENSE:=ISC
PKG_LICENSE_FILES:=
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
define Package/usign
SECTION:=base
CATEGORY:=Base system
DEPENDS:=+libubox
TITLE:=OpenWrt signature verification utility
endef
CMAKE_OPTIONS += \
-DUSE_LIBUBOX=on
define Package/usign/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/usign $(1)/usr/bin
ln -s usign $(1)/usr/bin/signify
endef
$(eval $(call BuildPackage,usign))
$(eval $(call HostBuild))