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 | b93b611 | 2020-06-05 14:13:44 +0930 | [diff] [blame] | 17 | 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 Jeffery | aa29762 | 2020-03-17 16:59:59 +1030 | [diff] [blame] | 22 | FLAGS="${FLAGS} -fsanitize=address,leak,undefined" |
| 23 | FLAGS="${FLAGS} -ggdb" |
Andrew Jeffery | 95a8a44 | 2020-03-10 22:09:02 +1030 | [diff] [blame] | 24 | ./configure \ |
| 25 | CFLAGS="${FLAGS}" \ |
Andrew Jeffery | 95a8a44 | 2020-03-10 22:09:02 +1030 | [diff] [blame] | 26 | --enable-code-coverage \ |
| 27 | "$@" |
| 28 | ;; |
| 29 | *) |
| 30 | echo 'Run "./configure ${CONFIGURE_FLAGS} && make"' |
| 31 | ;; |
| 32 | esac |