Vishwanatha Subbanna | 835571e | 2016-11-30 11:29:30 +0530 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Andrew Jeffery | f2086fc | 2018-05-25 15:52:28 +0930 | [diff] [blame] | 3 | set -eu |
| 4 | |
Vishwanatha Subbanna | 835571e | 2016-11-30 11:29:30 +0530 | [diff] [blame] | 5 | AUTOCONF_FILES="Makefile.in aclocal.m4 ar-lib autom4te.cache compile \ |
| 6 | config.guess config.h.in config.sub configure depcomp install-sh \ |
| 7 | ltmain.sh missing *libtool test-driver" |
| 8 | |
Andrew Jeffery | f2086fc | 2018-05-25 15:52:28 +0930 | [diff] [blame] | 9 | BOOTSTRAP_MODE="" |
| 10 | |
| 11 | if [ $# -gt 0 ]; |
| 12 | then |
| 13 | BOOTSTRAP_MODE="${1}" |
| 14 | shift 1 |
| 15 | fi |
| 16 | |
| 17 | case ${BOOTSTRAP_MODE} in |
Vishwanatha Subbanna | 835571e | 2016-11-30 11:29:30 +0530 | [diff] [blame] | 18 | clean) |
| 19 | test -f Makefile && make maintainer-clean |
| 20 | for file in ${AUTOCONF_FILES}; do |
| 21 | find -name "$file" | xargs -r rm -rf |
| 22 | done |
| 23 | exit 0 |
| 24 | ;; |
| 25 | esac |
| 26 | |
| 27 | autoreconf -i |
Andrew Jeffery | f2086fc | 2018-05-25 15:52:28 +0930 | [diff] [blame] | 28 | |
| 29 | case ${BOOTSTRAP_MODE} in |
| 30 | dev) |
| 31 | FLAGS="-fsanitize=address -fsanitize=leak -fsanitize=undefined -Wall -Werror" |
| 32 | ./configure \ |
| 33 | CFLAGS="${FLAGS}" \ |
| 34 | CXXFLAGS="${FLAGS}" \ |
| 35 | --enable-code-coverage \ |
| 36 | "$@" |
| 37 | ;; |
| 38 | *) |
| 39 | echo 'Run "./configure ${CONFIGURE_FLAGS} && make"' |
| 40 | ;; |
| 41 | esac |