X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=genbindings.sh;h=b5cbca366dace820b8dffcdfcdf8fcd748938d42;hb=d5b938c284c50502ecba3a1e6f6a4ee93e06da64;hp=5b1713506c4b87e520784717345808b4bdf1177c;hpb=bee9c2d6645619590fd14ec9277d3321e2aa325a;p=ldk-c-bindings diff --git a/genbindings.sh b/genbindings.sh index 5b17135..b5cbca3 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -9,11 +9,13 @@ if [ ! -d "$1/lightning" -o "$2" != "true" -a "$2" != "false" ]; then exit 1 fi +export LC_ALL=C + # On reasonable systems, we can use realpath here, but OSX is a diva with 20-year-old software. ORIG_PWD="$(pwd)" cd "$1" LIGHTNING_PATH="$(pwd)" -LIGHTNING_GIT="$(git describe --tag --dirty)" +LIGHTNING_GIT="$(git describe --tag --dirty --abbrev=16)" cd "$ORIG_PWD" # Generate (and reasonably test) C bindings @@ -31,7 +33,7 @@ mv lightning-c-bindings/src/bitcoin ./ git checkout lightning-c-bindings/src git checkout lightning-c-bindings/include -BINDINGS_GIT="$(git describe --tag --dirty)" +BINDINGS_GIT="$(git describe --tag --dirty --abbrev=16)" echo -e "#ifndef _LDK_HEADER_VER" > lightning-c-bindings/include/ldk_ver.h echo -e "static inline int _ldk_strncmp(const char *s1, const char *s2, uint64_t n) {" >> lightning-c-bindings/include/ldk_ver.h echo -e "\tif (n && *s1 != *s2) return 1;" >> lightning-c-bindings/include/ldk_ver.h @@ -143,7 +145,7 @@ export RUSTFLAGS="--remap-path-prefix $LIGHTNING_PATH=rust-lightning --remap-pat echo "int main() {}" > genbindings_path_map_test_file.c clang -o /dev/null -ffile-prefix-map=$HOME/.cargo= genbindings_path_map_test_file.c > /dev/null 2>&1 && # Now that we've done our last non-LTO build, turn on LTO in CFLAGS as well -export BASE_CFLAGS="-ffile-prefix-map=$HOME/.cargo=" +export BASE_CFLAGS="-ffile-prefix-map=$HOME/.cargo= -frandom-seed=42" ENV_TARGET=$(rustc --version --verbose | grep host | awk '{ print $2 }' | sed 's/-/_/g') export CFLAGS_$ENV_TARGET="$BASE_CFLAGS -march=sandybridge -mcpu=sandybridge -mtune=sandybridge" rm genbindings_path_map_test_file.c