Jeremy Kerr | b2ef62b | 2019-05-28 09:38:25 +0800 | [diff] [blame] | 1 | #!/bin/sh |
Andrew Jeffery | 95a8a44 | 2020-03-10 22:09:02 +1030 | [diff] [blame] | 2 | |
| 3 | set -eu |
| 4 | |
| 5 | autoreconf -f -i |
| 6 | |
Andrew Jeffery | 95a8a44 | 2020-03-10 22:09:02 +1030 | [diff] [blame] | 7 | BOOTSTRAP_MODE="" |
| 8 | |
| 9 | if [ $# -gt 0 ]; |
| 10 | then |
| 11 | BOOTSTRAP_MODE="${1}" |
| 12 | shift 1 |
| 13 | fi |
| 14 | |
| 15 | case "${BOOTSTRAP_MODE}" in |
| 16 | dev) |
Andrew Jeffery | aa29762 | 2020-03-17 16:59:59 +1030 | [diff] [blame] | 17 | FLAGS="-Wformat -Werror=format-security" |
| 18 | FLAGS="${FLAGS} -Werror=array-bounds" |
Andrew Jeffery | 418dac0 | 2020-03-17 22:53:11 +1030 | [diff] [blame] | 19 | FLAGS="${FLAGS} -Werror=implicit-function-declaration" |
Andrew Jeffery | aa29762 | 2020-03-17 16:59:59 +1030 | [diff] [blame] | 20 | FLAGS="${FLAGS} -fsanitize=address,leak,undefined" |
| 21 | FLAGS="${FLAGS} -ggdb" |
Andrew Jeffery | 95a8a44 | 2020-03-10 22:09:02 +1030 | [diff] [blame] | 22 | ./configure \ |
| 23 | CFLAGS="${FLAGS}" \ |
Andrew Jeffery | 95a8a44 | 2020-03-10 22:09:02 +1030 | [diff] [blame] | 24 | --enable-code-coverage \ |
| 25 | "$@" |
| 26 | ;; |
| 27 | *) |
| 28 | echo 'Run "./configure ${CONFIGURE_FLAGS} && make"' |
| 29 | ;; |
| 30 | esac |