blob: 11c8ae9f96c0aff5a9157200a8d973a4e352bce5 [file] [log] [blame]
Vishwanatha Subbanna835571e2016-11-30 11:29:30 +05301#!/bin/sh
2
Andrew Jefferyf2086fc2018-05-25 15:52:28 +09303set -eu
4
Vishwanatha Subbanna835571e2016-11-30 11:29:30 +05305AUTOCONF_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 Jefferyf2086fc2018-05-25 15:52:28 +09309BOOTSTRAP_MODE=""
10
11if [ $# -gt 0 ];
12then
13 BOOTSTRAP_MODE="${1}"
14 shift 1
15fi
16
17case ${BOOTSTRAP_MODE} in
Vishwanatha Subbanna835571e2016-11-30 11:29:30 +053018 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 ;;
25esac
26
27autoreconf -i
Andrew Jefferyf2086fc2018-05-25 15:52:28 +093028
29case ${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 ;;
41esac