1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-20 02:25:14 -07:00

Add wasi --bench

This commit is contained in:
Frank Denis 2019-04-08 23:23:07 +02:00
parent 449e6d12b9
commit 59b1c31acf
2 changed files with 13 additions and 5 deletions

View File

@ -12,4 +12,5 @@ EXTRA_DIST = \
ios.sh \ ios.sh \
msys2-win32.sh \ msys2-win32.sh \
msys2-win64.sh \ msys2-win64.sh \
watchos.sh watchos.sh \
wasi.sh

View File

@ -23,6 +23,12 @@ make distclean > /dev/null
grep -q -F -- '-wasi' build-aux/config.sub || \ grep -q -F -- '-wasi' build-aux/config.sub || \
sed -i -e 's/-nacl\*)/-nacl*|-wasi)/' build-aux/config.sub sed -i -e 's/-nacl\*)/-nacl*|-wasi)/' build-aux/config.sub
if [ "x$1" = "x--bench" ]; then
export BENCHMARKS=1
export LIBSODIUM_FULL_BUILD=1
export CPPFLAGS="-DBENCHMARKS -DITERATIONS=50"
fi
if [ -z "$LIBSODIUM_FULL_BUILD" ]; then if [ -z "$LIBSODIUM_FULL_BUILD" ]; then
export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal" export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal"
else else
@ -36,7 +42,8 @@ fi
NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
PROCESSORS=${NPROCESSORS:-3} PROCESSORS=${NPROCESSORS:-3}
make -j${PROCESSORS} check || exit 1 if [ -z "$BENCHMARKS" ]; then
make install || exit 1 make -j${PROCESSORS} && make check
else
make distclean > /dev/null make -j${PROCESSORS} check && make install && make distclean > /dev/null
fi