xref: /openbmc/libmctp/bootstrap.sh (revision a68185c4)
1#!/bin/sh
2
3set -eu
4
5autoreconf -f -i
6
7BOOTSTRAP_MODE=""
8
9if [ $# -gt 0 ];
10then
11    BOOTSTRAP_MODE="${1}"
12    shift 1
13fi
14
15case "${BOOTSTRAP_MODE}" in
16    dev)
17        FLAGS="-O2 -Wall -Wextra -Wformat-security"
18        FLAGS="${FLAGS} -Wparentheses"
19        FLAGS="${FLAGS} -Wno-type-limits"
20        FLAGS="${FLAGS} -Werror"
21        # FLAGS="${FLAGS} -Wpedantic"
22        FLAGS="${FLAGS} -fsanitize=address,leak,undefined"
23        FLAGS="${FLAGS} -ggdb"
24        ./configure \
25            CFLAGS="${FLAGS}" \
26            --enable-code-coverage \
27            "$@"
28        ;;
29    *)
30        # shellcheck disable=SC2016
31        echo 'Run "./configure ${CONFIGURE_FLAGS} && make"'
32        ;;
33esac
34