diff mbox series

[RFC,v2,1/2] package/ck: new package

Message ID 20231117094429.30820-2-svromanov@salutedevices.com
State New
Headers show
Series Added package: 'sysbench' and its dependency: 'ck'. | expand

Commit Message

Sergey Romanov Nov. 17, 2023, 9:44 a.m. UTC
From: Sergey Romanov <svromanov@sberdevices.ru>

Concurrency primitives, safe memory reclamation
mechanisms and non-blocking data structures
for the research, design and implementation
of high performance concurrent systems.

https://github.com/concurrencykit/ck.git

Signed-off-by: Sergey Romanov <svromanov@salutedevices.com>
---
 DEVELOPERS           |  3 ++
 package/Config.in    |  1 +
 package/ck/Config.in | 19 ++++++++++++
 package/ck/ck.hash   |  3 ++
 package/ck/ck.mk     | 71 ++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 97 insertions(+)
 create mode 100644 package/ck/Config.in
 create mode 100644 package/ck/ck.hash
 create mode 100644 package/ck/ck.mk
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 1f26e9bc81..f967b46842 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2717,6 +2717,9 @@  N:	Sergey Matyukevich <sergey.matyukevich@synopsys.com>
 F:	board/synopsys/nsim/
 F:	configs/snps_arc700_nsim_defconfig
 
+N:	Sergey Romanov <svromanov@salutedevices.com>
+F:	package/ck/
+
 N:	Sergio Prado <sergio.prado@e-labworks.com>
 F:	board/toradex/apalis-imx6/
 F:	configs/toradex_apalis_imx6_defconfig
diff --git a/package/Config.in b/package/Config.in
index 5a3410d758..ed08cb69c6 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -91,6 +91,7 @@  menu "Debugging, profiling and benchmark"
 	source "package/bonnie/Config.in"
 	source "package/bpftool/Config.in"
 	source "package/cache-calibrator/Config.in"
+	source "package/ck/Config.in"
 	source "package/clinfo/Config.in"
 	source "package/clpeak/Config.in"
 	source "package/coremark/Config.in"
diff --git a/package/ck/Config.in b/package/ck/Config.in
new file mode 100644
index 0000000000..613a1f4dde
--- /dev/null
+++ b/package/ck/Config.in
@@ -0,0 +1,19 @@ 
+config BR2_PACKAGE_CK_ARCH_SUPPORTS
+	bool
+	default y if BR2_arm && !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5 && !BR2_ARM_CPU_ARMV7M
+	default y if BR2_aarch64
+	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
+	default y if BR2_s390x
+	default y if BR2_sparc_v9
+	default y if BR2_i386
+	default y if BR2_x86_64
+
+config BR2_PACKAGE_CK
+	bool "concurrency kit"
+	depends on BR2_PACKAGE_CK_ARCH_SUPPORTS
+	help
+	  Concurrency primitives, safe memory reclamation mechanisms
+	  and non-blocking data structures for the research, design and
+	  implementation of high performance concurrent systems.
+
+	  https://github.com/concurrencykit/ck.git
diff --git a/package/ck/ck.hash b/package/ck/ck.hash
new file mode 100644
index 0000000000..6d77ae4bee
--- /dev/null
+++ b/package/ck/ck.hash
@@ -0,0 +1,3 @@ 
+# Locally calculated
+sha256  97d2a21d5326ef79b4668be2e6eda6284ee77a64c0981b35fd9695c736c3d4ac  ck-0.7.1.tar.gz
+sha256  21a861f554f8f97047815e63ff5cbd57707b4c53dc1dd1b0f2dd43e6ca193464  LICENSE
diff --git a/package/ck/ck.mk b/package/ck/ck.mk
new file mode 100644
index 0000000000..41827a9636
--- /dev/null
+++ b/package/ck/ck.mk
@@ -0,0 +1,71 @@ 
+################################################################################
+#
+# ck
+#
+################################################################################
+
+CK_VERSION = 0.7.1
+CK_SITE = $(call github,concurrencykit,ck,$(CK_VERSION))
+CK_LICENSE = Apache-2.0
+CK_LICENSE_FILES = LICENSE
+
+CK_INSTALL_STAGING = YES
+
+CK_CONF_OPTS = \
+	--platform=$(BR2_ARCH) \
+	--prefix="/usr"
+
+CK_LDFLAGS = -Wl,-soname,libck.so.0  -shared -fPIC
+CK_CFLAGS = $(TARGET_CFLAGS) -std=gnu99 -fPIC
+
+ifeq ($(BR2_arm)$(BR2_ARM_CPU_ARMV6),yy)
+CK_CONF_OPTS += --profile="arm"
+CK_CFLAGS +=  -march=armv6k
+else ifeq ($(BR2_arm)$(BR2_ARM_CPU_ARMV7A),yy)
+CK_CONF_OPTS += --profile="arm"
+CK_CFLAGS +=  -march=armv7-a
+else ifeq ($(BR2_arm),y)
+CK_CONF_OPTS += --profile="arm"
+else ifeq ($(BR2_aarch64),y)
+CK_CONF_OPTS += --profile="aarch64"
+else ifeq ($(BR2_powerpc),y)
+CK_CONF_OPTS += --profile="ppc"
+else ifeq ($(BR2_powerpc64)$(BR2_powerpc64le),y)
+CK_CONF_OPTS += --profile="ppc64"
+else ifeq ($(BR2_s390x),y)
+CK_CONF_OPTS += --profile="s390x"
+else ifeq ($(BR2_x86_64),y)
+CK_CONF_OPTS += --profile="x86_64"
+CK_LDFLAGS += -m64
+else ifeq ($(BR2_i386),y)
+CK_CONF_OPTS += --profile="x86"
+else ifeq ($(BR2_sparc_v9),y)
+CK_CONF_OPTS += --profile="sparcv9"
+endif
+
+define CK_CONFIGURE_CMDS
+	cd $(@D); \
+		$(TARGET_CONFIGURE_OPTS) \
+		LD=$(TARGET_CC) \
+		CC=$(TARGET_CC) \
+		LDFLAGS="$(CK_LDFLAGS)" \
+		CFLAGS="$(CK_CFLAGS)" \
+		ALL_LIBS="libck.so" \
+		INSTALL_LIBS="install-so" \
+		PTHREAD_CFLAGS="-pthread" \
+		./configure $(CK_CONF_OPTS)
+endef
+
+define CK_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define CK_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
+endef
+
+define CK_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
+endef
+
+$(eval $(generic-package))