Skip to content

Commit

Permalink
win32*.sh: isolate network operations when building win32 dependencies
Browse files Browse the repository at this point in the history
We'll move network operations (git/wget/curl) under a conditional
check of the source directory.

This will ensure that the script is idempotent and that network
operations can be avoided, using pre-existing sources if available.

Signed-off-by: Mike Latimer <[email protected]>
Signed-off-by: Lucian Petrut <[email protected]>
  • Loading branch information
ml8mr authored and petrutlucian94 committed Dec 9, 2020
1 parent a149c0b commit 451fe3d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion win32_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ sslDir="${depsToolsetDir}/openssl"
curlDir="${depsToolsetDir}/curl"
boostDir="${depsToolsetDir}/boost"
zlibDir="${depsToolsetDir}/zlib"
backtraceDir="${depsToolsetDir}/backtrace"
backtraceDir="${depsToolsetDir}/libbacktrace"
snappyDir="${depsToolsetDir}/snappy"
winLibDir="${depsToolsetDir}/windows/lib"
wnbdSrcDir="${depsSrcDir}/wnbd"
Expand Down
24 changes: 12 additions & 12 deletions win32_deps_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ boostSrcDir="${depsSrcDir}/boost_1_70_0"
boostDir="${depsToolsetDir}/boost"
zlibDir="${depsToolsetDir}/zlib"
zlibSrcDir="${depsSrcDir}/zlib"
backtraceDir="${depsToolsetDir}/backtrace"
backtraceSrcDir="${depsSrcDir}/backtrace"
backtraceDir="${depsToolsetDir}/libbacktrace"
backtraceSrcDir="${depsSrcDir}/libbacktrace"
snappySrcDir="${depsSrcDir}/snappy"
snappyDir="${depsToolsetDir}/snappy"
snappyTag="1.1.7"
Expand Down Expand Up @@ -72,10 +72,10 @@ sudo apt-get -y install mingw-w64 cmake pkg-config python3-dev python3-pip \
sudo python3 -m pip install cython

cd $depsSrcDir
if [[ ! -d $zlibDir ]]; then
if [[ ! -d $zlibSrcDir ]]; then
git clone https://github.com/madler/zlib
fi
cd zlib
cd $zlibSrcDir
# Apparently the configure script is broken...
sed -e s/"PREFIX = *$"/"PREFIX = x86_64-w64-mingw32-"/ -i win32/Makefile.gcc
_make -f win32/Makefile.gcc
Expand All @@ -88,9 +88,9 @@ _make BINARY_PATH=$zlibDir \
cd $depsToolsetDir
if [[ ! -d $lz4Dir ]]; then
git clone https://github.com/lz4/lz4
cd $lz4Dir; git checkout $lz4Tag
fi
cd lz4
git checkout $lz4Tag
cd $lz4Dir
_make BUILD_STATIC=no CC=x86_64-w64-mingw32-gcc \
DLLTOOL=x86_64-w64-mingw32-dlltool \
WINDRES=x86_64-w64-mingw32-windres \
Expand All @@ -111,9 +111,9 @@ _make install
cd $depsSrcDir
if [[ ! -d $curlSrcDir ]]; then
git clone https://github.com/curl/curl
cd $curlSrcDir && git checkout $curlTag
fi
cd $curlSrcDir
git checkout $curlTag
./buildconf
./configure --prefix=$curlDir --with-ssl=$sslDir --with-zlib=$zlibDir \
--host=x86_64-w64-mingw32
Expand Down Expand Up @@ -263,8 +263,8 @@ cd $depsSrcDir
if [[ ! -d $backtraceSrcDir ]]; then
git clone https://github.com/ianlancetaylor/libbacktrace
fi
mkdir libbacktrace/build
cd libbacktrace/build
mkdir -p $backtraceSrcDir/build
cd $backtraceSrcDir/build
../configure --prefix=$backtraceDir --exec-prefix=$backtraceDir \
--host x86_64-w64-mingw32 --enable-host-shared
_make LDFLAGS="-no-undefined"
Expand All @@ -274,10 +274,10 @@ cp $backtraceDir/lib/libbacktrace.a $backtraceDir/lib/libbacktrace.dll.a
cd $depsSrcDir
if [[ ! -d $snappySrcDir ]]; then
git clone https://github.com/google/snappy
cd $snappySrcDir && git checkout $snappyTag
fi
mkdir -p snappy/build
cd snappy && git checkout $snappyTag
cd build
mkdir -p $snappySrcDir/build
cd $snappySrcDir/build

cmake -DCMAKE_INSTALL_PREFIX=$snappyDir \
-DCMAKE_BUILD_TYPE=Release \
Expand Down

0 comments on commit 451fe3d

Please sign in to comment.