https://gist.github.com/artynet
build zlib with Visual Studio CLI tool
https://gist.github.com/artynet/5a568938dab9f3f5cab96bcfd1438740
:: INCLUDE=C:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE;C:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCINCLUDE;C:Program Files (x86)Windows Kits10includewdfucrt;C:Program Files (x86)Windows KitsNETFXSDK4.6includeum;C:Program Files (x86)Windows Kits8.1includeshared;C:Program Files (x86)Windows Kits8.1includeum;C:Program Files (x86)Windows Kits8.1includewinrt; :: C:Program Files (x86)Windows Kits10Include10.0.10150.0ucrt;C:Program Files (x86)Windows Kits10Lib10.0.10150.0ucrtx86 :: LIBPATH=C:WINDOWSMicrosoft.NETFrameworkv4.0.30319;C:Program Files (x86)Microsoft Visual Studio 14.0VCLIB;C:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCLIB;ReferencesCommonConfigurationNeutral;Microsoft.VCLibs14.0ReferencesCommonConfiguration eutral;C:Program Files (x86)Windows Kits10Lib10.0.10150.0ucrtx86 :: set LIB=C:Program Files (x86)Microsoft Visual Studio 14.0VCLIB;C:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCLIB;C:Program Files (x86)Windows Kits10libwdfucrtx86;C:Program Files (x86)Windows KitsNETFXSDK4.6libumx86;C:Program Files (x86)Windows Kits8.1libwinv6.3umx86; set INCLUDE=C:Program Files (x86)Microsoft Visual Studio 14.0VCINCLUDE;C:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCINCLUDE; C:Program Files (x86)Windows Kits10includewdfucrt;C:Program Files (x86)Windows KitsNETFXSDK4.6includeum;C:Program Files (x86)Windows Kits8.1includeshared; C:Program Files (x86)Windows Kits8.1includeum;C:Program Files (x86)Windows Kits8.1includewinrt;;C:Program Files (x86)Windows Kits10Include10.0.10150.0ucrt; C:Program Files (x86)Windows Kits10Lib10.0.10150.0ucrtx86 set LIB=C:Program Files (x86)Microsoft Visual Studio 14.0VCLIB;C:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCLIB; C:Program Files (x86)Windows Kits10libwdfucrtx86;C:Program Files (x86)Windows KitsNETFXSDK4.6libumx86; C:Program Files (x86)Windows Kits8.1libwinv6.3umx86;C:Program Files (x86)Windows Kits10Lib10.0.10150.0ucrtx86 set LIBPATH=C:WINDOWSMicrosoft.NETFrameworkv4.0.30319;C:Program Files (x86)Microsoft Visual Studio 14.0VCLIB; C:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCLIB;ReferencesCommonConfigurationNeutral;Microsoft.VCLibs14.0ReferencesCommonConfiguration eutral; C:Program Files (x86)Windows Kits10Lib10.0.10150.0ucrtx86 :: nmake -n win32Makefile.msc clean nmake -n win32Makefile.msc
Cross compile zLib for mingw32-w64
https://gist.github.com/artynet/75518a8d219abd8c435a9b3b73b4ec3b
#!/bin/bash # PREFIXDIR=$HOME/Programmi/Zlib-1.2.11-win32-x86 PREFIXDIR=$HOME/Programmi/win32-cross make -f win32/Makefile.gcc BINARY_PATH=$PREFIXDIR/bin INCLUDE_PATH=$PREFIXDIR/include LIBRARY_PATH=$PREFIXDIR/lib SHARED_MODE=1 PREFIX=i686-w64-mingw32- install
Cross compile OpenSSL for mingw32-w64
https://gist.github.com/artynet/ee042155c93fc110e9422b5d458d9c6b
#!/bin/bash WORKSPACE=/home/arturo/Programmi/win32-cross sed -i 's/:.dll.a/ -Wl,--export-all -shared:.dll.a/g' Configure sed -i 's,.*target already defined.*,$target=$_;,g' Configure ./Configure mingw shared --cross-compile-prefix=i686-w64-mingw32- --prefix=${WORKSPACE} # ./Configure mingw shared --cross-compile-prefix=x86_64-w64-mingw32- --prefix=${WORKSPACE} make -j2 make -j2 install cp *.dll ${WORKSPACE}/lib/ cd ${WORKSPACE}/include # Fix compile bug in OpenSSL sed -i '/#define HEADER_X509V3_H/a \n#ifdef X509_NAME #undef X509_NAME #endif' openssl/x509v3.h
Cross compile cURL for mingw32-w64
https://gist.github.com/artynet/54c19beafc6ed5b6ff38fe8b8cd1e13b
#!/bin/bash ### Compilare CURL con toolchain mingw-w64 ### CPPFLAGS="-I/home/arturo/Programmi/win32-cross/include" LDFLAGS="-L/home/arturo/Programmi/win32-cross/lib" ./configure --host=i686-w64-mingw32 --with-ssl=/home/arturo/Programmi/win32-cross --with-zlib=/home/arturo/Programmi/win32-cross --disable-shared --enable-static # To then make the curl tool linked with everything static, I did this: make -j3 rm src/curl.exe make LDFLAGS=-all-static