forked from supranational/blst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
refresh.sh
executable file
·49 lines (43 loc) · 1.28 KB
/
refresh.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
HERE=`dirname $0`
cd "${HERE}"
PERL=${PERL:-perl}
for pl in ../src/asm/*-x86_64.pl; do
s=`basename $pl .pl`.asm
expr $s : '.*portable' > /dev/null || (set -x; ${PERL} $pl masm > win64/$s)
s=`basename $pl .pl`.s
(set -x; ${PERL} $pl elf > elf/$s)
(set -x; ${PERL} $pl mingw64 > coff/$s)
(set -x; ${PERL} $pl macosx > mach-o/$s)
done
for pl in ../src/asm/*-armv8.pl; do
s=`basename $pl .pl`.asm
(set -x; ${PERL} $pl win64 > win64/$s)
s=`basename $pl .pl`.S
(set -x; ${PERL} $pl linux64 > elf/$s)
(set -x; ${PERL} $pl coff64 > coff/$s)
(set -x; ${PERL} $pl ios64 > mach-o/$s)
done
( cd ../bindings;
echo "LIBRARY blst"
echo
echo "EXPORTS"
cc -E blst.h | \
${PERL} -ne '{ (/(blst_[\w]+)\s*\(/ || /(BLS12_[\w]+);/) && print "\t$1\n" }'
echo
) > win64/blst.def
if which bindgen > /dev/null 2>&1; then
( cd ../bindings; set -x;
bindgen --opaque-type blst_pairing \
--opaque-type blst_uniq \
--with-derive-default \
--with-derive-eq \
--size_t-is-usize \
--rustified-enum BLST.\* \
blst.h -- -D__BLST_RUST_BINDGEN__ \
| ${PERL} ../build/bindings_trim.pl > rust/src/bindings.rs
)
else
echo "Install Rust bindgen with 'cargo install bindgen'" 1>&2
exit 1
fi