Repository navigation
Expand file tree
/
Copy path25-openssl.sh
More file actions
executable file
·103 lines (90 loc) · 2.48 KB
/
Copy path25-openssl.sh
File metadata and controls
executable file
·103 lines (90 loc) · 2.48 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
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
SCRIPT_REPO="https://github.com/openssl/openssl.git"
SCRIPT_COMMIT="openssl-3.5.4"
SCRIPT_TAGFILTER="openssl-3.5.*"
ffbuild_depends() {
echo base
echo zlib
}
ffbuild_enabled() {
return 0
}
ffbuild_dockerdl() {
default_dl .
echo "git submodule update --init --recursive --depth=1"
}
ffbuild_dockerbuild() {
local myconf=(
threads
zlib
no-shared
no-tests
no-apps
no-legacy
no-ssl3
enable-camellia
enable-ec
enable-srp
--prefix="$FFBUILD_PREFIX"
--libdir=lib
)
if [[ $TARGET == win64 ]]; then
myconf+=(
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
mingw64
)
elif [[ $TARGET == win32 ]]; then
myconf+=(
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
mingw
)
elif [[ $TARGET == winarm64 ]]; then
myconf+=(
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
mingwarm64
)
cat <<EOF >Configurations/50-win-arm-mingw.conf
my %targets = (
"mingwarm64" => {
inherit_from => [ "mingw-common" ],
cflags => "",
sys_id => "MINGWARM64",
bn_ops => add("SIXTY_FOUR_BIT"),
asm_arch => 'aarch64',
uplink_arch => 'armv8',
perlasm_scheme => "win64",
shared_rcflag => "",
multilib => "-arm64",
},
);
EOF
elif [[ $TARGET == linux64 ]]; then
myconf+=(
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
linux-x86_64
)
elif [[ $TARGET == linuxarm64 ]]; then
myconf+=(
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
linux-aarch64
)
else
echo "Unknown target"
return -1
fi
export CFLAGS="$CFLAGS -fno-strict-aliasing"
export CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
# OpenSSL build system prepends the cross prefix itself
export CC="${CC/${FFBUILD_CROSS_PREFIX}/}"
export CXX="${CXX/${FFBUILD_CROSS_PREFIX}/}"
export AR="${AR/${FFBUILD_CROSS_PREFIX}/}"
export RANLIB="${RANLIB/${FFBUILD_CROSS_PREFIX}/}"
./Configure "${myconf[@]}"
sed -i -e "/^CFLAGS=/s|=.*|=${CFLAGS}|" -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" Makefile
make -j$(nproc) build_sw
make install_sw DESTDIR="$FFBUILD_DESTDIR"
}
ffbuild_configure() {
[[ $TARGET == win* ]] && return 0
echo --enable-openssl
}