File: do

package info (click to toggle)
nacl 20110221-15
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,560 kB
  • sloc: asm: 19,669; ansic: 13,434; cpp: 1,125; sh: 933; makefile: 32
file content (43 lines) | stat: -rw-r--r-- 1,118 bytes parent folder | download | duplicates (8)
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
#!/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