blob: 304aca3d6dd88db625dce6877246f526fd68c4cf [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 Jefferyb93b6112020-06-05 14:13:44 +093017 FLAGS="-O2 -Wall -Wextra -Wformat-security"
18 FLAGS="${FLAGS} -Wparentheses"
19 FLAGS="${FLAGS} -Wno-type-limits"
20 FLAGS="${FLAGS} -Werror"
21 # FLAGS="${FLAGS} -Wpedantic"
Andrew Jefferyaa297622020-03-17 16:59:59 +103022 FLAGS="${FLAGS} -fsanitize=address,leak,undefined"
23 FLAGS="${FLAGS} -ggdb"
Andrew Jeffery95a8a442020-03-10 22:09:02 +103024 ./configure \
25 CFLAGS="${FLAGS}" \
Andrew Jeffery95a8a442020-03-10 22:09:02 +103026 --enable-code-coverage \
27 "$@"
28 ;;
29 *)
30 echo 'Run "./configure ${CONFIGURE_FLAGS} && make"'
31 ;;
32esac