Commit 69e46c62 authored by Olivier SOLDANO's avatar Olivier SOLDANO Committed by Anthony Léonard

adapt win_compile script to core count

this patch makes the script able to scale its thread count
with the core count of the build machine.

Change-Id: I334679878d71f15ac1001650df61dcc4a725afeb
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent 2e0422d5
...@@ -4,6 +4,8 @@ rootdir=$(pwd) ...@@ -4,6 +4,8 @@ rootdir=$(pwd)
HOST=i686-w64-mingw32 HOST=i686-w64-mingw32
ARCH=32 ARCH=32
CMAKE_TOOLCHAIN_FILE=$rootdir/lrc/cmake/winBuild.cmake CMAKE_TOOLCHAIN_FILE=$rootdir/lrc/cmake/winBuild.cmake
$CORES=${CORES:=`nproc --all`}
echo "running compilation on $CORES threads"
while test -n "$1" while test -n "$1"
do do
...@@ -31,14 +33,14 @@ mkdir -p native${ARCH} ...@@ -31,14 +33,14 @@ mkdir -p native${ARCH}
cd native${ARCH} cd native${ARCH}
../bootstrap --host=${HOST} ../bootstrap --host=${HOST}
make fetch || exit 1 make fetch || exit 1
make -j4 || exit 1 make -j$CORES || exit 1
cd ../.. cd ../..
./autogen.sh || exit 1 ./autogen.sh || exit 1
mkdir -p "build${ARCH}" mkdir -p "build${ARCH}"
cd build${ARCH} cd build${ARCH}
$rootdir/daemon/configure --host=${HOST} --without-dbus --prefix=$INSTALL_PREFIX $rootdir/daemon/configure --host=${HOST} --without-dbus --prefix=$INSTALL_PREFIX
rsync -a $rootdir/daemon/src/buildinfo.cpp ./src/buildinfo.cpp rsync -a $rootdir/daemon/src/buildinfo.cpp ./src/buildinfo.cpp
make -j4 install || exit 1 make -j$CORES install || exit 1
cd $rootdir cd $rootdir
cd lrc cd lrc
...@@ -46,7 +48,7 @@ mkdir -p build${ARCH} ...@@ -46,7 +48,7 @@ mkdir -p build${ARCH}
cd build${ARCH} cd build${ARCH}
export CMAKE_PREFIX_PATH=/usr/${HOST}/sys-root/mingw/lib/cmake export CMAKE_PREFIX_PATH=/usr/${HOST}/sys-root/mingw/lib/cmake
cmake -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DRING_BUILD_DIR=$INSTALL_PREFIX -DENABLE_LIBWRAP=true .. cmake -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX -DRING_BUILD_DIR=$INSTALL_PREFIX -DENABLE_LIBWRAP=true ..
make -j4 install || exit 1 make -j$CORES install || exit 1
cd $rootdir cd $rootdir
cd client-windows cd client-windows
...@@ -57,7 +59,7 @@ cd winsparkle ...@@ -57,7 +59,7 @@ cd winsparkle
git submodule init && git submodule update git submodule init && git submodule update
mkdir -p build${ARCH} && cd build${ARCH} mkdir -p build${ARCH} && cd build${ARCH}
cmake -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ../cmake cmake -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX ../cmake
make -j4 || exit 1 make -j$CORES || exit 1
make install make install
cd ../../ cd ../../
fi fi
...@@ -67,12 +69,12 @@ cd libqrencode ...@@ -67,12 +69,12 @@ cd libqrencode
./autogen.sh || exit 1 ./autogen.sh || exit 1
mkdir -p build${ARCH} && cd build${ARCH} mkdir -p build${ARCH} && cd build${ARCH}
../configure --host=${HOST} --prefix=$INSTALL_PREFIX ../configure --host=${HOST} --prefix=$INSTALL_PREFIX
make -j4 || exit 1 make -j$CORES || exit 1
make install make install
cd ../.. cd ../..
fi fi
mkdir -p build${ARCH} mkdir -p build${ARCH}
cd build${ARCH} cd build${ARCH}
${HOST}-qmake-qt5 ../RingWinClient.pro -r -spec win32-g++ RING=$INSTALL_PREFIX ${HOST}-qmake-qt5 ../RingWinClient.pro -r -spec win32-g++ RING=$INSTALL_PREFIX
make -j4 || exit 1 make -j$CORES || exit 1
make install make install
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment