summaryrefslogtreecommitdiff
path: root/nacl/inttypes/do
diff options
context:
space:
mode:
Diffstat (limited to 'nacl/inttypes/do')
-rw-r--r--nacl/inttypes/do47
1 files changed, 47 insertions, 0 deletions
diff --git a/nacl/inttypes/do b/nacl/inttypes/do
new file mode 100644
index 00000000..af88b26a
--- /dev/null
+++ b/nacl/inttypes/do
@@ -0,0 +1,47 @@
1#!/bin/sh -e
2
3okabi | (
4 while read abi
5 do
6 (
7 echo 'int8 signed char'
8 echo 'int16 short'
9 echo 'int32 int'
10 echo 'int32 long'
11 echo 'int64 long long'
12 echo 'int64 long'
13 echo 'int64 int __attribute__((__mode__(__DI__)))'
14 echo 'uint8 unsigned char'
15 echo 'uint16 unsigned short'
16 echo 'uint32 unsigned int'
17 echo 'uint32 unsigned long'
18 echo 'uint64 unsigned long long'
19 echo 'uint64 unsigned long'
20 echo 'uint64 unsigned int __attribute__((__mode__(__DI__)))'
21 ) | (
22 while read target source
23 do
24 okc-$abi | (
25 while read c
26 do
27 [ -f include/$abi/crypto_$target.h ] && continue
28 echo "=== `date` === $abi trying $source as $target under $c..." >&2
29 rm -f crypto_$target crypto_$target.h
30 (
31 echo "#ifndef crypto_${target}_h"
32 echo "#define crypto_${target}_h"
33 echo ""
34 echo "typedef ${source} crypto_${target};"
35 echo ""
36 echo "#endif"
37 ) > crypto_$target.h
38 $c -o crypto_$target crypto_$target.c || continue
39 ./crypto_$target || continue
40 mkdir -p include/$abi
41 cp crypto_$target.h include/$abi/crypto_$target.h
42 done
43 )
44 done
45 )
46 done
47)