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 (47 lines) | stat: -rw-r--r-- 1,339 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
44
45
46
47
#!/bin/sh -e

okabi | (
  while read abi
  do
    (
      echo 'int8 signed char'
      echo 'int16 short'
      echo 'int32 int'
      echo 'int32 long'
      echo 'int64 long long'
      echo 'int64 long'
      echo 'int64 int __attribute__((__mode__(__DI__)))'
      echo 'uint8 unsigned char'
      echo 'uint16 unsigned short'
      echo 'uint32 unsigned int'
      echo 'uint32 unsigned long'
      echo 'uint64 unsigned long long'
      echo 'uint64 unsigned long'
      echo 'uint64 unsigned int __attribute__((__mode__(__DI__)))'
    ) | (
      while read target source
      do
        okc-$abi | (
          while read c
	  do
            [ -f include/$abi/crypto_$target.h ] && continue
            echo "=== `date` === $abi trying $source as $target under $c..." >&2
            rm -f crypto_$target crypto_$target.h
            (
              echo "#ifndef crypto_${target}_h"
              echo "#define crypto_${target}_h"
              echo ""
              echo "typedef ${source} crypto_${target};"
              echo ""
              echo "#endif"
            ) > crypto_$target.h
            $c -o crypto_$target crypto_$target.c || continue
            ./crypto_$target || continue
            mkdir -p include/$abi
            cp crypto_$target.h include/$abi/crypto_$target.h
	  done
	)
      done
    )
  done
)