File: bootstrap

package info (click to toggle)
tpm2-tools 5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,988 kB
  • sloc: ansic: 45,737; sh: 14,915; xml: 8,342; makefile: 610; python: 51
file content (52 lines) | stat: -rwxr-xr-x 1,410 bytes parent folder | download | duplicates (2)
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.
dpkg-parsechangelog | grep Version: | sed -e 's/Version: //' | sed -e 's/-[^-]\+$//' > 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