blob: 3112382351d9f573aa216b9a4b59c171f9ecaea7 [file] [log] [blame]
Ratan Guptaec26fa62018-04-16 15:28:36 +05301#!/bin/sh
2
3set -eu
4
5AUTOCONF_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
9BOOTSTRAP_MODE=""
10
11if [ $# -gt 0 ];
12then
13 BOOTSTRAP_MODE="${1}"
14 shift 1
15fi
16
17case ${BOOTSTRAP_MODE} in
18 clean)
19 test -f Makefile && make maintainer-clean
20 for file in ${AUTOCONF_FILES}; do
Patrick Williams33a34f02021-04-13 14:41:37 -050021 find . -name "$file" -print0 | xargs -0 -r rm -rf
Ratan Guptaec26fa62018-04-16 15:28:36 +053022 done
23 exit 0
24 ;;
25esac
26
27autoreconf -i
28
29case ${BOOTSTRAP_MODE} in
30 dev)
Patrick Williams33a34f02021-04-13 14:41:37 -050031 # shellcheck disable=SC2086 # CONFIGURE_FLAGS is intentionally split.
Ratan Guptaec26fa62018-04-16 15:28:36 +053032 ./configure \
33 ${CONFIGURE_FLAGS} \
34 --enable-code-coverage \
35 --enable-oe-sdk \
36 "$@"
37 ;;
38 *)
Patrick Williams33a34f02021-04-13 14:41:37 -050039 # shellcheck disable=SC2016
Ratan Guptaec26fa62018-04-16 15:28:36 +053040 echo 'Run "./configure ${CONFIGURE_FLAGS} && make"'
41 ;;
42esac
43