summaryrefslogtreecommitdiff
path: root/nacl/inttypes/do
blob: af88b26ae2f34e555eee5b5d598d3f630215e799 (plain)
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
)