1
0

35 lines
643 B
Bash
Raw Normal View History

#!/bin/bash -e
ZLIB_VERSION=1.2.13
. ./sdk.sh
if [ ! -d zlib-src ]; then
wget https://github.com/madler/zlib/archive/v$ZLIB_VERSION.tar.gz
2023-08-01 02:02:59 +03:00
tar -xzf v$ZLIB_VERSION.tar.gz
mv zlib-$ZLIB_VERSION zlib-src
rm v$ZLIB_VERSION.tar.gz
fi
cd zlib-src
mkdir -p build; cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="$CFLAGS"
2023-08-01 02:02:59 +03:00
cmake --build . -j${NPROC}
# update `include` folder
rm -rf ../../zlib/include
mkdir -p ../../zlib/include
cp -a ../*.h ../../zlib/include
cp -a *.h ../../zlib/include
# update lib
rm -rf ../../zlib/lib
mkdir -p ../../zlib/lib
cp libzlibstatic.a ../../zlib/lib
echo "zlib build successful"