firmware-utils: package oseama
[openwrt/staging/hauke.git] / include / package.mk
index 0fb947f035c21d3177cb5b99923b2739722fb8bc..f03cb15f05d5ac7e50e31104757e5cb46148d26c 100644 (file)
@@ -24,12 +24,6 @@ PKG_JOBS?=$(if $(PKG_BUILD_PARALLEL),$(MAKE_J),-j1)
 endif
 
 PKG_BUILD_FLAGS?=
-# TODO remove this when all packages moved to PKG_BUILD_FLAGS=no-mips16
-PKG_USE_MIPS16?=1
-ifneq ($(strip $(PKG_USE_MIPS16)),1)
-  PKG_BUILD_FLAGS+=no-mips16
-endif
-
 __unknown_flags=$(filter-out no-iremap no-mips16 gc-sections no-gc-sections lto no-lto,$(PKG_BUILD_FLAGS))
 ifneq ($(__unknown_flags),)
   $(error unknown PKG_BUILD_FLAGS: $(__unknown_flags))
@@ -51,12 +45,12 @@ ifdef CONFIG_USE_MIPS16
     TARGET_CXXFLAGS += -mips16 -minterlink-mips16
   endif
 endif
-ifeq ($(call pkg_build_flag,gc-sections,0),1)
+ifeq ($(call pkg_build_flag,gc-sections,$(if $(CONFIG_USE_GC_SECTIONS),1,0)),1)
   TARGET_CFLAGS+= -ffunction-sections -fdata-sections
   TARGET_CXXFLAGS+= -ffunction-sections -fdata-sections
   TARGET_LDFLAGS+= -Wl,--gc-sections
 endif
-ifeq ($(call pkg_build_flag,lto,0),1)
+ifeq ($(call pkg_build_flag,lto,$(if $(CONFIG_USE_LTO),1,0)),1)
   TARGET_CFLAGS+= -flto=auto -fno-fat-lto-objects
   TARGET_CXXFLAGS+= -flto=auto -fno-fat-lto-objects
   TARGET_LDFLAGS+= -flto=auto -fuse-linker-plugin