2019-01-02 06:26:45 -06:00

77 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
set -e
./autogen.sh
if [ "x$ARCH" = "xnative" ]; then
# test autotools
./configure
make -j 4 distcheck
# make distribution
make dist
tar zxvf libressl-*.tar.gz
cd libressl-*
mkdir build-static
mkdir build-shared
cd build-static
# test cmake and ninja
if [ `uname` = "Darwin" ]; then
cmake ..
make
make test
cd ../build-shared
cmake -DBUILD_SHARED_LIBS=ON ..
make
make test
else
sudo apt-get update
sudo apt-get install -y cmake ninja-build
cmake -GNinja ..
ninja
ninja test
cd ../build-shared
cmake -GNinja -DBUILD_SHARED_LIBS=ON ..
ninja
ninja test
fi
else
sudo apt-get update
sudo apt-get install -y cmake ninja-build
CPU=i686
if [ "x$ARCH" = "xmingw64" ]; then
CPU=x86_64
fi
export CC=$CPU-w64-mingw32-gcc
if [ -z $(which $CC) ]; then
sudo apt-get update
sudo apt-get install -y mingw-w64 make
export PATH=$PATH:/opt/$ARCH/bin
fi
./configure --host=$CPU-w64-mingw32
make -j
(
rm -fr build-static
mkdir build-static
cd build-static
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../scripts/$CPU-w64-mingw32.cmake ..
ninja
)
(
rm -fr build-shared
mkdir build-shared
cd build-shared
cmake -GNinja -DCMAKE_TOOLCHAIN_FILE=../scripts/$CPU-w64-mingw32.cmake -DBUILD_SHARED_LIBS=ON ..
ninja
)
fi