bootutil: extracted app common library from bootutil_misc

Part of code of boot/bootutil/ is re-implemented in zephyr-rtos
repository.
As some code are defined here and there it becomes problem when
need to include it with outstanding feature in a build.
It is possible to mitigate problem using #fdefry - but this was
rather temporary hack.

This patch introduce new module which is common for MCUBoot build
and application build.
Common code were extracted to bootutil_public.c source file and
bootutil_public.h header

MCUboot also select DISABLE_MCUBOOT_BOOTUTIL_LIB_OWN_LOG Kconfig
option, as it must define log configuration on its own for all its
sourcecode.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
diff --git a/boot/bootutil/zephyr/CMakeLists.txt b/boot/bootutil/zephyr/CMakeLists.txt
new file mode 100644
index 0000000..82985ce
--- /dev/null
+++ b/boot/bootutil/zephyr/CMakeLists.txt
@@ -0,0 +1,21 @@
+# Copyright (c) 2020 Nordic Semiconductor ASA
+#
+# SPDX-License-Identifier: Apache-2.0
+
+if(CONFIG_MCUBOOT_BOOTUTIL_LIB)
+
+zephyr_interface_library_named(MCUBOOT_BOOTUTIL)
+
+target_include_directories(MCUBOOT_BOOTUTIL INTERFACE
+  ../
+  ../include
+  ../../zephyr/include
+)
+
+zephyr_library()
+zephyr_library_sources(
+  ../src/bootutil_public.c
+    )
+zephyr_library_link_libraries(MCUBOOT_BOOTUTIL)
+target_link_libraries(MCUBOOT_BOOTUTIL INTERFACE zephyr_interface)
+endif()