Building Boost - TechnikEmpire/HttpFilteringEngine GitHub Wiki
HttpFilteringEngine requires several boost libraries. These include ::asio
, ::system
, ::iostreams
and various containers/algorithms that are header-only implementations. Since we need to build with ::iostreams
supporting compression, we'll need the following:
Download bzip2 and extract the contents to HTTPFILTERINGENGINE_BASE_DIR\deps\bzip2
. Your directory structure should, after extraction, look something like HTTPFILTERINGENGINE_BASE_DIR\deps\bzip2\bzip2-1.0.6
, where bzip2-1.0.6
contains all the sources of bzip2.
Next, download zlib and extract the contents to HTTPFILTERINGENGINE_BASE_DIR\deps\zlib
. Again, just as bzip2 was extracted, your directory structure should look something like HTTPFILTERINGENGINE_BASE_DIR\deps\zlib\zlib-1.2.8
, where zlib-1.2.8
is the base directory for all of the zlib sources. I stress this because I don't want anyone to get lost by improper archive extraction and wind up with something like HTTPFILTERINGENGINE_BASE_DIR\deps\zlib\zlib-1.2.8\zlib-1.2.8\SOURCES
.
During the boost build, we'll provide instructions to the boost build engine telling it to use compression and will provide relative paths to these sources, where their sources will be compiled into the final shared libraries boost will generate.
Next, you'll want to download boost. Boost is a pretty hefty collection of libraries and chances are that you may already have a compiled version downloaded. If you'd prefer to use your existing installation rather than creating a new one, you'll need to ensure that you have ::iostreams
built with compression and you'll have to modify the Additional Include Directories path, as well as the Additional Library Directories path in the Visual Studio project file's configuration(s). Further, you'll need to modify the Post Build Commands, specifically the xcopy
command that handles the copying required shared libraries to the output directory.
The rest of this guide will carry on assuming you're fetching a fresh copy of boost and placing it in HTTPFILTERINGENGINE_BASE_DIR\deps\boost
.
Once you've downloaded, extract boost to HTTPFILTERINGENGINE_BASE_DIR\deps\boost
. Your directory structure after extract should look something like HTTPFILTERINGENGINE_BASE_DIR\deps\boost\boost_1_60_0
. Now you need to build the boost build engine, bjam. This is as easy as running HTTPFILTERINGENGINE_BASE_DIR\deps\boost\boost_1_60_0\bootstrap.bat
, which uses MSVC as the default toolchain. After running this script, you should wind up with a new binary, HTTPFILTERINGENGINE_BASE_DIR\deps\boost\boost_1_60_0\bjam.exe
.
You can now simply run some scripts provided to you that will handle compiling boost and staging the resulting binaries appropriately (based on the target architecture). The scripts are located at:
HTTPFILTERINGENGINE_BASE_DIR\scripts\build-boost-msvc-x86.bat
HTTPFILTERINGENGINE_BASE_DIR\scripts\build-boost-msvc-x64.bat
You may want to modify the -jn
option to specify how many cores you'd like compilation to use. It is recommended that you do not exceed the number of total logical cores. Notice that you will be prompted to edit the script to set a couple of variables, such as what version of boost you're building. The scripts are well documented in comments, so if you're curious about their inner workings, you should find everything you could want to know in the comments.
Next, build openSSL.