X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=genbindings.sh;h=3c669556f4b46185e570c789aae26be55075476e;hb=ac8a1b348337ec477ef38fd7fa37e8e179999f30;hp=5576b8dba3f17c93d7bf958aa02417de3dcbd60e;hpb=64bcaa6a2a2f05653c14b9cb8bb97ab2480eaaa5;p=ldk-java diff --git a/genbindings.sh b/genbindings.sh index 5576b8db..3c669556 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -35,6 +35,14 @@ else sed -i "s/TransactionOutputs/C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ/g" ./lightning.h fi +if [ "$LDK_GARBAGECOLLECTED_GIT_OVERRIDE" = "" ]; then + export LDK_GARBAGECOLLECTED_GIT_OVERRIDE=$(git describe --tag --dirty) +fi +if [ "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:0:1}" != "v" ]; then + echo "Version tag should start with a v" > /dev/stderr + exit 1 +fi + if [ "$2" != "wasm" ]; then TARGET_STRING="$LDK_TARGET" if [ "$TARGET_STRING" = "" ]; then @@ -61,14 +69,6 @@ if [ "$2" != "wasm" ]; then LDK_TARGET_CPU="sandybridge" fi - if [ "$LDK_GARBAGECOLLECTED_GIT_OVERRIDE" = "" ]; then - export LDK_GARBAGECOLLECTED_GIT_OVERRIDE=$(git describe --tag --dirty) - fi - if [ "${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:0:1}" != "v" ]; then - echo "Version tag should start with a v" > /dev/stderr - exit 1 - fi - if [ "$(rustc --version --verbose | grep "host:")" = "host: x86_64-apple-darwin" ]; then # OSX sed is for some reason not compatible with GNU sed sed -i '' "s/^ .*<\/version>/ ${LDK_GARBAGECOLLECTED_GIT_OVERRIDE:1:100}<\/version>/g" pom.xml @@ -203,13 +203,13 @@ else # We only need malloc and assert/abort, but for now just use WASI for those: #EXTRA_LINK=/usr/lib/wasm32-wasi/libc.a EXTRA_LINK= - [ "$3" != "false" ] && COMPILE="$COMPILE -Wl,-wrap,calloc -Wl,-wrap,realloc -Wl,-wrap,reallocarray -Wl,-wrap,malloc -Wl,-wrap,free" + [ "$3" != "false" ] && COMPILE="$COMPILE -Wl,-wrap,calloc -Wl,-wrap,realloc -Wl,-wrap,reallocarray -Wl,-wrap,malloc -Wl,-wrap,aligned_alloc -Wl,-wrap,free" if [ "$3" = "true" ]; then WASM_FILE=liblightningjs_debug.wasm - $COMPILE -o liblightningjs_debug.wasm -g -I"$1"/lightning-c-bindings/include/ ts/bindings.c "$1"/lightning-c-bindings/target/wasm32-wasi/debug/libldk.a $EXTRA_LINK + $COMPILE -o liblightningjs_debug.wasm -g -O1 -I"$1"/lightning-c-bindings/include/ ts/bindings.c "$1"/lightning-c-bindings/target/wasm32-wasi/debug/libldk.a $EXTRA_LINK else WASM_FILE=liblightningjs_release.wasm - $COMPILE -o liblightningjs_release.wasm -s -Os -I"$1"/lightning-c-bindings/include/ ts/bindings.c "$1"/lightning-c-bindings/target/wasm32-wasi/release/libldk.a $EXTRA_LINK + $COMPILE -o liblightningjs_release.wasm -s -Oz -I"$1"/lightning-c-bindings/include/ ts/bindings.c "$1"/lightning-c-bindings/target/wasm32-wasi/release/libldk.a $EXTRA_LINK fi if [ -x "$(which tsc)" ]; then