openpower: Add libflash package
Add a new 'libflash' package to install the libflash shared library from
Skiboot without the rest of the build depending on a certain Skiboot
version.
Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
diff --git a/openpower/package/Config.in b/openpower/package/Config.in
index ab00242..9902881 100644
--- a/openpower/package/Config.in
+++ b/openpower/package/Config.in
@@ -11,3 +11,4 @@
source "$BR2_EXTERNAL/package/occ/Config.in"
source "$BR2_EXTERNAL/package/capp-ucode/Config.in"
source "$BR2_EXTERNAL/package/skiboot/Config.in"
+source "$BR2_EXTERNAL/package/libflash/Config.in"
diff --git a/openpower/package/libflash/Config.in b/openpower/package/libflash/Config.in
new file mode 100644
index 0000000..eb6f56d
--- /dev/null
+++ b/openpower/package/libflash/Config.in
@@ -0,0 +1,4 @@
+config BR2_PACKAGE_LIBFLASH
+ bool "libflash"
+ help
+ Build libflash shared library
diff --git a/openpower/package/libflash/libflash.mk b/openpower/package/libflash/libflash.mk
new file mode 100644
index 0000000..5c6e393
--- /dev/null
+++ b/openpower/package/libflash/libflash.mk
@@ -0,0 +1,36 @@
+################################################################################
+#
+# libflash - builds libflash libraries from skiboot source
+#
+################################################################################
+
+LIBFLASH_VERSION = b2649b822ab57ab06f0028d8343320ae6e11cc50
+
+LIBFLASH_SITE = $(call github,open-power,skiboot,$(LIBFLASH_VERSION))
+LIBFLASH_INSTALL_STAGING = YES
+LIBFLASH_INSTALL_TARGET = YES
+
+LIBFLASH_MAKE_OPTS += CC="$(TARGET_CC)" LD="$(TARGET_LD)" \
+ AS="$(TARGET_AS)" AR="$(TARGET_AR)" NM="$(TARGET_NM)" \
+ OBJCOPY="$(TARGET_OBJCOPY)" OBJDUMP="$(TARGET_OBJDUMP)" \
+ SIZE="$(TARGET_CROSS)size"
+
+define LIBFLASH_BUILD_CMDS
+ PREFIX=$(STAGING_DIR)/usr SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
+ $(MAKE1) $(LIBFLASH_MAKE_OPTS) CROSS_COMPILE=$(TARGET_CROSS) \
+ -C $(@D)/external/shared
+endef
+
+define LIBFLASH_INSTALL_STAGING_CMDS
+ PREFIX=$(STAGING_DIR)/usr SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
+ $(MAKE1) $(LIBFLASH_MAKE_OPTS) CROSS_COMPILE=$(TARGET_CROSS) \
+ -C $(@D)/external/shared install
+endef
+
+define LIBFLASH_INSTALL_TARGET_CMDS
+ PREFIX=$(STAGING_DIR)/usr SKIBOOT_VERSION=$(LIBFLASH_VERSION) \
+ $(MAKE1) $(LIBFLASH_MAKE_OPTS) CROSS_COMPILE=$(TARGET_CROSS) \
+ -C $(@D)/external/shared install-lib
+endef
+
+$(eval $(generic-package))