2020-05-02 18:58:42 +00:00
#!/bin/sh
set -e
set -x
if [ " $HOST " = "i686-linux-gnu" ]
then
export CC = " $CC -m32 "
fi
2020-05-02 19:06:04 +00:00
if [ " $TRAVIS_OS_NAME " = "osx" ] && [ " $TRAVIS_COMPILER " = "gcc" ]
then
export CC = "gcc-9"
fi
2020-05-02 18:58:42 +00:00
./configure \
--enable-experimental= " $EXPERIMENTAL " --enable-endomorphism= " $ENDOMORPHISM " \
2020-08-09 17:58:40 +00:00
--with-test-override-wide-multiply= " $WIDEMUL " --with-bignum= " $BIGNUM " --with-asm= " $ASM " \
2020-05-02 18:58:42 +00:00
--enable-ecmult-static-precomputation= " $STATICPRECOMPUTATION " --with-ecmult-gen-precision= " $ECMULTGENPRECISION " \
2020-07-29 06:50:42 +00:00
--enable-module-ecdh= " $ECDH " --enable-module-recovery= " $RECOVERY " \
--host= " $HOST " $EXTRAFLAGS
2020-05-02 18:58:42 +00:00
if [ -n " $BUILD " ]
then
make -j2 " $BUILD "
fi
if [ -n " $VALGRIND " ]
then
make -j2
# the `--error-exitcode` is required to make the test fail if valgrind found errors, otherwise it'll return 0 (http://valgrind.org/docs/manual/manual-core.html)
valgrind --error-exitcode= 42 ./tests 16
valgrind --error-exitcode= 42 ./exhaustive_tests
fi
if [ -n " $BENCH " ]
then
if [ -n " $VALGRIND " ]
then
2020-05-02 19:06:04 +00:00
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool
EXEC = './libtool --mode=execute valgrind --error-exitcode=42'
2020-05-02 18:58:42 +00:00
else
EXEC =
fi
2020-05-07 13:07:37 +00:00
# This limits the iterations in the benchmarks below to ITER(set in .travis.yml) iterations.
export SECP256K1_BENCH_ITERS = " $ITERS "
2020-05-02 18:58:42 +00:00
{
$EXEC ./bench_ecmult
$EXEC ./bench_internal
$EXEC ./bench_sign
$EXEC ./bench_verify
} >> bench.log 2>& 1
if [ " $RECOVERY " = "yes" ]
then
$EXEC ./bench_recover >> bench.log 2>& 1
fi
if [ " $ECDH " = "yes" ]
then
$EXEC ./bench_ecdh >> bench.log 2>& 1
fi
fi
if [ -n " $CTIMETEST " ]
then
2020-05-02 19:06:04 +00:00
./libtool --mode= execute valgrind --error-exitcode= 42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>& 1
2020-05-02 18:58:42 +00:00
fi