kernel: bump 6.1 to 6.1.61
[openwrt/staging/stintel.git] / include / u-boot.mk
index 4993eb6a060c70792ada7b63caee32666c1075fb..2b8106410f592182ad7dc0691f6cfdd47ec695f1 100644 (file)
@@ -3,7 +3,8 @@ PKG_NAME ?= u-boot
 ifndef PKG_SOURCE_PROTO
 PKG_SOURCE = $(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL = \
-       http://sources.lede-project.org \
+       https://mirror.cyberbits.eu/u-boot \
+       https://ftp.denx.de/pub/u-boot \
        ftp://ftp.denx.de/pub/u-boot
 endif
 
@@ -32,6 +33,7 @@ define U-Boot/Init
   NAME:=
   DEPENDS:=
   HIDDEN:=
+  DEFAULT:=
   VARIANT:=$(1)
   UBOOT_CONFIG:=$(1)
   UBOOT_IMAGE:=u-boot.bin
@@ -39,6 +41,17 @@ endef
 
 TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
 
+UBOOT_MAKE_FLAGS = \
+       HOSTCC="$(HOSTCC)" \
+       HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS) -std=gnu11" \
+       HOSTLDFLAGS="$(HOST_LDFLAGS)" \
+       LOCALVERSION="-OpenWrt-$(REVISION)" \
+       STAGING_PREFIX="$(STAGING_DIR_HOST)" \
+       PKG_CONFIG_PATH="$(STAGING_DIR_HOST)/lib/pkgconfig" \
+       PKG_CONFIG_LIBDIR="$(STAGING_DIR_HOST)/lib/pkgconfig" \
+       PKG_CONFIG_EXTRAARGS="--static" \
+       $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='')
+
 define Build/U-Boot/Target
   $(eval $(call U-Boot/Init,$(1)))
   $(eval $(call U-Boot/Default,$(1)))
@@ -59,6 +72,7 @@ define Build/U-Boot/Target
                $(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%,$(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES)))
       endif
     endif
+    $(if $(DEFAULT),DEFAULT:=$(DEFAULT))
     URL:=http://www.denx.de/wiki/U-Boot
   endef
 
@@ -69,6 +83,9 @@ endef
 
 define Build/Configure/U-Boot
        +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIGURE_VARS) $(UBOOT_CONFIG)_config
+       $(if $(strip $(UBOOT_CUSTOMIZE_CONFIG)),
+               $(PKG_BUILD_DIR)/scripts/config --file $(PKG_BUILD_DIR)/.config $(UBOOT_CUSTOMIZE_CONFIG)
+               +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIGURE_VARS) oldconfig)
 endef
 
 DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
@@ -76,7 +93,8 @@ DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
 define Build/Compile/U-Boot
        +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
                CROSS_COMPILE=$(TARGET_CROSS) \
-               $(if $(DTC),DTC="$(DTC)")
+               $(if $(DTC),DTC="$(DTC)") \
+               $(UBOOT_MAKE_FLAGS)
 endef
 
 define BuildPackage/U-Boot/Defaults