-
Notifications
You must be signed in to change notification settings - Fork 104
/
bootstrap
executable file
·35 lines (28 loc) · 1.05 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
#!/bin/sh
# SPDX-License-Identifier: BSD-2-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}" -maxdepth 1 -name "${suffix}" | LC_ALL=C sort | tr '\n' ' ' | (printf "${var} = " && cat)
echo ""
}
VARS_FILE=src_vars.mk
AUTORECONF=${AUTORECONF:-autoreconf}
echo "Generating file lists: ${VARS_FILE}"
(
src_listvar "src" "*.c" "LIB_PKCS11_C"
src_listvar "src" "*.h" "LIB_PKCS11_H"
printf "LIB_PKCS11_SRC = \$(LIB_PKCS11_C) \$(LIB_PKCS11_H)\n"
src_listvar "src/lib" "*.c" "LIB_PKCS11_INTERNAL_LIB_C"
src_listvar "src/lib" "*.h" "LIB_PKCS11_INTERNAL_LIB_H"
printf "LIB_PKCS11_INTERNAL_LIB_SRC = \$(LIB_PKCS11_INTERNAL_LIB_C) \$(LIB_PKCS11_INTERNAL_LIB_H)\n"
) > ${VARS_FILE}
mkdir -p m4
${AUTORECONF} --install --sym $@