Allow compiling common/bootm.c on with HOSTCC
authorSimon Glass <sjg@chromium.org>
Thu, 12 Jun 2014 13:24:51 +0000 (07:24 -0600)
committerTom Rini <trini@ti.com>
Thu, 19 Jun 2014 15:19:01 +0000 (11:19 -0400)
We want to use some of the functionality in this file, so make it
build on the host.

Signed-off-by: Simon Glass <sjg@chromium.org>
common/bootm.c
tools/Makefile

index 1e66929387e896afec2b4245d458981d8f82650c..d83ddedaa74974b1d5d9c6addc453317fc08911e 100644 (file)
@@ -5,10 +5,10 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 
+#ifndef USE_HOSTCC
 #include <common.h>
-#include <bootm.h>
+#include <bootstage.h>
 #include <bzlib.h>
-#include <image.h>
 #include <fdt_support.h>
 #include <lmb.h>
 #include <malloc.h>
 #include <lzma/LzmaTypes.h>
 #include <lzma/LzmaDec.h>
 #include <lzma/LzmaTools.h>
-
 #if defined(CONFIG_CMD_USB)
 #include <usb.h>
 #endif
+#else
+#include "mkimage.h"
+#endif
 
-DECLARE_GLOBAL_DATA_PTR;
+#include <command.h>
+#include <bootm.h>
+#include <image.h>
 
 #ifndef CONFIG_SYS_BOOTM_LEN
 /* use 8MByte as default max gunzip size */
@@ -31,6 +35,10 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define IH_INITRD_ARCH IH_ARCH_DEFAULT
 
+#ifndef USE_HOSTCC
+
+DECLARE_GLOBAL_DATA_PTR;
+
 static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
                                   char * const argv[], bootm_headers_t *images,
                                   ulong *os_data, ulong *os_len);
@@ -809,3 +817,5 @@ static const void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,
 
        return buf;
 }
+
+#endif /* ndef USE_HOSTCC */
index 0088c1aae150386ff5938f650034d3ffc3933ec8..949b6c6c38baaa5a51c714c186538dfb1f1457e0 100644 (file)
@@ -66,6 +66,7 @@ RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \
 dumpimage-mkimage-objs := aisimage.o \
                        atmelimage.o \
                        $(FIT_SIG_OBJS-y) \
+                       common/bootm.o \
                        lib/crc32.o \
                        default_image.o \
                        lib/fdtdec.o \