U-Boot v2014.04 introduced significant changes in its build infrastrcture.
Among things related to buildroot are:
1. Special new target ("tools-only") was added for building host tools alone
2. Tools cross-building for target is no longer possible with substitution of
HOSTxx with TARGETxx because host binaries won't be built. Instead we just set
CROSS_COMPILE and CROSS_BUILD_TOOLS variables.
3. Most of make targets now require U-Boot to be configured before building.
So for building generic "fw_printenv" we now need to make "env" target config-
independent.
4. HOSTCPPFLAGS are not used anywhere, so dropping
"uboot-tools-02-hostcflags-override-fix.patch"
Also due to lincese boilerplate change in sources
"uboot-tools-01-drop-configh-from-tools.patch" required subtle changes.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
-diff -Nura u-boot-2013.01.orig/tools/env/fw_env.h u-boot-2013.01/tools/env/fw_env.h
---- u-boot-2013.01.orig/tools/env/fw_env.h 2013-01-19 07:50:53.879241660 -0300
-+++ u-boot-2013.01/tools/env/fw_env.h 2013-01-19 07:58:11.897903403 -0300
-@@ -21,15 +21,6 @@
- * MA 02111-1307 USA
+diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
+index aff471b..dfe7439 100644
+--- a/tools/env/fw_env.h
++++ b/tools/env/fw_env.h
+@@ -5,14 +5,6 @@
+ * SPDX-License-Identifier: GPL-2.0+
*/
-/* Pull in the current config to define the default environment */
-#else
-#include <config.h>
-#endif
--
+
/*
* To build the utility with the static configuration
- * comment out the next line.
-diff -Nura u-boot-2013.01.orig/tools/env/Makefile u-boot-2013.01/tools/env/Makefile
---- u-boot-2013.01.orig/tools/env/Makefile 2013-01-19 07:50:53.879241660 -0300
-+++ u-boot-2013.01/tools/env/Makefile 2013-01-19 07:59:34.926486346 -0300
-@@ -26,7 +26,7 @@
- HOSTSRCS := $(SRCTREE)/lib/crc32.c fw_env.c fw_env_main.c
- HOSTSRCS += $(SRCTREE)/lib/ctype.c $(SRCTREE)/lib/linux_string.c
- HOSTSRCS += $(SRCTREE)/common/env_attr.c $(SRCTREE)/common/env_flags.c
--HEADERS := fw_env.h $(OBJTREE)/include/config.h
-+HEADERS := fw_env.h
-
- # Compile for a hosted environment on the target
- HOSTCPPFLAGS = -idirafter $(SRCTREE)/include \
+++ /dev/null
-[PATCH] Fix tools build with custom HOSTCFLAGS
-
-We always need to append HOSTCPPFLAGS, even if HOSTCFLAGS have been
-overridden on the cmdline.
-
-Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
----
- config.mk | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-Index: u-boot-2011.03/config.mk
-===================================================================
---- u-boot-2011.03.orig/config.mk
-+++ u-boot-2011.03/config.mk
-@@ -46,10 +46,12 @@
-
- #########################################################################
-
--HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
-- $(HOSTCPPFLAGS)
-+HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
- HOSTSTRIP = strip
-
-+# append CPPFLAGS even if CFLAGS has been overridden on cmdline
-+override HOSTCFLAGS += $(HOSTCPPFLAGS)
-+
- #
- # Mac OS X / Darwin's C preprocessor is Apple specific. It
- # generates numerous errors and warnings. We want to bypass it
#
################################################################################
-UBOOT_TOOLS_VERSION = 2014.01
+UBOOT_TOOLS_VERSION = 2014.04
UBOOT_TOOLS_SOURCE = u-boot-$(UBOOT_TOOLS_VERSION).tar.bz2
UBOOT_TOOLS_SITE = ftp://ftp.denx.de/pub/u-boot
UBOOT_TOOLS_LICENSE = GPLv2+
define UBOOT_TOOLS_BUILD_CMDS
$(MAKE) -C $(@D) \
- HOSTCC="$(TARGET_CC)" \
- HOSTCFLAGS="$(TARGET_CFLAGS)" \
- HOSTLDFLAGS="$(TARGET_LDFLAGS)" \
- HOSTSTRIP=true \
- tools env
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ CROSS_BUILD_TOOLS=y \
+ tools-only
+ $(MAKE) -C $(@D) \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ env no-dot-config-targets=env
endef
ifeq ($(BR2_PACKAGE_UBOOT_TOOLS_MKIMAGE),y)
HOSTCC="$(HOSTCC)" \
HOSTCFLAGS="$(HOST_CFLAGS)" \
HOSTLDFLAGS="$(HOST_LDFLAGS)" \
- tools
+ tools-only
endef
define HOST_UBOOT_TOOLS_INSTALL_CMDS