2020-09-05 19:10:22 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-07-12 15:54:12 +00:00
|
|
|
SCRIPT_REPO="https://github.com/openssl/openssl.git"
|
2023-06-21 11:43:28 +00:00
|
|
|
SCRIPT_COMMIT="openssl-3.0.9"
|
2023-04-30 21:19:29 +00:00
|
|
|
SCRIPT_TAGFILTER="openssl-3.0.*"
|
2020-09-05 19:10:22 +00:00
|
|
|
|
|
|
|
ffbuild_enabled() {
|
2020-09-05 19:50:11 +00:00
|
|
|
return 0
|
2020-09-05 19:10:22 +00:00
|
|
|
}
|
|
|
|
|
2023-06-18 14:44:57 +00:00
|
|
|
ffbuild_dockerdl() {
|
2023-06-18 19:25:50 +00:00
|
|
|
default_dl "$SELF"
|
|
|
|
to_df "RUN git -C \"$SELF\" submodule update --init --recursive --depth=1"
|
2023-06-18 14:44:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ffbuild_dockerbuild() {
|
2023-06-18 19:25:50 +00:00
|
|
|
cd "$FFBUILD_DLDIR/$SELF"
|
2020-09-05 19:10:22 +00:00
|
|
|
|
|
|
|
local myconf=(
|
|
|
|
threads
|
|
|
|
zlib
|
|
|
|
no-shared
|
|
|
|
enable-camellia
|
|
|
|
enable-ec
|
|
|
|
enable-srp
|
|
|
|
--prefix="$FFBUILD_PREFIX"
|
2023-04-30 21:19:29 +00:00
|
|
|
--libdir=lib
|
2020-09-05 19:10:22 +00:00
|
|
|
)
|
|
|
|
|
2020-09-27 20:10:05 +00:00
|
|
|
if [[ $TARGET == win64 ]]; then
|
2020-09-05 19:10:22 +00:00
|
|
|
myconf+=(
|
|
|
|
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
|
|
|
|
mingw64
|
|
|
|
)
|
2020-09-27 20:10:05 +00:00
|
|
|
elif [[ $TARGET == win32 ]]; then
|
|
|
|
myconf+=(
|
|
|
|
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
|
|
|
|
mingw
|
|
|
|
)
|
2021-05-13 00:17:17 +00:00
|
|
|
elif [[ $TARGET == linux64 ]]; then
|
|
|
|
myconf+=(
|
2021-05-14 02:52:29 +00:00
|
|
|
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
|
2021-05-13 00:17:17 +00:00
|
|
|
linux-x86_64
|
|
|
|
)
|
2022-05-09 22:15:31 +00:00
|
|
|
elif [[ $TARGET == linuxarm64 ]]; then
|
|
|
|
myconf+=(
|
|
|
|
--cross-compile-prefix="$FFBUILD_CROSS_PREFIX"
|
|
|
|
linux-aarch64
|
|
|
|
)
|
2020-09-05 19:10:22 +00:00
|
|
|
else
|
|
|
|
echo "Unknown target"
|
|
|
|
return -1
|
|
|
|
fi
|
|
|
|
|
2022-10-29 23:27:14 +00:00
|
|
|
export CFLAGS="$CFLAGS -fno-strict-aliasing"
|
|
|
|
export CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
|
|
|
|
|
2022-11-02 21:02:09 +00:00
|
|
|
# OpenSSL build system prepends the cross prefix itself
|
2023-04-30 21:19:29 +00:00
|
|
|
export CC="${CC/${FFBUILD_CROSS_PREFIX}/}"
|
|
|
|
export CXX="${CXX/${FFBUILD_CROSS_PREFIX}/}"
|
|
|
|
export AR="${AR/${FFBUILD_CROSS_PREFIX}/}"
|
|
|
|
export RANLIB="${RANLIB/${FFBUILD_CROSS_PREFIX}/}"
|
2022-11-02 21:02:09 +00:00
|
|
|
|
2021-04-04 21:20:31 +00:00
|
|
|
./Configure "${myconf[@]}"
|
2020-09-05 19:10:22 +00:00
|
|
|
|
2021-04-04 21:20:31 +00:00
|
|
|
sed -i -e "/^CFLAGS=/s|=.*|=${CFLAGS}|" -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" Makefile
|
2020-09-05 19:10:22 +00:00
|
|
|
|
2023-04-30 21:19:29 +00:00
|
|
|
make -j$(nproc) build_sw
|
2021-04-04 21:20:31 +00:00
|
|
|
make install_sw
|
2020-09-05 19:10:22 +00:00
|
|
|
}
|
2023-04-30 21:19:29 +00:00
|
|
|
|
|
|
|
ffbuild_configure() {
|
|
|
|
[[ $TARGET == win* ]] && return 0
|
|
|
|
echo --enable-openssl
|
|
|
|
}
|