diff options
-rwxr-xr-x | mkwinbins.sh | 82 |
1 files changed, 74 insertions, 8 deletions
diff --git a/mkwinbins.sh b/mkwinbins.sh index 4abcc18..b430496 100755 --- a/mkwinbins.sh +++ b/mkwinbins.sh @@ -10,9 +10,22 @@ W64_PREFIX="x86_64-w64-mingw32" download() { echo "-- fetching $PKG_TAR -- " - curl -s -L "$PKG_URL/$PKG_TAR" > "$PKG_TAR" - echo "$PKG_HASH $PKG_TAR" | sha256sum -c --quiet "-" - tar -xf "$PKG_TAR" + + [ -f "$PKG_TAR" ] || { + curl -s -L "$PKG_URL/$PKG_TAR" > "$PKG_TAR" + echo "$PKG_HASH $PKG_TAR" | sha256sum -c --quiet "-" + } + + [ -d "$PKG_DIR" ] || { + case "$PKG_TAR" in + *.zip) + unzip "$PKG_TAR" -d "$PKG_DIR" + ;; + *) + tar -xf "$PKG_TAR" + ;; + esac + } } ################################## get zlib ################################## @@ -74,13 +87,13 @@ download pushd "$PKG_DIR" ./configure CFLAGS="-O2" --prefix="$W32_DIR" --host="$W32_PREFIX" \ - --disable-shared --enable-static + --enable-shared --disable-static make -j make install-strip make clean -./configure CFLAGS="-O2" --prefix="$W32_DIR" --host="$W32_PREFIX" \ - --disable-shared --enable-static +./configure CFLAGS="-O2" --prefix="$W64_DIR" --host="$W64_PREFIX" \ + --enable-shared --disable-static make -j make install-strip popd @@ -106,6 +119,55 @@ make -j BUILD_STATIC="yes" CC="${W64_PREFIX}-gcc" \ make PREFIX="$W64_DIR" -C "lib" install popd + +################################## get zstd ################################## + +PKG_DIR="zstd-v1.4.4-win32" +PKG_TAR="zstd-v1.4.4-win32.zip" +PKG_URL="https://github.com/facebook/zstd/releases/download/v1.4.4" +PKG_HASH="60d4cd6510e7253d33f47a68554a003b50dba05d1db89e16ef32bc26b126b92c" + +download +mv "$PKG_DIR/dll/libzstd.dll" "$W32_DIR/bin" +mv "$PKG_DIR/dll/libzstd.lib" "$W32_DIR/lib/libzstd.dll.a" +mv "$PKG_DIR/include"/*.h "$W32_DIR/include" + +cat > "$W32_DIR/lib/pkgconfig/libzstd.pc" <<_EOF +prefix=$W32_DIR +libdir=$W32_DIR/lib +includedir=$W32_DIR/include + +Name: zstd +Description: fast lossless compression algorithm library +URL: http://www.zstd.net/ +Version: 1.4.4 +Libs: -L$W32_DIR/lib -lzstd +Cflags: -I$W32_DIR/include +_EOF + +PKG_DIR="zstd-v1.4.4-win64" +PKG_TAR="zstd-v1.4.4-win64.zip" +PKG_URL="https://github.com/facebook/zstd/releases/download/v1.4.4" +PKG_HASH="bb1591db8376fb5360640088e0cc9920c6da9cd0f5fd4e9229316261808c1581" + +download +mv "$PKG_DIR/dll/libzstd.dll" "$W64_DIR/bin" +mv "$PKG_DIR/dll/libzstd.lib" "$W64_DIR/lib/libzstd.dll.a" +mv "$PKG_DIR/include"/*.h "$W64_DIR/include" + +cat > "$W64_DIR/lib/pkgconfig/libzstd.pc" <<_EOF +prefix=$W64_DIR +libdir=$W64_DIR/lib +includedir=$W64_DIR/include + +Name: zstd +Description: fast lossless compression algorithm library +URL: http://www.zstd.net/ +Version: 1.4.4 +Libs: -L$W64_DIR/lib -lzstd +Cflags: -I$W64_DIR/include +_EOF + ################################ build 32 bit ################################ export PKG_CONFIG_SYSROOT_DIR="$W32_DIR" @@ -113,7 +175,9 @@ export PKG_CONFIG_LIBDIR="$W32_DIR/lib/pkgconfig" export PKG_CONFIG_PATH="$W32_DIR/lib/pkgconfig" ./autogen.sh -./configure CFLAGS="-O2 -DNDEBUG" --prefix="$W32_DIR" --host="$W32_PREFIX" +./configure CFLAGS="-O2 -DNDEBUG" LZO_CFLAGS="-I$W32_DIR/include" \ + LZO_LIBS="-L$W32_DIR/lib -llzo2" \ + --prefix="$W32_DIR" --host="$W32_PREFIX" make -j make install-strip @@ -123,7 +187,9 @@ export PKG_CONFIG_SYSROOT_DIR="$W64_DIR" export PKG_CONFIG_LIBDIR="$W64_DIR/lib/pkgconfig" export PKG_CONFIG_PATH="$W64_DIR/lib/pkgconfig" -./configure CFLAGS="-O2 -DNDEBUG" --prefix="$W64_DIR" --host="$W64_PREFIX" +./configure CFLAGS="-O2 -DNDEBUG" LZO_CFLAGS="-I$W64_DIR/include" \ + LZO_LIBS="-L$W64_DIR/lib -llzo2" \ + --prefix="$W64_DIR" --host="$W64_PREFIX" make clean make -j make install-strip |