blob: f154ad9a207a328227b9bc81c5b3cf19437b0d56 [file] [log] [blame]
Jeremy Kerrb2ef62b2019-05-28 09:38:25 +08001#!/bin/sh
Andrew Jeffery95a8a442020-03-10 22:09:02 +10302
3set -eu
4
5autoreconf -f -i
6
Andrew Jeffery95a8a442020-03-10 22:09:02 +10307BOOTSTRAP_MODE=""
8
9if [ $# -gt 0 ];
10then
11 BOOTSTRAP_MODE="${1}"
12 shift 1
13fi
14
15case "${BOOTSTRAP_MODE}" in
16 dev)
Andrew Jefferyaa297622020-03-17 16:59:59 +103017 FLAGS="-Wformat -Werror=format-security"
18 FLAGS="${FLAGS} -Werror=array-bounds"
Andrew Jeffery418dac02020-03-17 22:53:11 +103019 FLAGS="${FLAGS} -Werror=implicit-function-declaration"
Andrew Jefferyaa297622020-03-17 16:59:59 +103020 FLAGS="${FLAGS} -fsanitize=address,leak,undefined"
21 FLAGS="${FLAGS} -ggdb"
Andrew Jeffery95a8a442020-03-10 22:09:02 +103022 ./configure \
23 CFLAGS="${FLAGS}" \
Andrew Jeffery95a8a442020-03-10 22:09:02 +103024 --enable-code-coverage \
25 "$@"
26 ;;
27 *)
28 echo 'Run "./configure ${CONFIGURE_FLAGS} && make"'
29 ;;
30esac