forked from tpm2-software/tpm2-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap
executable file
·52 lines (39 loc) · 1.33 KB
/
bootstrap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
# SPDX-License-Identifier: BSD-3-Clause
set -e
# Generate a VERSION file that is included in the dist tarball to avoid needed git
# when calling autoreconf in a release tarball.
git describe --tags --always --dirty > VERSION
# generate list of source files for use in Makefile.am
# if you add new source files, you must run ./bootstrap again
src_listvar () {
basedir=$1
suffix=$2
var=$3
find "${basedir}" -name "${suffix}" | LC_ALL=C sort | tr '\n' ' ' | (printf "${var} = " && cat)
echo ""
}
# duplicate fapi tests with ecc
duplicate () {
basedir=$1
suffix=$2
find "${basedir}" \( -iname "${suffix}" ! -iname "*ecc.sh" \) | while read fname; do
cp $fname ${fname%.sh}_ecc.sh
sed -i -e 's/CRYPTO_PROFILE="RSA"/CRYPTO_PROFILE="ECC"/g' ${fname%.sh}_ecc.sh
done
}
VARS_FILE=src_vars.mk
AUTORECONF=${AUTORECONF:-autoreconf}
echo "Generating file lists: ${VARS_FILE}"
(
src_listvar "lib" "*.c" "LIB_C"
src_listvar "lib" "*.h" "LIB_H"
printf "LIB_SRC = \$(LIB_C) \$(LIB_H)\n"
src_listvar "test/integration/tests" "*.sh" "SYSTEM_TESTS"
printf "ALL_SYSTEM_TESTS = \$(SYSTEM_TESTS)\n"
duplicate "test/integration/fapi" "*.sh"
src_listvar "test/integration/fapi" "*.sh" "FAPI_TESTS"
printf "ALL_FAPI_TESTS = \$(FAPI_TESTS)\n"
) > ${VARS_FILE}
mkdir -p m4
${AUTORECONF} --install --sym