diff --git a/CHANGES b/CHANGES index 2bb5e3272a..26697060ee 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,15 @@ +2.5-527 | 2018-04-27 11:01:03 -0500 + + * BIT-1430: Improve cross compilation support (Corelight) + + * Add --toolchain= configure option + + * Add --with-bifcl= configure option + + * Change --with-binpac= configure option to mean "path to binpac + executable" + 2.5-526 | 2018-04-25 11:06:50 -0500 * BIT-1914: comment out &check usages now that they emit warnings diff --git a/NEWS b/NEWS index cdc46ba37c..09c87e8ac7 100644 --- a/NEWS +++ b/NEWS @@ -149,6 +149,9 @@ New Functionality Changed Functionality --------------------- +- The --with-binpac= configure option has changed to mean "path + to the binpac executable" instead of "path to binpac installation root". + - The MIME types used to identify X.509 certificates in SSL connections changed from "application/pkix-cert" to "application/x-x509-user-cert" for host certificates and diff --git a/VERSION b/VERSION index 9b13b170d5..8f8414d706 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5-526 +2.5-527 diff --git a/cmake b/cmake index c40d8f9831..70fc7406f4 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit c40d8f9831b69259bfa930a64662d91cfdbf97bf +Subproject commit 70fc7406f4baa87da9362c2b80ee6bbcdb242e0a diff --git a/configure b/configure index 23b12bfb03..2689de225b 100755 --- a/configure +++ b/configure @@ -27,6 +27,8 @@ Usage: $0 [OPTION]... [VAR=VALUE]... --generator=GENERATOR CMake generator to use (see cmake --help) --ccache use ccache to speed up recompilation (requires ccache installation and CMake 3.10+) + --toolchain=PATH path to a CMAKE_TOOLCHAIN_FILE + (useful for cross-compiling) Installation Directories: --prefix=PREFIX installation directory [/usr/local/bro] @@ -62,7 +64,10 @@ Usage: $0 [OPTION]... [VAR=VALUE]... --with-openssl=PATH path to OpenSSL install root --with-bind=PATH path to BIND install root --with-pcap=PATH path to libpcap install root - --with-binpac=PATH path to BinPAC install root + --with-binpac=PATH path to BinPAC executable + (useful for cross-compiling) + --with-bifcl=PATH path to Bro BIF compiler executable + (useful for cross-compiling) --with-flex=PATH path to flex executable --with-bison=PATH path to bison executable --with-python=PATH path to Python executable @@ -174,6 +179,9 @@ while [ $# -ne 0 ]; do --ccache) append_cache_entry ENABLE_CCACHE BOOL true ;; + --toolchain=*) + append_cache_entry CMAKE_TOOLCHAIN_FILE PATH $optarg + ;; --prefix=*) prefix=$optarg append_cache_entry CMAKE_INSTALL_PREFIX PATH $optarg @@ -249,7 +257,10 @@ while [ $# -ne 0 ]; do append_cache_entry PCAP_ROOT_DIR PATH $optarg ;; --with-binpac=*) - append_cache_entry BinPAC_ROOT_DIR PATH $optarg + append_cache_entry BINPAC_EXE_PATH PATH $optarg + ;; + --with-bifcl=*) + append_cache_entry BIFCL_EXE_PATH PATH $optarg ;; --with-flex=*) append_cache_entry FLEX_EXECUTABLE PATH $optarg diff --git a/doc/install/cross-compiling.rst b/doc/install/cross-compiling.rst new file mode 100644 index 0000000000..d47bd83fc0 --- /dev/null +++ b/doc/install/cross-compiling.rst @@ -0,0 +1,85 @@ +.. _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: + +.. console:: + + ./configure --builddir=../bro-buildtools + ( cd ../bro-buildtools && make binpac bifcl ) + +Next configure Bro to use your cross-compilation toolchain: + +.. 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=