Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support NDK r25c and boost-1.82.0 #252

Merged
merged 2 commits into from
May 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# Boost for Android [![Build Status: GitHub Actions](https://github.com/moritz-wundke/Boost-for-Android/workflows/CI/badge.svg)](https://github.com/moritz-wundke/Boost-for-Android/actions)
Boost for android is a set of tools to compile the main part of the [Boost C++ Libraries](http://www.boost.org/) for the Android platform.

Currently supported boost versions are 1.45.0, 1.48.0, 1.49.0, 1.53.0, 1.54.0, 1.55.0, 1.65.1, 1.66.0, 1.67.0, 1.68.0, 1.69.0, 1.70.0, 1.71.0, 1.73.0, 1.74.0, 1.76.0, 1.77.0, 1.78.0, 1.79.0 and 1.80.0.
Currently supported boost versions are 1.45.0, 1.48.0, 1.49.0, 1.53.0, 1.54.0, 1.55.0, 1.65.1, 1.66.0, 1.67.0, 1.68.0, 1.69.0, 1.70.0, 1.71.0, 1.73.0, 1.74.0, 1.76.0, 1.77.0, 1.78.0, 1.79.0, 1.80.0 and 1.82.0.

x86, mips, and 64-bit architectures are built with Boost 1.65.1 and NDK r16-beta2, this version uses clang toolchain with llvm libc++ STL library.

Other versions of Boost are built only for arm architecture, they are using gcc toolchain and gnustl library.

To compile Boost for Android you may use one of the following NDKs:

| NDK / boost | 1.45 | 1.48 | 1.49 | 1.53 | 1.65 | 1.66 | 1.67 | 1.68 | 1.69 | 1.70 | 1.71 | 1.73 | 1.74 | 1.76 | 1.77 | 1.78 | 1.79 | 1.80 |
| ----------- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| r4 customized by [Dmitry Moskalchuk aka CrystaX](http://www.crystax.net/android/ndk.php). | x | | | | | | | | | | | | | | | | | |
| r5 from the [official android repository](http://developer.android.com). | x | | | | | | | | | | | | | | | | | |
| r5 customized by [CrystaX](http://www.crystax.net/android/ndk.php). | x | | | | | | | | | | | | | | | | | |
| r7 customized by [CrystaX](http://www.crystax.net/android/ndk.php). | x | x | x | | | | | | | | | | | | | | | |
| r8 from the [official android repository](http://developer.android.com). | x | x | x | | | | | | | | | | | | | | | |
| r8b from the [official android repository](http://developer.android.com). | | x | x | | | | | | | | | | | | | | | |
| r8c from the [official android repository](http://developer.android.com). | | | x | | | | | | | | | | | | | | | |
| r8d from the [official android repository](http://developer.android.com). | | | x | x | | | | | | | | | | | | | | |
| r8e from the [official android repository](http://developer.android.com). | | | x | x | | | | | | | | | | | | | | |
| r10 from the [official android repository](http://developer.android.com). | | | x | x | | | | | | | | | | | | | | |
| r16 from the [official android repository](http://developer.android.com). | | | | | x | x | x | x | | x | | | | | | | | |
| r17b from the [official android repository](http://developer.android.com). | | | | | | | x | x | | x | | | | | | | | |
| r18 from the [official android repository](http://developer.android.com). | | | | | | | | x | | | | | | | | | | |
| r18b from the [official android repository](http://developer.android.com). | | | | | | | | x | x | x | | | | | | | | |
| r19 from the [official android repository](http://developer.android.com). | | | | | | | | | x | | | | | | | | | |
| r19c from the [official android repository](http://developer.android.com). | | | | | | | | | x | x | | | | | | | | |
| r20 from the [official android repository](http://developer.android.com). | | | | | | | | | | x | x | x | x | | | | | |
| r23 from the [official android repository](http://developer.android.com). | | | | | | | | | | | | | x | x | x | x | | |
| r25 from the [official android repository](http://developer.android.com). | | | | | | | | | | | | | | | | | x | x |
| NDK / boost | 1.45 | 1.48 | 1.49 | 1.53 | 1.65 | 1.66 | 1.67 | 1.68 | 1.69 | 1.70 | 1.71 | 1.73 | 1.74 | 1.76 | 1.77 | 1.78 | 1.79 | 1.80 | 1.82 |
| ----------- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| r4 customized by [Dmitry Moskalchuk aka CrystaX](http://www.crystax.net/android/ndk.php). | x | | | | | | | | | | | | | | | | | | |
| r5 from the [official android repository](http://developer.android.com). | x | | | | | | | | | | | | | | | | | | |
| r5 customized by [CrystaX](http://www.crystax.net/android/ndk.php). | x | | | | | | | | | | | | | | | | | | |
| r7 customized by [CrystaX](http://www.crystax.net/android/ndk.php). | x | x | x | | | | | | | | | | | | | | | | |
| r8 from the [official android repository](http://developer.android.com). | x | x | x | | | | | | | | | | | | | | | | |
| r8b from the [official android repository](http://developer.android.com). | | x | x | | | | | | | | | | | | | | | | |
| r8c from the [official android repository](http://developer.android.com). | | | x | | | | | | | | | | | | | | | | |
| r8d from the [official android repository](http://developer.android.com). | | | x | x | | | | | | | | | | | | | | | |
| r8e from the [official android repository](http://developer.android.com). | | | x | x | | | | | | | | | | | | | | | |
| r10 from the [official android repository](http://developer.android.com). | | | x | x | | | | | | | | | | | | | | | |
| r16 from the [official android repository](http://developer.android.com). | | | | | x | x | x | x | | x | | | | | | | | | |
| r17b from the [official android repository](http://developer.android.com). | | | | | | | x | x | | x | | | | | | | | | |
| r18 from the [official android repository](http://developer.android.com). | | | | | | | | x | | | | | | | | | | | |
| r18b from the [official android repository](http://developer.android.com). | | | | | | | | x | x | x | | | | | | | | | |
| r19 from the [official android repository](http://developer.android.com). | | | | | | | | | x | | | | | | | | | | |
| r19c from the [official android repository](http://developer.android.com). | | | | | | | | | x | x | | | | | | | | | |
| r20 from the [official android repository](http://developer.android.com). | | | | | | | | | | x | x | x | x | | | | | | |
| r23 from the [official android repository](http://developer.android.com). | | | | | | | | | | | | | x | x | x | x | | | |
| r25 from the [official android repository](http://developer.android.com). | | | | | | | | | | | | | | | | | x | x | x |

For NDK from r4 to r10, GCC with gnustl_static runtime library is used, only ARM architecture is supported.

Expand Down
14 changes: 9 additions & 5 deletions build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ SCRIPTDIR="$(cd "$(dirname "$0")"; pwd)" # " # This extra quote fixes syntax hig
# -----------------------

BOOST_VER1=1
BOOST_VER2=78
BOOST_VER2=82
BOOST_VER3=0
register_option "--boost=<version>" boost_version "Boost version to be used, one of {1.80.0 1.79.0 1.78.0 1.76.0 1.74.0, 1.73.0, 1.71.0, 1.70.0, 1.69.0, 1.68.0, 1.67.0, 1.66.0, 1.65.1, 1.55.0, 1.54.0, 1.53.0, 1.49.0, 1.48.0, 1.45.0}, default is 1.74.0."
register_option "--boost=<version>" boost_version "Boost version to be used, one of {1.82.0 1.80.0 1.79.0 1.78.0 1.76.0 1.74.0, 1.73.0, 1.71.0, 1.70.0, 1.69.0, 1.68.0, 1.67.0, 1.66.0, 1.65.1, 1.55.0, 1.54.0, 1.53.0, 1.49.0, 1.48.0, 1.45.0}, default is 1.82.0."
boost_version()
{
if [ "$1" = "1.80.0" ]; then
if [ "$1" = "1.82.0" ]; then
BOOST_VER1=1
BOOST_VER2=82
BOOST_VER3=0
elif [ "$1" = "1.80.0" ]; then
BOOST_VER1=1
BOOST_VER2=80
BOOST_VER3=0
Expand Down Expand Up @@ -398,7 +402,7 @@ case "$NDK_RN" in
TOOLSET=clang
CONFIG_VARIANT=ndk19
;;
"22.1"|"23.0"|"23.1"|"25.0"|"25.1")
"22.1"|"23.0"|"23.1"|"25.0"|"25.1"|"25.2")
TOOLCHAIN=${TOOLCHAIN:-llvm}
CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++
TOOLSET=clang
Expand All @@ -419,7 +423,7 @@ if [ -z "${ARCHLIST}" ]; then

case "$NDK_RN" in
# NDK 17+: Support for ARMv5 (armeabi), MIPS, and MIPS64 has been removed.
"17.1"|"17.2"|"18.0"|"18.1"|"19.0"|"19.1"|"19.2"|"20.0"|"20.1"|"21.0"|"21.1"|"21.2"|"21.3"|"21.4"|"22.1"|"23.0"|"23.1"|"25.0"|"25.1")
"17.1"|"17.2"|"18.0"|"18.1"|"19.0"|"19.1"|"19.2"|"20.0"|"20.1"|"21.0"|"21.1"|"21.2"|"21.3"|"21.4"|"22.1"|"23.0"|"23.1"|"25.0"|"25.1"|"25.2")
ARCHLIST="arm64-v8a armeabi-v7a x86 x86_64"
;;
*)
Expand Down
1 change: 1 addition & 0 deletions configs/user-config-ndk23-1_82_0-arm64-v8a.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions configs/user-config-ndk23-1_82_0-armeabi-v7a.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<compileflags>-mthumb
22 changes: 22 additions & 0 deletions configs/user-config-ndk23-1_82_0-common.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

# --------------------------------------------------------------------

using clang : %ARCH%
:
$(AndroidCompiler_%ARCH%)
:
<archiver>$(AndroidBinariesPath)/llvm-ar
<ranlib>$(AndroidBinariesPath)/llvm-ranlib
<compileflags>-fPIC
<compileflags>-ffunction-sections
<compileflags>-fdata-sections
<compileflags>-funwind-tables
<compileflags>-fstack-protector-strong
<compileflags>-no-canonical-prefixes
<compileflags>-Wformat
<compileflags>-Werror=format-security
<compileflags>-frtti
<compileflags>-fexceptions
<compileflags>-DNDEBUG
<compileflags>-g
<compileflags>-Oz
1 change: 1 addition & 0 deletions configs/user-config-ndk23-1_82_0-x86.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions configs/user-config-ndk23-1_82_0-x86_64.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

54 changes: 54 additions & 0 deletions configs/user-config-ndk23-1_82_0.jam
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2003, 2005 Douglas Gregor
# Copyright 2004 John Maddock
# Copyright 2002, 2003, 2004, 2007 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)

# This file is used to configure your Boost.Build installation. You can modify
# this file in place, or you can place it in a permanent location so that it
# does not get overwritten should you get a new version of Boost.Build. See:
#
# http://www.boost.org/boost-build2/doc/html/bbv2/overview/configuration.html
#
# for documentation about possible permanent locations.

# This file specifies which toolsets (C++ compilers), libraries, and other
# tools are available. Often, you should be able to just uncomment existing
# example lines and adjust them to taste. The complete list of supported tools,
# and configuration instructions can be found at:
#
# http://boost.org/boost-build2/doc/html/bbv2/reference/tools.html
#

# This file uses Jam language syntax to describe available tools. Mostly,
# there are 'using' lines, that contain the name of the used tools, and
# parameters to pass to those tools -- where paremeters are separated by
# semicolons. Important syntax notes:
#
# - Both ':' and ';' must be separated from other tokens by whitespace
# - The '\' symbol is a quote character, so when specifying Windows paths you
# should use '/' or '\\' instead.
#
# More details about the syntax can be found at:
#
# http://boost.org/boost-build2/doc/html/bbv2/advanced.html#bbv2.advanced.jam_language
#
# ------------------
# Android configurations.
# ------------------

import os ;
local AndroidNDKRoot = [ os.environ AndroidNDKRoot ] ;
local AndroidBinariesPath = [ os.environ AndroidBinariesPath ] ;
local AndroidTargetVersion32 = [ os.environ AndroidTargetVersion32 ] ;
local AndroidTargetVersion64 = [ os.environ AndroidTargetVersion64 ] ;

local AndroidCompiler_arm64v8a = $(AndroidBinariesPath)/aarch64-linux-android$(AndroidTargetVersion64)-clang++ ;
local AndroidCompiler_armeabiv7a = $(AndroidBinariesPath)/armv7a-linux-androideabi$(AndroidTargetVersion32)-clang++ ;
local AndroidCompiler_x86 = $(AndroidBinariesPath)/i686-linux-android$(AndroidTargetVersion32)-clang++ ;
local AndroidCompiler_x8664 = $(AndroidBinariesPath)/x86_64-linux-android$(AndroidTargetVersion64)-clang++ ;

local AndroidBinaryPrefix_arm64v8a = $(AndroidBinariesPath)/aarch64-linux-android ;
local AndroidBinaryPrefix_armeabiv7a = $(AndroidBinariesPath)/arm-linux-androideabi ;
local AndroidBinaryPrefix_x86 = $(AndroidBinariesPath)/i686-linux-android ;
local AndroidBinaryPrefix_x8664 = $(AndroidBinariesPath)/x86_64-linux-android ;
Loading