Skip to contentSkip to conversation

image.h: avoid command.h for host tools

PATCH New Mike Frysinger 2 participants 6 messages Jan 21, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 image.h: avoid command.h for host tools

The u-boot command structures don't get used with host systems, so don't bother including it when building host code. This avoids an implicit need on config.h in the process.

---
 include/image.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
include/image.h +1 -2
index d2e78fe..8fc2636 100644
@@ -46,11 +46,10 @@
 
 #include <lmb.h>
 #include <asm/u-boot.h>
+#include <command.h>
 
 #endif /* USE_HOSTCC */
 
-#include <command.h>
-
 #if defined(CONFIG_FIT)
 #include <fdt.h>
 #include <libfdt.h>
Signature · 1 line
1.6.6
#1 lore raw

PATCH 2/3 ubsha1: drop unnecessary includes/prototypes

This code doesn't use any config.h defines, and the sha1.h header already declares a sha1_csum prototype.

---
 tools/ubsha1.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)
tools/ubsha1.c +0 -8
index 9774eea..625e13f 100644
@@ -31,14 +31,6 @@
 #include <sys/stat.h>
 #include "sha1.h"
 
-#ifndef __ASSEMBLY__
-#define	__ASSEMBLY__		/* Dirty trick to get only #defines	*/
-#endif
-#include <config.h>
-#undef	__ASSEMBLY__
-
-extern void sha1_csum (unsigned char *input, int ilen, unsigned char output[20]);
-
 int main (int argc, char **argv)
 {
 	unsigned char output[20];
Signature · 1 line
1.6.6
#3 lore raw

PATCH 3/3 tools: allow people to compile w/out configuring

In reply to Mike Frysinger

It's useful to be able to build up the host tools without having to select a board first. Pretty much all tools in there are config-independent anyways.

Also add a shortcut "tools-all" to quickly build all host tools that are actually config-independent to allow for simple test builds.

---
 Makefile       |    9 +++++++--
 tools/Makefile |    9 +++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)
Makefile +7 -2
index 793fcec..2dc75ae 100644
@@ -448,10 +448,15 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
 else	# !config.mk
 all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \
 $(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \
-$(SUBDIRS) $(TIMESTAMP_FILE) $(VERSION_FILE) gdbtools updater env depend \
-dep tags ctags etags cscope $(obj)System.map:
+$(filter-out tools,$(SUBDIRS)) $(TIMESTAMP_FILE) $(VERSION_FILE) gdbtools \
+updater env depend dep tags ctags etags cscope $(obj)System.map:
 	@echo "System not configured - see README" >&2
 	@ exit 1
+
+tools:
+	$(MAKE) -C tools
+tools-all:
+	$(MAKE) -C tools HOST_TOOLS_ALL=y
 endif	# config.mk
 
 .PHONY : CHANGELOG
tools/Makefile +9 -0
index 5b8c3c3..d3b1518 100644
@@ -38,6 +38,15 @@ endif
 #
 include $(TOPDIR)/config.mk
 
+# Enable all the config-independent tools
+ifneq ($(HOST_TOOLS_ALL),)
+CONFIG_LCD_LOGO = y
+CONFIG_CMD_NET = y
+CONFIG_INCA_IP = y
+CONFIG_NETCONSOLE = y
+CONFIG_SHA1_CHECK_UB_IMG = y
+endif
+
 # Generated executable files
 BIN_FILES-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX)
 BIN_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo$(SFX)
Signature · 1 line
1.6.6
#5 lore raw

PATCH 1/3 image.h: avoid command.h for host tools

In reply to Mike Frysinger

Dear Mike Frysinger,

Quoted 8 lines · In message <[email protected]> you wrote:

The u-boot command structures don't get used with host systems, so don't bother including it when building host code. This avoids an implicit need on config.h in the process.

---
 include/image.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Living on Earth may be expensive, but it includes an annual free trip
around the Sun.
#2 lore raw

PATCH 2/3 ubsha1: drop unnecessary includes/prototypes

In reply to Mike Frysinger

Dear Mike Frysinger,

Quoted 7 lines · In message <[email protected]> you wrote:

This code doesn't use any config.h defines, and the sha1.h header already declares a sha1_csum prototype.

---
 tools/ubsha1.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Wisdom is one of the few things that looks bigger the further away it
is.                               - Terry Pratchett, _Witches Abroad_
#4 lore raw

PATCH 3/3 tools: allow people to compile w/out configuring

In reply to Mike Frysinger

Dear Mike Frysinger,

Quoted 4 lines · In message <[email protected]> you wrote:

It's useful to be able to build up the host tools without having to select a board first. Pretty much all tools in there are config-independent anyways.

Quoted 8 lines

Also add a shortcut "tools-all" to quickly build all host tools that are actually config-independent to allow for simple test builds.

---
 Makefile       |    9 +++++++--
 tools/Makefile |    9 +++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The greatest warriors are the ones who fight for peace."
- Holly Near