Changes to update Tomato RAF.
[tomato.git] / release / src / router / dnscrypt / src / libnacl / cpucycles / do
blobee25b208574e49f85be64e52170fbebc8e151cba
1 #!/bin/sh -e
3 okabi | (
4 while read abi
5 do
7 rm -f cpucycles.o cpucycles.h
10 echo monotoniccpuinfo
11 echo monotonic
12 echo gettimeofday
13 ) | (
14 while read n
16 okc-$abi | (
17 while read c
19 echo "=== `date` === Trying $n.c with $c..." >&2
20 rm -f test cpucycles-impl.o cpucycles-impl.h cpucycles-impl.c
21 cp $n.c cpucycles-impl.c || continue
22 cp $n.h cpucycles-impl.h || continue
23 $c -c cpucycles-impl.c || continue
24 $c -o test test.c cpucycles-impl.o || continue
25 echo "=== `date` === Success. Using $n.c." >&2
26 mkdir -p lib/$abi
27 mv cpucycles-impl.o lib/$abi/cpucycles.o
28 mkdir -p include/$abi
29 mv cpucycles-impl.h include/$abi/cpucycles.h
30 exit 0
31 done
32 exit 111
33 ) && exit 0
34 done
35 exit 111
36 ) || (
37 echo ===== Giving up. >&2
38 rm -f test cpucycles-impl.o cpucycles-impl.h cpucycles-impl.c
39 exit 111
40 ) || exit 0
42 done
43 exit 0
44 ) || exit 111