aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 9087cff..c1980cf 100755
--- a/build.sh
+++ b/build.sh
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
: ${CC=gcc}
+: ${AR=ar}
: ${MAKE=make}
: ${BIN=lpm}
: ${JOBS=4}
@@ -16,8 +17,7 @@ CMAKE_DEFAULT_FLAGS=" $CMAKE_DEFAULT_FLAGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_PR
mkdir -p lib/prefix/include lib/prefix/lib
if [[ "$@" != *"-lz"* ]]; then
[ ! -e "lib/zlib" ] && echo "Make sure you've cloned submodules. (git submodule update --init --depth=1)" && exit -1
- [[ ! -e "lib/zlib/build" && $OSTYPE != 'msys'* ]] && cd lib/zlib && mkdir build && cd build && ../configure --static --prefix=`pwd`/../../prefix && $MAKE -j $JOBS && $MAKE install && cd ../../../
- [[ ! -e "lib/zlib/build" && $OSTYPE == 'msys'* ]] && cd lib/zlib && mkdir build && $MAKE -f win32/Makefile.gcc -j $JOBS && cp *.a ../prefix/lib && cp *.h ../prefix/include && cd ../../
+ [[ ! -e "lib/zlib/build" && $OSTYPE != 'msys'* ]] && cd lib/zlib && mkdir build && cd build && $CC -I.. ../*.c -c && ar rc libz.a *.o && cp libz.a ../../prefix/lib && cp ../*.h ../../prefix/include && cd ../../../
LDFLAGS="$LDFLAGS -l:libz.a"
fi
if [[ "$@" != *"-lmbedtls"* && "$@" != *"-lmbedcrypto"* ]]; then