diff options
Diffstat (limited to 'src/BUILDING')
-rw-r--r-- | src/BUILDING | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/src/BUILDING b/src/BUILDING index 18ddde1..d818f95 100644 --- a/src/BUILDING +++ b/src/BUILDING @@ -3,7 +3,8 @@ Build Prerequisites: * CMake[1] 2.8.8 or later is required. * Perl 5.6.1 or later is required. On Windows, Strawberry Perl and MSYS Perl - have both been reported to work. + have both been reported to work. If not found by CMake, it may be configured + explicitly by setting PERL_EXECUTABLE. * On Windows you currently must use Ninja[2] to build; on other platforms, it is not required, but recommended, because it makes builds faster. @@ -11,16 +12,15 @@ Build Prerequisites: * If you need to build Ninja from source, then a recent version of Python[3] is required (Python 2.7.5 works). - * On Windows only, Yasm[4] is required. + * On Windows only, Yasm[4] is required. If not found by CMake, it may be + configured explicitly by setting CMAKE_ASM_NASM_COMPILER. * A C compiler is required. On Windows, MSVC 12 (Visual Studio 2013) or later with Platform SDK 8.1 or later are supported. Recent versions of GCC and Clang should work on non-Windows platforms, and maybe on Windows too. - * Bash is required for running some tests, but not for building. - - * Go[5] is required for running some tests, but not for building. Note that - these tests do not work on Windows. + * Go[5] is required. If not found by CMake, the go executable may be + configured explicitly by setting GO_EXECUTABLE. Using Ninja (note the 'N' is capitalized in the cmake invocation): @@ -43,17 +43,37 @@ automatically. Note that the default build flags in the top-level CMakeLists.txt are for debugging - optimisation isn't enabled. -If you want to cross-compile then there are example toolchain files for 32-bit -Intel and ARM in util/. Wipe out the build directory, recreate it and run cmake +If you want to cross-compile then there is an example toolchain file for +32-bit Intel in util/. Wipe out the build directory, recreate it and run cmake like this: - cmake -DCMAKE_TOOLCHAIN_FILE=../util/arm-toolchain.cmake -GNinja .. + cmake -DCMAKE_TOOLCHAIN_FILE=../util/32-bit-toolchain.cmake -GNinja .. If you want to build as a shared library, pass -DBUILD_SHARED_LIBS=1. On Windows, where functions need to be tagged with "dllimport" when coming from a shared library, define BORINGSSL_SHARED_LIBRARY in any code which #includes the BoringSSL headers. + +Building for Android: + +It's possible to build BoringSSL with the Android NDK using CMake. This has +been tested with version 10d of the NDK. + +Unpack the Android NDK somewhere and export ANDROID_NDK to point to the +directory. Clone https://github.com/taka-no-me/android-cmake into util/. +Then make a build directory as above and run CMake *twice* like this: + + cmake -DANDROID_NATIVE_API_LEVEL=android-9 \ + -DANDROID_ABI=armeabi-v7a \ + -DCMAKE_TOOLCHAIN_FILE=../util/android-cmake/android.toolchain.cmake \ + -GNinja .. + +Once you've run that twice, ninja should produce Android-compatible binaries. +You can replace "armeabi-v7a" in the above with "arm64-v8a" to build aarch64 +binaries. + + Known Limitations on Windows: * Versions of cmake since 3.0.2 have a bug in its Ninja generator that causes @@ -65,8 +85,6 @@ Known Limitations on Windows: don't have steps for assembling the assembly language source files, so they currently cannot be used to build BoringSSL. - * The tests written in Go do not work. - [1] http://www.cmake.org/download/ [2] https://martine.github.io/ninja/ @@ -75,7 +93,4 @@ Known Limitations on Windows: [4] http://yasm.tortall.net/ - Either ensure yasm.exe is in %PATH% or configure CMAKE_ASM_NASM_COMPILER - appropriately. - [5] https://golang.org/dl/ |