diff mbox

[U-Boot] Allow fw env tools to be available as library

Message ID 1446213424-8363-1-git-send-email-sbabic@denx.de
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Stefano Babic Oct. 30, 2015, 1:57 p.m. UTC
Sometimes it can be useful to link the fw_ tools instead
of having the fw_setenv/fw_printenv installed.
Patch exports the tool as library and allowes to link it
with own programs.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Tom Rini <trini@konsulko.com>
---
 tools/env/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Tom Rini Oct. 30, 2015, 3:05 p.m. UTC | #1
On Fri, Oct 30, 2015 at 02:57:04PM +0100, Stefano Babic wrote:

> Sometimes it can be useful to link the fw_ tools instead
> of having the fw_setenv/fw_printenv installed.
> Patch exports the tool as library and allowes to link it
> with own programs.
> 
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Tom Rini <trini@konsulko.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini Nov. 18, 2015, 10:33 p.m. UTC | #2
On Fri, Oct 30, 2015 at 02:57:04PM +0100, Stefano Babic wrote:

> Sometimes it can be useful to link the fw_ tools instead
> of having the fw_setenv/fw_printenv installed.
> Patch exports the tool as library and allowes to link it
> with own programs.
> 
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Tom Rini <trini@konsulko.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/tools/env/Makefile b/tools/env/Makefile
index 40164f7..38ad118 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -23,10 +23,12 @@  endif
 always := fw_printenv
 hostprogs-y := fw_printenv
 
-fw_printenv-objs := fw_env.o fw_env_main.o \
+lib-y += fw_env.o \
 	crc32.o ctype.o linux_string.o \
 	env_attr.o env_flags.o aes.o
 
+fw_printenv-objs := fw_env_main.o $(lib-y)
+
 quiet_cmd_crosstools_strip = STRIP   $^
       cmd_crosstools_strip = $(STRIP) $^; touch $@