forked from curl/curl-for-win
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wolfssl-cmake.sh
executable file
·42 lines (29 loc) · 1.03 KB
/
wolfssl-cmake.sh
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
#!/bin/sh
# Copyright (C) Viktor Szakats. See LICENSE.md
# SPDX-License-Identifier: MIT
# EXPERIMENTAL.
# shellcheck disable=SC3040
set -o xtrace -o errexit -o nounset; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail
export _NAM _VER _OUT _BAS _DST
_NAM="$(basename "$0" | cut -f 1 -d '.' | sed 's/-cmake//')"
_VER="$1"
(
cd "${_NAM}" || exit 0
rm -r -f "${_PKGDIR}" "${_BLDDIR}"
options=''
# for libssh2
options="${options} -DWOLFSSL_AESCTR=ON"
# shellcheck disable=SC2086
cmake . -B "${_BLDDIR}" ${_CMAKE_GLOBAL} ${options} \
'-DBUILD_SHARED_LIBS=OFF' \
'-DBUILD_SELFTEST=OFF' \
'-DWOLFSSL_REPRODUCIBLE_BUILD=ON' \
'-DWOLFSSL_OPENSSLEXTRA=ON' \
'-DWOLFSSL_EXAMPLES=OFF' \
'-DWOLFSSL_CRYPT_TESTS=OFF' \
"-DCMAKE_C_FLAGS=${_CFLAGS_GLOBAL_CMAKE} ${_CFLAGS_GLOBAL} ${_CPPFLAGS_GLOBAL} ${CPPFLAGS} ${_LDFLAGS_GLOBAL} ${_LIBS_GLOBAL}"
make --directory="${_BLDDIR}" --jobs="${_JOBS}" install "DESTDIR=$(pwd)/${_PKGDIR}"
# Delete .pc files
rm -r -f "${_PP}"/lib/pkgconfig
. ../wolfssl-pkg.sh
)