Server-Root/libraries/build_boringssl.sh
2019-10-13 18:52:17 +02:00

31 lines
915 B
Bash
Executable File

cd boringssl/
if [ ! -d lib ]; then
mkdir lib && cd lib
ln -s ../build/ssl/libssl.so .
ln -s ../build/crypto/libcrypto.so .
cd ..
fi
cat include/openssl/opensslv.h | grep "OPENSSL_VERSION_TEXT" &> /dev/null
if [ $? -ne 0 ]; then
echo '#if false
# define OPENSSL_VERSION_NUMBER 0x1010008fL
#define OPENSSL_VERSION_TEXT "OpenSSL 1.1.1a 20 Nov 2018"
#endif' > include/openssl/opensslv.h
fi
cd build
dpkg -s golang-go &>/dev/null
if [[ $? -ne 0 ]]; then
echo "Installing golang"
sudo apt-get install golang-go
fi
if [ "x86" == "${BUILD_ARCH_TARGET}" ]; then
echo "Build boring SSL in 32 bit mode!"
T32="-DCMAKE_TOOLCHAIN_FILE=../util/32-bit-toolchain.cmake"
fi
cmake .. -D -DOPENSSL_NO_ASM=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DCMAKE_C_FLAGS="${C_FLAGS}" -DCMAKE_BUILD_TYPE=Release ${CMAKE_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=1 ${T32}
make ${CMAKE_MAKE_OPTIONS}
#sudo make install