FFmpeg-Builds/scripts.d/25-openssl.sh
2023-02-12 14:40:12 +01:00

65 lines
1.5 KiB
Bash
Executable file

#!/bin/bash
SCRIPT_REPO="https://github.com/openssl/openssl.git"
SCRIPT_COMMIT="OpenSSL_1_1_1t"
SCRIPT_TAGFILTER="OpenSSL_1_1_1*"
ffbuild_enabled() {
return 0
}
ffbuild_dockerbuild() {
git-mini-clone "$SCRIPT_REPO" "$SCRIPT_COMMIT" openssl
cd openssl
local myconf=(
threads
zlib
no-shared
enable-camellia
enable-ec
enable-srp
--prefix="$FFBUILD_PREFIX"
)
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 == 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="gcc"
export CXX="g++"
export AR="gcc-ar"
export RANLIB="gcc-ranlib"
./Configure "${myconf[@]}"
sed -i -e "/^CFLAGS=/s|=.*|=${CFLAGS}|" -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" Makefile
make -j$(nproc)
make install_sw
}