mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-28 08:58:55 +00:00
bf9710fd5a
This only affects build_android, if nacl-gcc-prep is run then build/`uname -s` will be created.
44 lines
1.1 KiB
Bash
44 lines
1.1 KiB
Bash
#!/bin/sh -e
|
|
|
|
okabi | (
|
|
while read abi
|
|
do
|
|
|
|
rm -f randombytes.o randombytes.h
|
|
|
|
(
|
|
echo devurandom
|
|
) | (
|
|
while read n
|
|
do
|
|
okc-$abi | (
|
|
while read c
|
|
do
|
|
echo "=== `date` === Trying $n.c with $c..." >&2
|
|
rm -f test randombytes-impl.o randombytes-impl.h randombytes-impl.c
|
|
cp $n.c randombytes-impl.c || continue
|
|
cp $n.h randombytes-impl.h || continue
|
|
$c -c randombytes-impl.c || continue
|
|
$c -o test test.c randombytes-impl.o || continue
|
|
./test || continue
|
|
echo "=== `date` === Success. Using $n.c." >&2
|
|
mkdir -p lib/$abi
|
|
mv randombytes-impl.o lib/$abi/randombytes.o
|
|
mkdir -p include/$abi
|
|
mv randombytes-impl.h include/$abi/randombytes.h
|
|
exit 0
|
|
done
|
|
exit 111
|
|
) && exit 0
|
|
done
|
|
exit 111
|
|
) || (
|
|
echo ===== Giving up. >&2
|
|
rm -f test randombytes-impl.o randombytes-impl.h randombytes-impl.c
|
|
exit 111
|
|
) || exit 111
|
|
|
|
done
|
|
exit 0
|
|
) || exit 111
|