.. _crosstool-NG: https://crosstool-ng.github.io/ .. _CMake toolchain: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html =================== Cross Compiling Bro =================== .. contents:: Prerequisites ============= You need three things on the host system: 1. The Bro source tree. 2. A cross-compilation toolchain, such as one built via crosstool-NG_. 3. Pre-built Bro dependencies from the target system. This usually includes libpcap, zlib, OpenSSL, and Python development headers and libraries. Configuration and Compiling =========================== You first need to compile a few build tools native to the host system for use during the later cross-compile build. In the root of your Bro source tree: .. sourcecode:: console ./configure --builddir=../bro-buildtools ( cd ../bro-buildtools && make binpac bifcl ) Next configure Bro to use your cross-compilation toolchain: .. sourcecode:: console ./configure --toolchain=/home/jon/x-tools/RaspberryPi-toolchain.cmake --with-binpac=$(pwd)/../bro-buildtools/aux/binpac/src/binpac --with-bifcl=$(pwd)/../bro-buildtools/src/bifcl Here, the toolchain file a `CMake toolchain`_ file. It might look something the following (using a Raspberry Pi as target system):: # Operating System on which CMake is targeting. set(CMAKE_SYSTEM_NAME Linux) # The CMAKE_STAGING_PREFIX option may not work. # Given that Bro is configured: # # `./configure --prefix=