From 070948d68fbab1661fc5f5ec44aff8369b1954e2 Mon Sep 17 00:00:00 2001 From: Ramana Kumar Date: Tue, 29 Nov 2022 20:47:44 +0000 Subject: [PATCH] Update bindings Makefiles with configurable blob size --- bindings/csharp/Makefile | 8 ++++++-- bindings/java/Makefile | 4 +++- bindings/node.js/binding.gyp | 3 ++- bindings/python/Makefile | 4 +++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/bindings/csharp/Makefile b/bindings/csharp/Makefile index 099e8d5..1364efa 100644 --- a/bindings/csharp/Makefile +++ b/bindings/csharp/Makefile @@ -1,5 +1,7 @@ INCLUDE_DIRS = ../../src ../../blst/bindings +FIELD_ELEMENTS_PER_BLOB ?= 4096 + ifeq ($(OS),Windows_NT) BLST_BUILDSCRIPT=./build.bat BLST_OBJ=blst.lib @@ -20,6 +22,8 @@ else CKZG_LIBRARY_PATH=Ckzg.Bindings/runtimes/$(CSHARP_PLATFORM)/native/ckzg.so endif +CLANG_FLAGS += -DFIELD_ELEMENTS_PER_BLOB=$(FIELD_ELEMENTS_PER_BLOB) + TARGETS=ckzg.c ../../src/c_kzg_4844.c ../../blst/$(BLST_OBJ) .blst: @@ -29,7 +33,7 @@ TARGETS=ckzg.c ../../src/c_kzg_4844.c ../../blst/$(BLST_OBJ) git apply -R ../blst_sha.patch &&\ cd ../bindings/csharp -.ckzg: +.ckzg: $(CLANG_EXECUTABLE) -O -Wall -shared $(CLANG_FLAGS) ${addprefix -I,${INCLUDE_DIRS}} -o $(CKZG_LIBRARY_PATH) $(TARGETS) # Ckzg library @@ -51,4 +55,4 @@ run-test: # To build full package - use ckzg command on every plaform and dotnet build ckzg-dotnet: @make ckzg - dotnet build \ No newline at end of file + dotnet build diff --git a/bindings/java/Makefile b/bindings/java/Makefile index 128edbd..d375807 100644 --- a/bindings/java/Makefile +++ b/bindings/java/Makefile @@ -2,7 +2,9 @@ INCLUDE_DIRS = ../../src ../../blst/bindings LIBRARY_FOLDER=src/main/resources/ethereum/ckzg4844/lib -CC_FLAGS= +FIELD_ELEMENTS_PER_BLOB ?= 4096 + +CC_FLAGS = -DFIELD_ELEMENTS_PER_BLOB=$(FIELD_ELEMENTS_PER_BLOB) ifeq ($(OS),Windows_NT) CLANG_EXECUTABLE=clang diff --git a/bindings/node.js/binding.gyp b/bindings/node.js/binding.gyp index e16aa31..3987361 100644 --- a/bindings/node.js/binding.gyp +++ b/bindings/node.js/binding.gyp @@ -8,7 +8,8 @@ "CLANG_CXX_LIBRARY": "libc++", "MACOSX_DEPLOYMENT_TARGET": "13.0" }, - "defines": ["NAPI_DISABLE_CPP_EXCEPTIONS"], + "defines": ["NAPI_DISABLE_CPP_EXCEPTIONS", + "FIELD_ELEMENTS_PER_BLOB=