Andrew Jeffery | 2277804 | 2017-01-13 22:37:26 +1030 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | AUTOCONF_FILES="Makefile.in aclocal.m4 ar-lib autom4te.cache compile \ |
| 4 | config.guess config.h.in config.sub configure depcomp install-sh \ |
| 5 | ltmain.sh missing *libtool test-driver" |
| 6 | |
Andrew Jeffery | b18ab44 | 2017-05-29 16:41:30 +0930 | [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 |
Andrew Jeffery | 2277804 | 2017-01-13 22:37:26 +1030 | [diff] [blame] | 16 | clean) |
| 17 | test -f Makefile && make maintainer-clean |
| 18 | test -d linux && find linux -type d -empty | xargs -r rm -rf |
| 19 | for file in ${AUTOCONF_FILES}; do |
| 20 | find -name "$file" | xargs -r rm -rf |
| 21 | done |
| 22 | exit 0 |
| 23 | ;; |
Andrew Jeffery | b18ab44 | 2017-05-29 16:41:30 +0930 | [diff] [blame^] | 24 | *) ;; |
Andrew Jeffery | 2277804 | 2017-01-13 22:37:26 +1030 | [diff] [blame] | 25 | esac |
| 26 | |
| 27 | autoreconf -i |
Andrew Jeffery | 56b2aa3 | 2017-04-13 13:25:05 +0930 | [diff] [blame] | 28 | |
Andrew Jeffery | b18ab44 | 2017-05-29 16:41:30 +0930 | [diff] [blame^] | 29 | case "${BOOTSTRAP_MODE}" in |
Andrew Jeffery | 56b2aa3 | 2017-04-13 13:25:05 +0930 | [diff] [blame] | 30 | dev) |
| 31 | ./configure \ |
| 32 | CPPFLAGS="-UNDEBUG" \ |
| 33 | CFLAGS="-fsanitize=address -fsanitize=leak -fsanitize=undefined -Wall -Werror" \ |
Andrew Jeffery | b18ab44 | 2017-05-29 16:41:30 +0930 | [diff] [blame^] | 34 | --enable-code-coverage \ |
| 35 | "$@" |
Andrew Jeffery | 56b2aa3 | 2017-04-13 13:25:05 +0930 | [diff] [blame] | 36 | ;; |
| 37 | *) |
| 38 | echo 'Run "./configure ${CONFIGURE_FLAGS} && make"' |
| 39 | ;; |
| 40 | esac |