Add libsodium to the tree and build what's needed from source.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3859 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
20
deps/libsodium/test/constcheck.sh
vendored
Executable file
20
deps/libsodium/test/constcheck.sh
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
#! /bin/sh
|
||||
|
||||
CT='ct.c'
|
||||
|
||||
echo '#include <assert.h>' > "$CT"
|
||||
echo '#include <sodium.h>' >> "$CT"
|
||||
echo 'int main(void) {' >> "$CT"
|
||||
for macro in $(egrep -r '#define crypto_.*BYTES(_[A-Z]+)? ' src/libsodium/include | \
|
||||
cut -d: -f2- | cut -d' ' -f2 | \
|
||||
fgrep -v edwards25519sha512batch | sort -u); do
|
||||
func=$(echo "$macro" | tr A-Z a-z)
|
||||
echo " assert($func() == $macro);" >> "$CT"
|
||||
done
|
||||
echo "return 0; }" >> "$CT"
|
||||
|
||||
CPPFLAGS="${CPPFLAGS} -Wno-deprecated-declarations"
|
||||
${CC:-cc} "$CT" $CPPFLAGS $CFLAGS $LDFLAGS -lsodium || exit 1
|
||||
./a.out || exit 1
|
||||
rm -f a.out "$CT"
|
||||
|
Reference in New Issue
Block a user