In the current top-of-tree, 1.3.3.-rc2, the optional tool 
'tools/env/fw_printenv' fails to compile for two reasons:

1) The header watchdog.h cannot be found.
2) The header zlib.h is picked up from the tool chain rather than the project 
causing a prototype conflict for crc32.

This patch addresses both of these issues.

Platforms Tested On:
- AMCC "Kilauea"

Signed-off-by: Grant Erickson <[EMAIL PROTECTED]>
---
 lib_generic/crc32.c |    2 ++
 tools/env/Makefile  |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib_generic/crc32.c b/lib_generic/crc32.c
index 64f66ed..83d1d1d 100644
--- a/lib_generic/crc32.c
+++ b/lib_generic/crc32.c
@@ -14,7 +14,9 @@
 #include <stdint.h>
 #endif
 
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
 #include <watchdog.h>
+#endif
 #include "zlib.h"
 
 #define local static
diff --git a/tools/env/Makefile b/tools/env/Makefile
index ea2d5b5..9629ee5 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 SRCS   := $(obj)crc32.c  fw_env.c  fw_env_main.c
 HEADERS        := fw_env.h
 
-CPPFLAGS := -Wall -DUSE_HOSTCC
+CPPFLAGS := -Wall -DUSE_HOSTCC -I$(SRCTREE)/include
 
 ifeq ($(MTD_VERSION),old)
 CPPFLAGS += -DMTD_OLD
-- 
1.5.4.3


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
U-Boot-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to