From 64100a1b22483913838933870757dc8b7b94993e Mon Sep 17 00:00:00 2001 From: Linus Yang Date: Sat, 9 Jun 2018 15:48:07 +0800 Subject: [PATCH] Docker: speed up MinGW build by parallel make --- docker/mingw/build.sh | 5 +++-- docker/mingw/deps.sh | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docker/mingw/build.sh b/docker/mingw/build.sh index 382f9b21..cfc96b4b 100644 --- a/docker/mingw/build.sh +++ b/docker/mingw/build.sh @@ -29,6 +29,7 @@ build_proj() { host=$arch-w64-mingw32 prefix=${DIST}/$arch dep=${PREFIX}/$arch + cpu="$(nproc --all)" cd "$SRC" if ! [ -d proj ]; then @@ -49,7 +50,7 @@ build_proj() { --with-cares="$dep" \ CFLAGS="-DCARES_STATICLIB -DPCRE_STATIC" make clean - make LDFLAGS="-all-static -L${dep}/lib" + make -j$cpu LDFLAGS="-all-static -L${dep}/lib" make install-strip # Reference SIP003 plugin (Experimental) @@ -72,7 +73,7 @@ build_proj() { --disable-documentation \ --with-ev="$dep" make clean - make LDFLAGS="-all-static -L${dep}/lib" + make -j$cpu LDFLAGS="-all-static -L${dep}/lib" make install-strip } diff --git a/docker/mingw/deps.sh b/docker/mingw/deps.sh index 7364b902..2e15a4a1 100644 --- a/docker/mingw/deps.sh +++ b/docker/mingw/deps.sh @@ -29,17 +29,18 @@ build_deps() { host=$arch-w64-mingw32 prefix=${PREFIX}/$arch args="--host=${host} --prefix=${prefix} --disable-shared --enable-static" + cpu="$(nproc --all)" # libev cd "$SRC/$LIBEV_SRC" ./configure $args make clean - make install + make -j$cpu install # mbedtls cd "$SRC/$MBEDTLS_SRC" make clean - make lib WINDOWS=1 CC="${host}-gcc" AR="${host}-ar" + make -j$cpu lib WINDOWS=1 CC="${host}-gcc" AR="${host}-ar" ## "make install" command from mbedtls DESTDIR="${prefix}" mkdir -p "${DESTDIR}"/include/mbedtls @@ -54,21 +55,20 @@ build_deps() { cd "$SRC/$SODIUM_SRC" ./configure $args make clean - make install + make -j$cpu install # pcre cd "$SRC/$PCRE_SRC" - ./configure $args \ - --enable-jit --disable-cpp \ + ./configure $args --disable-cpp \ --enable-unicode-properties make clean - make install + make -j$cpu install # c-ares cd "$SRC/$CARES_SRC" ./configure $args make clean - make install + make -j$cpu install } dk_deps() {