Skip to content

Instantly share code, notes, and snippets.

@silverqx
Last active October 1, 2017 20:15
Show Gist options
  • Save silverqx/f554ea395662dea531965095cefeac71 to your computer and use it in GitHub Desktop.
Save silverqx/f554ea395662dea531965095cefeac71 to your computer and use it in GitHub Desktop.
Compile qBittorrent with msys2 mingw
rem not needed in mingw builds
rem export PATH="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/include:$PATH"
rem export PATH="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib:$PATH"
rem I do not remember if this is needed :), but if yes, so will be needed during openssl compile
export INCLUDE="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/include:$INCLUDE"
export LIB="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib:$LIB"
export PATH="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/bin:$PATH"; \
export CXXFLAGS="-L/e/c/qbittorrent_32_mingw_shared/install_msvc/base/include"; \
export LDFLAGS="-ldbghelp -L/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib -lcrypto -lssl"; \
export PKG_CONFIG_PATH="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib/pkgconfig:$PKG_CONFIG_PATH"; \
export LD_LIBRARY_PATH="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib"
rem zlib
make -fwin32/Makefile.gcc BINARY_PATH=/e/c/qbittorrent_32_mingw_shared/install_msvc/base/bin INCLUDE_PATH=/e/c/qbittorrent_32_mingw_shared/install_msvc/base/include LIBRARY_PATH=/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib SHARED_MODE=1
make -fwin32/Makefile.gcc BINARY_PATH=/e/c/qbittorrent_32_mingw_shared/install_msvc/base/bin INCLUDE_PATH=/e/c/qbittorrent_32_mingw_shared/install_msvc/base/include LIBRARY_PATH=/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib SHARED_MODE=1 test
make -fwin32/Makefile.gcc BINARY_PATH=/e/c/qbittorrent_32_mingw_shared/install_msvc/base/bin INCLUDE_PATH=/e/c/qbittorrent_32_mingw_shared/install_msvc/base/include LIBRARY_PATH=/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib SHARED_MODE=1 install
rem openssl 1.0
./Configure mingw shared zlib threads --openssldir=/e/c/qbittorrent_32_mingw_shared/install_msvc/base --prefix=/e/c/qbittorrent_32_mingw_shared/install_msvc/base -I/e/c/qbittorrent_32_mingw_shared/install_msvc/include -L/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib
rem needed only for openssl 1.0 https://wiki.openssl.org/index.php/Compilation_and_Installation#Dependencies
make depend
make
make test
make install
rem boost 1_64_0
./bootstrap.sh mingw
./b2 -q --with-system --with-date_time --with-atomic --with-chrono --with-random --toolset=gcc architecture=x86 address-model=32 variant=release,debug link=shared runtime-link=shared debug-symbols=on include="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/include" library-path="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib" --prefix="/e/c/qbittorrent_32_mingw_shared/install_msvc/base" define=BOOST_ASIO_DISABLE_CONNECTEX
./b2 -q --with-system --with-date_time --with-atomic --with-chrono --with-random --toolset=gcc architecture=x86 address-model=32 variant=release,debug link=shared runtime-link=shared debug-symbols=on include="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/include" library-path="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib" --prefix="/e/c/qbittorrent_32_mingw_shared/install_msvc/base" define=BOOST_ASIO_DISABLE_CONNECTEX install
rem libtorrent 1.1.4
cp ../boost_1_64_0/b2.exe .
./b2 -q --without-python --toolset=gcc architecture=x86 address-model=32 variant=debug link=shared runtime-link=shared debug-symbols=on encryption=on crypto=openssl logging=off resolve-countries=off dht=on character-set=unicode boost-link=shared -sBOOST_ROOT="/e/c/qbittorrent_32_mingw_shared/boost_1_64_0" include="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/include" library-path="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib" --prefix="/e/c/qbittorrent_32_mingw_shared/install_msvc/base" define=BOOST_ASIO_DISABLE_CONNECTEX
./b2 -q --without-python --toolset=gcc architecture=x86 address-model=32 variant=debug link=shared runtime-link=shared debug-symbols=on encryption=on crypto=openssl logging=off resolve-countries=off dht=on character-set=unicode boost-link=shared -sBOOST_ROOT="/e/c/qbittorrent_32_mingw_shared/boost_1_64_0" include="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/include" library-path="/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib" --prefix="/e/c/qbittorrent_32_mingw_shared/install_msvc/base" define=BOOST_ASIO_DISABLE_CONNECTEX install
rem libtorrent 1.1.4 autotools
rem may be buggy, anyway b2 build works well
rem ./configure --enable-debug --enable-shared --without-python --with-boost=/e/c/qbittorrent_32_mingw_shared/boost_1_64_0 --libdir=/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib --includedir=/e/c/qbittorrent_32_mingw_shared/install_msvc/base/include --with-boost-libdir=/e/c/qbittorrent_32_mingw_shared/install_msvc/base/lib --prefix=/e/c/qbittorrent_32_mingw_shared/install_msvc/base --with-boost-system=boost_system-mgw72-mt-d-1_64 --with-boost-chrono=boost_chrono-mgw72-mt-d-1_64 --with-boost-random=boost_random-mgw72-mt-d-1_64
rem make
rem make check
rem make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment