blob: 3f7bdf5559ee9ad3e5e9e2b6eaac5a9b19e294d8 [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 *)
Patrick Williams8f4f1612022-12-04 14:31:58 -060030 # shellcheck disable=SC2016
Andrew Jeffery95a8a442020-03-10 22:09:02 +103031 echo 'Run "./configure ${CONFIGURE_FLAGS} && make"'
32 ;;
33esac