blob: d6c337a8b659d26ad0588542c84a5e0c5aa34898 [file] [log] [blame]
Andrew Jeffery22778042017-01-13 22:37:26 +10301#!/bin/sh
2
3AUTOCONF_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 Jefferyb18ab442017-05-29 16:41:30 +09307BOOTSTRAP_MODE=""
8
9if [ $# -gt 0 ];
10then
11 BOOTSTRAP_MODE="${1}"
12 shift 1
13fi
14
15case "${BOOTSTRAP_MODE}" in
Andrew Jeffery22778042017-01-13 22:37:26 +103016 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 Jefferyb18ab442017-05-29 16:41:30 +093024 *) ;;
Andrew Jeffery22778042017-01-13 22:37:26 +103025esac
26
27autoreconf -i
Andrew Jeffery56b2aa32017-04-13 13:25:05 +093028
Andrew Jefferyb18ab442017-05-29 16:41:30 +093029case "${BOOTSTRAP_MODE}" in
Andrew Jeffery56b2aa32017-04-13 13:25:05 +093030 dev)
31 ./configure \
32 CPPFLAGS="-UNDEBUG" \
33 CFLAGS="-fsanitize=address -fsanitize=leak -fsanitize=undefined -Wall -Werror" \
Andrew Jefferyb18ab442017-05-29 16:41:30 +093034 --enable-code-coverage \
35 "$@"
Andrew Jeffery56b2aa32017-04-13 13:25:05 +093036 ;;
37 *)
38 echo 'Run "./configure ${CONFIGURE_FLAGS} && make"'
39 ;;
40esac