-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdevconfig
More file actions
executable file
·91 lines (80 loc) · 2.84 KB
/
devconfig
File metadata and controls
executable file
·91 lines (80 loc) · 2.84 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env bash
#
# Copyright 2026 AVSystem <avsystem@avsystem.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# use Homebrew-installed OpenSSL on macOS if available
EXTRA_FLAGS=()
BREW_OPENSSL="$(brew --prefix openssl 2>/dev/null)"
if [ "$BREW_OPENSSL" ]; then
EXTRA_FLAGS[${#EXTRA_FLAGS[@]}]="-DOPENSSL_ROOT_DIR=$BREW_OPENSSL"
fi
# This is the only bash-specific part of the standalone avs_commons engine
# flow. The actual backend detection lives in a tiny CMake project, so this
# script only needs to collect the user-facing status message and append every
# non-empty line from recommended_flags.txt to EXTRA_FLAGS. Those flags are then
# passed to the final CMake configure call below.
probe_crypto_engine_flags() {
local probe_dir
local flag
probe_dir="$(mktemp -d)"
if ! cmake \
-S "$(dirname "$0")/cmake/probe_crypto_engine_backend" \
-B "$probe_dir" \
-D WITH_OPENSSL=ON \
-D WITH_MBEDTLS=ON \
"${EXTRA_FLAGS[@]}" \
"$@" >/dev/null 2>&1; then
rm -rf "$probe_dir"
return 1
fi
while IFS= read -r flag; do
if [ -n "$flag" ]; then
EXTRA_FLAGS[${#EXTRA_FLAGS[@]}]="$flag"
fi
done < "$probe_dir/recommended_flags.txt"
if [ -f "$probe_dir/probe_message.txt" ]; then
cat "$probe_dir/probe_message.txt"
fi
rm -rf "$probe_dir"
return 0
}
rm -f CMakeCache.txt
rm -rf CMakeFiles
cmake -D WITH_EXTRA_WARNINGS=ON \
-D WITH_SOCKET_LOG=ON \
-D WITH_INTERNAL_TRACE=ON \
-D WITH_OPENSSL=ON \
-D WITH_MBEDTLS=ON \
-D WITH_TEST=ON \
-D WITH_AVS_CRYPTO_ADVANCED_FEATURES=ON \
-D WITH_VALGRIND=ON \
-D CMAKE_C_FLAGS="-g -Werror=implicit-function-declaration" \
-D CMAKE_INSTALL_PREFIX:PATH=/tmp \
"${EXTRA_FLAGS[@]}" \
"$@" -H"$(dirname "$0")" -B. &&
make clean
# ensure venv is used
VENV_DIR="${VENV_DIR:-venv}"
if python3 -c 'import sys; exit(0) if sys.base_prefix != sys.prefix else exit(1)'; then
echo "Using already activated Python venv"
else
if [ ! -d "${VENV_DIR}" ]; then
echo "Creating Python venv in ${VENV_DIR}"
python3 -m venv "${VENV_DIR}"
fi
echo "Activating Python venv in ${VENV_DIR}"
source "${VENV_DIR}/bin/activate"
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
fi