]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mkimage: Build signing only if board has CONFIG_FIT_SIGNATURE
authorSimon Glass <sjg@chromium.org>
Thu, 27 Jun 2013 17:43:18 +0000 (10:43 -0700)
committerTom Rini <trini@ti.com>
Fri, 28 Jun 2013 20:26:52 +0000 (16:26 -0400)
At present mkimage is set up to always build with image signing support.
This means that the SSL libraries (e.g. libssl-dev) are always required.

Adjust things so that mkimage can be built with and without image signing,
controlled by the presence of CONFIG_FIT_SIGNATURE in the board config file.

If CONFIG_FIT_SIGNATURE is not enabled, then mkimage will report a warning
that signing is not supported. If the option is enabled, but libraries are
not available, then a build error similar to this will be shown:

lib/rsa/rsa-sign.c:26:25: fatal error: openssl/rsa.h: No such file or directory

Signed-off-by: Simon Glass <sjg@chromium.org>
config.mk
include/image.h
tools/Makefile

index 5a91203b53772ee4dfb302da29ab1213b6616d4f..81c258421629359a51d0d9a43ba45e039e9b99e8 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -96,7 +96,6 @@ HOSTCFLAGS    += $(call os_x_before, 10, 4, "-traditional-cpp")
 HOSTLDFLAGS    += $(call os_x_before, 10, 5, "-multiply_defined suppress")
 else
 HOSTCC         = gcc
-HOSTLIBS       += -lssl -lcrypto
 endif
 
 ifeq ($(HOSTOS),cygwin)
@@ -211,6 +210,11 @@ CPPFLAGS += -ffunction-sections -fdata-sections
 LDFLAGS_FINAL += --gc-sections
 endif
 
+# TODO(sjg@chromium.org): Is this correct on Mac OS?
+ifdef CONFIG_FIT_SIGNATURE
+HOSTLIBS       += -lssl -lcrypto
+endif
+
 ifneq ($(CONFIG_SYS_TEXT_BASE),)
 CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
 endif
index 261491880e5b18e841bdc10a6a8182ac6ab435cd..a7b93dbef76fe8e5f8ac03e3880e84759824a43f 100644 (file)
@@ -46,9 +46,6 @@ struct lmb;
 #define CONFIG_OF_LIBFDT       1
 #define CONFIG_FIT_VERBOSE     1 /* enable fit_format_{error,warning}() */
 
-/* Support FIT image signing on host */
-#define CONFIG_FIT_SIGNATURE
-
 #define IMAGE_ENABLE_IGNORE    0
 #define IMAGE_INDENT_STRING    ""
 
index cc912fb0665ce7aea0cdaf0583807b308fc63706..46159b23d6f52097972c5db2afa8f31fcf1ce44c 100644 (file)
@@ -126,7 +126,7 @@ LIBFDT_OBJ_FILES-y += fdt_strerror.o
 LIBFDT_OBJ_FILES-y += fdt_wip.o
 
 # RSA objects
-RSA_OBJ_FILES-y += rsa-sign.o
+RSA_OBJ_FILES-$(CONFIG_FIT_SIGNATURE) += rsa-sign.o
 
 # Generated LCD/video logo
 LOGO_H = $(OBJTREE)/include/bmp_logo.h