pick-to-branch: Improve fix of behavior on failed cherry-pick
[tools.git] / review-tools / opensslbuild
1 #! /bin/bash
2 # Script to build openssl and run regression tests.
3 # Usage:
4 #       opensslbuild [-c] [-x] [config_args...]
5
6 test -f ./config || {
7     echo Not at top-level
8     exit 1
9 }
10
11 # Parse arguments.
12 configonly=no
13 execonly=no
14 test "$1" = "-c" && {
15     configonly=yes
16     shift
17 }
18 test "$1" = "-x" && {
19     execonly=yes
20     shift
21 }
22
23 # Set compiler
24 test "$CC" = "" && export CC="ccache clang-3.6"
25
26 # Set basic config arguments
27 CONFIGARGS="-d --strict-warnings --prefix=/usr/local/openssl"
28 case "$CC" in
29 *clang*)
30     CONFIGARGS="$CONFIGARGS -Qunused-arguments"
31     ;;
32 esac
33
34 # Set the features we want to enable
35 ENABLES="enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 enable-tls1_3"
36 ENABLES="$ENABLES enable-crypto-mdebug enable-crypto-mdebug-backtrace"
37
38 make -s clean >/dev/null 2>&1
39 ./config $CONFIGARGS $ENABLES $* 2>&1
40
41 echo Making update
42 make -s update 2>&1
43 make -s tags
44 rm -f doc-nits
45 grep -q doc-nits Makefile && make doc-nits
46 s=$?
47 test $configonly = yes && exit $s
48
49 echo Making build
50 make -s -j20
51 make -s -j20 build_tests >/dev/null
52 s=$?
53 test $execonly = yes && exit $s
54
55 echo Making test
56 make -j4 test