From 628b232876ee477ba0363773c220f8791f9656f8 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Thu, 26 Sep 2024 08:30:31 -0300 Subject: [PATCH 01/15] More flexibility in the options with this script. --- build-android.sh | 134 +++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/build-android.sh b/build-android.sh index 7cebdb028..f42fe3208 100755 --- a/build-android.sh +++ b/build-android.sh @@ -17,7 +17,7 @@ # # # -# Build boost for android completly. It will download boost 1.45.0 +# Build boost for android completely. It will download boost 1.45.0 # prepare the build system and finally build it for android SCRIPTDIR="$(cd "$(dirname "$0")"; pwd)" # " # This extra quote fixes syntax highlighting in mcedit @@ -142,18 +142,20 @@ select_toolchain () { TOOLCHAIN=$1 } +register_option "--extra=" add_extra_params "Add extra b2 parameters for the build." +add_extra_params () { + EXTRA_PARAMS=$1 +} + CLEAN=no register_option "--clean" do_clean "Delete all previously downloaded and built files, then exit." do_clean () { CLEAN=yes; } DOWNLOAD=no register_option "--download" do_download "Only download required files and clean up previus build. No build will be performed." - do_download () { DOWNLOAD=yes - # Clean previus stuff too! - CLEAN=yes } #LIBRARIES=--with-libraries=date_time,filesystem,program_options,regex,signals,system,thread,iostreams,locale @@ -175,13 +177,6 @@ do_layout () { LAYOUT=$1; } -register_option "--prefix=" do_prefix "Prefix to be used when installing libraries and includes." -do_prefix () { - if [ -d $1 ]; then - PREFIX=$1; - fi -} - ARCHLIST= register_option "--arch=" do_arch "Comma separated list of architectures to build: arm64-v8a,armeabi,armeabi-v7a,mips,mips64,x86,x86_64" do_arch () { @@ -231,6 +226,28 @@ do_with_python () { done } +BOOST_DIR="boost_${BOOST_VER1}_${BOOST_VER2}_${BOOST_VER3}" +register_option "--src-dir=" add_boost_dir "Override the default Boost source directory." +add_boost_dir () { + if [ -d $1 ]; then + BOOST_DIR=$1; + fi +} + +BUILD_DIR="./build/" +register_option "--build-dir=" add_build_dir "Set the temporary build dir." +add_build_dir () { + BUILD_DIR=$1; +} + +PREFIX="$BUILD_DIR/out/" +register_option "--prefix=" do_prefix "Prefix to be used when installing libraries and includes." +do_prefix () { + PREFIX=$1; +} + + + PROGRAM_PARAMETERS="" PROGRAM_DESCRIPTION=\ " Boost For Android\n"\ @@ -243,20 +260,18 @@ echo "Building boost version: $BOOST_VER1.$BOOST_VER2.$BOOST_VER3" # ----------------------- # Build constants # ----------------------- - -BOOST_DOWNLOAD_LINK="https://archives.boost.io/release/$BOOST_VER1.$BOOST_VER2.$BOOST_VER3/source/boost_${BOOST_VER1}_${BOOST_VER2}_${BOOST_VER3}.tar.bz2" +BOOST_DOWNLOAD_LINK="https://boostorg.jfrog.io/artifactory/main/release/$BOOST_VER1.$BOOST_VER2.$BOOST_VER3/source/boost_${BOOST_VER1}_${BOOST_VER2}_${BOOST_VER3}.tar.bz2" BOOST_TAR="boost_${BOOST_VER1}_${BOOST_VER2}_${BOOST_VER3}.tar.bz2" -BOOST_DIR="boost_${BOOST_VER1}_${BOOST_VER2}_${BOOST_VER3}" -BUILD_DIR="./build/" + # ----------------------- if [ $CLEAN = yes ] ; then echo "Cleaning: $BUILD_DIR" - rm -f -r $PROGDIR/$BUILD_DIR + rm -f -r $BUILD_DIR echo "Cleaning: $BOOST_DIR" - rm -f -r $PROGDIR/$BOOST_DIR + rm -f -r $BOOST_DIR echo "Cleaning: $BOOST_TAR" rm -f $PROGDIR/$BOOST_TAR @@ -268,23 +283,6 @@ if [ $CLEAN = yes ] ; then [ "$DOWNLOAD" = "yes" ] || exit 0 fi -# It is almost never desirable to have the boost-X_Y_Z directory from -# previous builds as this script doesn't check in which state it's -# been left (bootstrapped, patched, built, ...). Unless maybe during -# a debug, in which case it's easy for a developer to comment out -# this code. - -if [ -d "$PROGDIR/$BOOST_DIR" ]; then - echo "Cleaning: $BOOST_DIR" - rm -f -r $PROGDIR/$BOOST_DIR -fi - -if [ -d "$PROGDIR/$BUILD_DIR" ]; then - echo "Cleaning: $BUILD_DIR" - rm -f -r $PROGDIR/$BUILD_DIR -fi - - AndroidNDKRoot=$PARAMETERS if [ -z "$AndroidNDKRoot" ] ; then if [ -n "${ANDROID_BUILD_TOP}" ]; then # building from Android sources @@ -462,39 +460,43 @@ fi # Download required files # ----------------------- -# Downalod and unzip boost in a temporal folder and -if [ ! -f $BOOST_TAR ] +# Download and unzip boost in a temporary folder and +if [ "${DOWNLOAD}" = "yes" ] then - echo "Downloading boost ${BOOST_VER1}.${BOOST_VER2}.${BOOST_VER3} please wait..." - prepare_download - download_file $BOOST_DOWNLOAD_LINK $PROGDIR/$BOOST_TAR -fi + if [ ! -f $BOOST_TAR ] + then + echo "Downloading boost ${BOOST_VER1}.${BOOST_VER2}.${BOOST_VER3} please wait..." + prepare_download + download_file $BOOST_DOWNLOAD_LINK $PROGDIR/$BOOST_TAR + + if [ ! -f $PROGDIR/$BOOST_TAR ] + then + echo "Failed to download boost! Please download boost ${BOOST_VER1}.${BOOST_VER2}.${BOOST_VER3} manually\nand save it in this directory as $BOOST_TAR" + exit 1 + fi + fi -if [ ! -f $PROGDIR/$BOOST_TAR ] -then - echo "Failed to download boost! Please download boost ${BOOST_VER1}.${BOOST_VER2}.${BOOST_VER3} manually\nand save it in this directory as $BOOST_TAR" - exit 1 -fi + # clean any previous directory + if [ -d $BOOST_DIR ] + then + rm -rf $BOOST_DIR + fi -if [ ! -d $PROGDIR/$BOOST_DIR ] -then echo "Unpacking boost" if [ "$OPTION_PROGRESS" = "yes" ] ; then - pv $PROGDIR/$BOOST_TAR | tar xjf - -C $PROGDIR + pv $PROGDIR/$BOOST_TAR | tar xjf - -C $BOOST_DIR else - tar xjf $PROGDIR/$BOOST_TAR + tar xjf $PROGDIR/$BOOST_TAR -C $BOOST_DIR fi -fi -if [ $DOWNLOAD = yes ] ; then echo "All required files has been downloaded and unpacked!" - exit 0 + fi # --------- # Bootstrap # --------- -if [ ! -f ./$BOOST_DIR/b2 ] +if [ ! -f $BOOST_DIR/b2 ] then # Make the initial bootstrap echo "Performing boost bootstrap" @@ -560,7 +562,7 @@ then for PATCH in $PATCHES; do PATCH=`echo $PATCH | sed -e s%^\./%%g` - SRC_DIR=$PROGDIR/$BOOST_DIR + SRC_DIR=$BOOST_DIR PATCHDIR=`dirname $PATCH` PATCHNAME=`basename $PATCH` log "Applying $PATCHNAME into $SRC_DIR/$PATCHDIR" @@ -591,6 +593,8 @@ for ARCH in $ARCHLIST; do echo "Building boost for android for $ARCH" ( + PREFIX_ARCH_DIR="$PREFIX/$ARCH" + if [ -n "$WITH_ICONV" ] || echo $LIBRARIES | grep locale; then if [ -e libiconv-libicu-android ]; then echo "ICONV and ICU already downloaded" @@ -656,8 +660,9 @@ echo "Building boost for android for $ARCH" unset WITHOUT_LIBRARIES fi + echo "Silently building Boost, this can take minutes..." { - ./b2 -q \ + time ./b2 -q \ -d+2 \ --ignore-site-config \ -j$NCPU \ @@ -672,24 +677,19 @@ echo "Building boost for android for $ARCH" $PYTHON_BUILD \ -sICONV_PATH=`pwd`/../libiconv-libicu-android/$ARCH \ -sICU_PATH=`pwd`/../libiconv-libicu-android/$ARCH \ - --build-dir="./../$BUILD_DIR/build/$ARCH" \ - --prefix="./../$BUILD_DIR/out/$ARCH" \ + --build-dir="$BUILD_DIR" \ + --prefix="$PREFIX_ARCH_DIR" \ + $EXTRA_PARAMS \ $LIBRARIES \ $LIBRARIES_BROKEN \ - install 2>&1 \ - || { dump "ERROR: Failed to build boost for android for $ARCH!" ; rm -rf ./../$BUILD_DIR/out/$ARCH ; exit 1 ; } - } | tee -a $PROGDIR/build.log + install > $PROGDIR/build.log 2>&1 \ + || { dump "ERROR: Failed to build boost for android for $ARCH!" ; rm -rf $PREFIX_ARCH_DIR ; exit 1 ; } + } + # # PIPESTATUS variable is defined only in Bash, and we are using /bin/sh, which is not Bash on newer Debian/Ubuntu ) dump "Done!" -if [ $PREFIX ]; then - echo "Prefix set, copying files to $PREFIX" - mkdir -p $PREFIX/$ARCH - cp -r $PROGDIR/$BUILD_DIR/out/$ARCH/lib $PREFIX/$ARCH/ - cp -r $PROGDIR/$BUILD_DIR/out/$ARCH/include $PREFIX/$ARCH/ -fi - done # for ARCH in $ARCHLIST From 524a84fc0efe4804729e1d80e080cd171fe4a2ca Mon Sep 17 00:00:00 2001 From: SuperGNUS Date: Mon, 19 Dec 2022 17:04:14 -0800 Subject: [PATCH 02/15] Move user-config.jam out of boost directory so other platforms can still build --- .gitignore | 2 ++ build-android.sh | 60 +++++++++++++++++++++++++++--------------------- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 76f3beb86..4dba4375a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ build.log *.vim .idea + +user-config.jam \ No newline at end of file diff --git a/build-android.sh b/build-android.sh index f42fe3208..37585d87a 100755 --- a/build-android.sh +++ b/build-android.sh @@ -493,6 +493,9 @@ then fi + # Apply patches to boost +BOOST_VER=${BOOST_VER1}_${BOOST_VER2}_${BOOST_VER3} + # --------- # Bootstrap # --------- @@ -518,35 +521,11 @@ then cd $PROGDIR # ------------------------------------------------------------- - # Patching will be done only if we had a successfull bootstrap! + # Patching will be done only if we had a successful bootstrap! # ------------------------------------------------------------- - # Apply patches to boost - BOOST_VER=${BOOST_VER1}_${BOOST_VER2}_${BOOST_VER3} PATCH_BOOST_DIR="$SCRIPTDIR/patches/boost-${BOOST_VER}" - if [ "$TOOLSET" = "clang" ]; then - cp "$SCRIPTDIR"/configs/user-config-${CONFIG_VARIANT}-${BOOST_VER}.jam $BOOST_DIR/tools/build/src/user-config.jam || exit 1 - for FILE in "$SCRIPTDIR"/configs/user-config-${CONFIG_VARIANT}-${BOOST_VER}-*.jam; do - ARCH="`echo $FILE | sed s%$SCRIPTDIR/configs/user-config-${CONFIG_VARIANT}-${BOOST_VER}-%% | sed s/[.]jam//`" - if [ "$ARCH" = "common" ]; then - continue - fi - JAMARCH="`echo ${ARCH} | tr -d '_-'`" # Remove all dashes, b2 does not like them - sed "s/%ARCH%/${JAMARCH}/g" "$SCRIPTDIR"/configs/user-config-${CONFIG_VARIANT}-${BOOST_VER}-common.jam >> $BOOST_DIR/tools/build/src/user-config.jam || exit 1 - cat "$SCRIPTDIR"/configs/user-config-${CONFIG_VARIANT}-${BOOST_VER}-$ARCH.jam >> $BOOST_DIR/tools/build/src/user-config.jam || exit 1 - echo ';' >> $BOOST_DIR/tools/build/src/user-config.jam || exit 1 - done - else - cp "$SCRIPTDIR"/configs/user-config-${CONFIG_VARIANT}-${BOOST_VER}.jam $BOOST_DIR/tools/build/v2/user-config.jam || exit 1 - fi - - if [ -n "$WITH_PYTHON" ]; then - echo "Sed: $WITH_PYTHON" - sed -e "s:%PYTHON_VERSION%:${PYTHON_VERSION}:g;s:%PYTHON_INSTALL_DIR%:${WITH_PYTHON}:g;s:%PYTHON_INCLUDE_DIR%:${PYTHON_INCLUDE_DIR}:g" "$SCRIPTDIR"/configs/user-config-python.jam >> $BOOST_DIR/tools/build/src/user-config-python.jam || exit 1 - cat $BOOST_DIR/tools/build/src/user-config-python.jam >> $BOOST_DIR/tools/build/src/user-config.jam - fi - for dir in $PATCH_BOOST_DIR; do if [ ! -d "$dir" ]; then echo "Could not find directory '$dir' while looking for patches" @@ -577,6 +556,34 @@ then done fi +if [ ! -f $SCRIPTDIR/user-config.jam ] +then + echo "# ------------------------------------" + echo "# Creating $SCRIPTDIR/user-config.jam " + echo "# ------------------------------------" + if [ "$TOOLSET" = "clang" ]; then + cp "$SCRIPTDIR"/configs/user-config-${CONFIG_VARIANT}-${BOOST_VER}.jam "$SCRIPTDIR"/user-config.jam || exit 1 + for FILE in "$SCRIPTDIR"/configs/user-config-${CONFIG_VARIANT}-${BOOST_VER}-*.jam; do + ARCH="`echo $FILE | sed s%$SCRIPTDIR/configs/user-config-${CONFIG_VARIANT}-${BOOST_VER}-%% | sed s/[.]jam//`" + if [ "$ARCH" = "common" ]; then + continue + fi + JAMARCH="`echo ${ARCH} | tr -d '_-'`" # Remove all dashes, b2 does not like them + sed "s/%ARCH%/${JAMARCH}/g" "$SCRIPTDIR"/configs/user-config-${CONFIG_VARIANT}-${BOOST_VER}-common.jam >> "$SCRIPTDIR"/user-config.jam || exit 1 + cat "$SCRIPTDIR"/configs/user-config-${CONFIG_VARIANT}-${BOOST_VER}-$ARCH.jam >> "$SCRIPTDIR"/user-config.jam || exit 1 + echo ';' >> "$SCRIPTDIR"/user-config.jam || exit 1 + done + else + cp "$SCRIPTDIR"/configs/user-config-${CONFIG_VARIANT}-${BOOST_VER}.jam "$SCRIPTDIR"/user-config.jam || exit 1 + fi + + if [ -n "$WITH_PYTHON" ]; then + echo "Sed: $WITH_PYTHON" + sed -e "s:%PYTHON_VERSION%:${PYTHON_VERSION}:g;s:%PYTHON_INSTALL_DIR%:${WITH_PYTHON}:g;s:%PYTHON_INCLUDE_DIR%:${PYTHON_INCLUDE_DIR}:g" "$SCRIPTDIR"/configs/user-config-python.jam >> $BOOST_DIR/tools/build/src/user-config-python.jam || exit 1 + cat $BOOST_DIR/tools/build/src/user-config-python.jam >> $SCRIPTDIR/user-config.jam + fi +fi + echo "# ---------------" echo "# Build using NDK" echo "# ---------------" @@ -662,8 +669,9 @@ echo "Building boost for android for $ARCH" echo "Silently building Boost, this can take minutes..." { - time ./b2 -q \ + time ./b2 -q \ -d+2 \ + --user-config=$SCRIPTDIR/user-config.jam \ --ignore-site-config \ -j$NCPU \ target-os=${TARGET_OS} \ From 2d43715f07d826c9836537ea819a1165e82f39df Mon Sep 17 00:00:00 2001 From: SuperGNUS Date: Mon, 19 Dec 2022 22:14:38 -0800 Subject: [PATCH 03/15] Output destination branch for patch on error --- build-android.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-android.sh b/build-android.sh index 37585d87a..ee2df7e57 100755 --- a/build-android.sh +++ b/build-android.sh @@ -549,7 +549,7 @@ then if [ $? != 0 ] ; then dump "ERROR: Patch failure !! Please check your patches directory!" dump " Try to perform a clean build using --clean ." - dump " Problem patch: $dir/$PATCHNAME" + dump " Problem patch: $dir/$PATCHNAME into $SRC_DIR/$PATCHDIR" exit 1 fi done From 7e8330e231b138070072875727c8be6f9510998e Mon Sep 17 00:00:00 2001 From: SuperGNUS Date: Mon, 19 Dec 2022 23:21:02 -0800 Subject: [PATCH 04/15] Not sure why && is broken in Ubuntu 22, maybe set -e or something. This fixes the patching --- build-android.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build-android.sh b/build-android.sh index ee2df7e57..802ad6fea 100755 --- a/build-android.sh +++ b/build-android.sh @@ -545,13 +545,15 @@ then PATCHDIR=`dirname $PATCH` PATCHNAME=`basename $PATCH` log "Applying $PATCHNAME into $SRC_DIR/$PATCHDIR" - cd $SRC_DIR && patch -p1 < $dir/$PATCH && cd $PROGDIR + cd $SRC_DIR + patch -p1 < $dir/$PATCH if [ $? != 0 ] ; then dump "ERROR: Patch failure !! Please check your patches directory!" dump " Try to perform a clean build using --clean ." - dump " Problem patch: $dir/$PATCHNAME into $SRC_DIR/$PATCHDIR" + dump " Problem patch: $dir/$PATCH into $SRC_DIR" exit 1 fi + cd $PROGDIR done done fi From 0a437c2ca424508cfb631468e53199b782f55faf Mon Sep 17 00:00:00 2001 From: SuperGNUS Date: Tue, 20 Dec 2022 10:53:28 -0800 Subject: [PATCH 05/15] Testing because can't get github CI/CD to build --- build-android.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-android.sh b/build-android.sh index 802ad6fea..3a4da7683 100755 --- a/build-android.sh +++ b/build-android.sh @@ -546,6 +546,7 @@ then PATCHNAME=`basename $PATCH` log "Applying $PATCHNAME into $SRC_DIR/$PATCHDIR" cd $SRC_DIR + echo "Running: `which patch` -p1 < $dir/$PATCH in `pwd`" patch -p1 < $dir/$PATCH if [ $? != 0 ] ; then dump "ERROR: Patch failure !! Please check your patches directory!" From b49787f42f731d2ebd6de3c981108aa60440e851 Mon Sep 17 00:00:00 2001 From: SuperGNUS Date: Tue, 20 Dec 2022 11:59:35 -0800 Subject: [PATCH 06/15] Branch to debug ci system patch command --- build-android.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-android.sh b/build-android.sh index 3a4da7683..f9512bab3 100755 --- a/build-android.sh +++ b/build-android.sh @@ -546,6 +546,7 @@ then PATCHNAME=`basename $PATCH` log "Applying $PATCHNAME into $SRC_DIR/$PATCHDIR" cd $SRC_DIR + patch --version echo "Running: `which patch` -p1 < $dir/$PATCH in `pwd`" patch -p1 < $dir/$PATCH if [ $? != 0 ] ; then From 3fa29f29ee94506d43f5546a131130dfc1a2b787 Mon Sep 17 00:00:00 2001 From: SuperGNUS Date: Tue, 20 Dec 2022 22:10:05 -0800 Subject: [PATCH 07/15] patch 2.7.6 on Ubuntu 22 doesn't like symlinked file patches. Also, these patches are on the headers instead of the symlinks --- build-android.sh | 11 +++++++++-- patches/boost-1_80_0/boost-1.80.0.patch | 26 ++++++++++++------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/build-android.sh b/build-android.sh index f9512bab3..7d6fdb633 100755 --- a/build-android.sh +++ b/build-android.sh @@ -507,10 +507,10 @@ then cd $BOOST_DIR case "$HOST_OS" in windows) - cmd //c "bootstrap.bat" 2>&1 | tee -a $PROGDIR/build.log + cmd //c "bootstrap.bat" > $PROGDIR/build.log 2>&1 ;; *) # Linux and others - ./bootstrap.sh 2>&1 | tee -a $PROGDIR/build.log + ./bootstrap.sh > $PROGDIR/build.log 2>&1 esac @@ -518,6 +518,13 @@ then dump "ERROR: Could not perform boostrap! See $TMPLOG for more info." exit 1 fi + + # + # Well we are going to need headers generated. if we are going to patch them. + # + echo "Performing header generation" + ./b2 headers + cd $PROGDIR # ------------------------------------------------------------- diff --git a/patches/boost-1_80_0/boost-1.80.0.patch b/patches/boost-1_80_0/boost-1.80.0.patch index 1183df46d..ac5981fd5 100644 --- a/patches/boost-1_80_0/boost-1.80.0.patch +++ b/patches/boost-1_80_0/boost-1.80.0.patch @@ -1,6 +1,6 @@ -diff -u -r boost_1_80_0.orig/boost/asio/detail/config.hpp boost_1_80_0.boost/asio/detail/config.hpp ---- boost_1_80_0.orig/boost/asio/detail/config.hpp -+++ boost_1_80_0.boost/asio/detail/config.hpp +diff -u -r boost_1_80_0.orig/libs/asio/include/boost/asio/detail/config.hpp boost_1_80_0/libs/asio/include/boost/asio/detail/config.hpp +--- boost_1_80_0.orig/libs/asio/include/boost/asio/detail/config.hpp ++++ boost_1_80_0/libs/asio/include/boost/asio/detail/config.hpp @@ -1251,7 +1251,11 @@ # if (_LIBCPP_VERSION < 7000) # if (__cplusplus >= 201402) @@ -14,10 +14,10 @@ diff -u -r boost_1_80_0.orig/boost/asio/detail/config.hpp boost_1_80_0.boost/asi # endif // __has_include() # endif // (__cplusplus >= 201402) # endif // (_LIBCPP_VERSION < 7000) -diff -u -r boost_1_80_0.orig/boost/config/user.hpp boost_1_80_0.boost/config/user.hpp ---- boost_1_80_0.orig/boost/config/user.hpp -+++ boost_1_80_0.boost/config/user.hpp -@@ -13,6 +13,13 @@ +diff -u -r boost_1_80_0.orig/libs/config/include/boost/config/user.hpp boost_1_80_0/libs/config/include/boost/config/user.hpp +--- boost_1_80_0.orig//libs/config/include/boost/config/user.hpp ++++ boost_1_80_0//libs/config/include/boost/config/user.hpp +@@ -12,6 +12,13 @@ // configuration policy: // @@ -31,9 +31,9 @@ diff -u -r boost_1_80_0.orig/boost/config/user.hpp boost_1_80_0.boost/config/use // define this to locate a compiler config file: // #define BOOST_COMPILER_CONFIG -diff -u -r boost_1_80_0.orig/libs/filesystem/src/operations.cpp boost_1_80_0.libs/filesystem/src/operations.cpp +diff -u -r boost_1_80_0.orig/libs/filesystem/src/operations.cpp boost_1_80_0/libs/filesystem/src/operations.cpp --- boost_1_80_0.orig/libs/filesystem/src/operations.cpp -+++ boost_1_80_0.libs/filesystem/src/operations.cpp ++++ boost_1_80_0/libs/filesystem/src/operations.cpp @@ -75,6 +75,10 @@ #endif #include @@ -67,9 +67,9 @@ diff -u -r boost_1_80_0.orig/libs/filesystem/src/operations.cpp boost_1_80_0.lib #define BOOST_SET_CURRENT_DIRECTORY(P) (::chdir(P) == 0) #define BOOST_CREATE_HARD_LINK(F, T) (::link(T, F) == 0) #define BOOST_MOVE_FILE(OLD, NEW) (::rename(OLD, NEW) == 0) -diff -u -r boost_1_80_0.orig/libs/filesystem/src/path.cpp boost_1_80_0.libs/filesystem/src/path.cpp +diff -u -r boost_1_80_0.orig/libs/filesystem/src/path.cpp boost_1_80_0/libs/filesystem/src/path.cpp --- boost_1_80_0.orig/libs/filesystem/src/path.cpp -+++ boost_1_80_0.libs/filesystem/src/path.cpp ++++ boost_1_80_0/libs/filesystem/src/path.cpp @@ -28,7 +28,7 @@ #include "windows_file_codecvt.hpp" #include "windows_tools.hpp" @@ -88,9 +88,9 @@ diff -u -r boost_1_80_0.orig/libs/filesystem/src/path.cpp boost_1_80_0.libs/file // "All BSD system functions expect their string parameters to be in UTF-8 encoding // and nothing else." See // http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPInternational/Articles/FileEncodings.html -diff -u -r boost_1_80_0.orig/tools/build/src/tools/common.jam boost_1_80_0.tools/build/src/tools/common.jam +diff -u -r boost_1_80_0.orig/tools/build/src/tools/common.jam boost_1_80_0/tools/build/src/tools/common.jam --- boost_1_80_0.orig/tools/build/src/tools/common.jam -+++ boost_1_80_0.tools/build/src/tools/common.jam ++++ boost_1_80_0/tools/build/src/tools/common.jam @@ -981,7 +981,7 @@ } From 24c5d09d5bc404fdc500c23520abe0a5a05783c8 Mon Sep 17 00:00:00 2001 From: Super Genius Date: Tue, 20 Dec 2022 22:22:16 -0800 Subject: [PATCH 08/15] Removing Debug output --- build-android.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/build-android.sh b/build-android.sh index 7d6fdb633..ba8fd5990 100755 --- a/build-android.sh +++ b/build-android.sh @@ -553,7 +553,6 @@ then PATCHNAME=`basename $PATCH` log "Applying $PATCHNAME into $SRC_DIR/$PATCHDIR" cd $SRC_DIR - patch --version echo "Running: `which patch` -p1 < $dir/$PATCH in `pwd`" patch -p1 < $dir/$PATCH if [ $? != 0 ] ; then From fc006fe9405a4f35d6bacf549fab62312318ef49 Mon Sep 17 00:00:00 2001 From: SuperGNUS Date: Wed, 21 Dec 2022 21:17:29 -0800 Subject: [PATCH 09/15] Changes for better Android options for static library and static system library linking too --- build-android.sh | 30 +++++++++++++++++------------- build-common.sh | 14 ++++++++++++++ 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/build-android.sh b/build-android.sh index ba8fd5990..4670a1e35 100755 --- a/build-android.sh +++ b/build-android.sh @@ -142,9 +142,10 @@ select_toolchain () { TOOLCHAIN=$1 } +EXTRA_PARAMS= register_option "--extra=" add_extra_params "Add extra b2 parameters for the build." add_extra_params () { - EXTRA_PARAMS=$1 + for param in $(echo $1 | tr ',' '\n') ; do EXTRA_PARAMS="${EXTRA_PARAMS} $param"; done } CLEAN=no @@ -507,10 +508,10 @@ then cd $BOOST_DIR case "$HOST_OS" in windows) - cmd //c "bootstrap.bat" > $PROGDIR/build.log 2>&1 + cmd //c "bootstrap.bat" 2>&1 | teelog ;; *) # Linux and others - ./bootstrap.sh > $PROGDIR/build.log 2>&1 + ./bootstrap.sh 2>&1 | teelog esac @@ -535,7 +536,7 @@ then for dir in $PATCH_BOOST_DIR; do if [ ! -d "$dir" ]; then - echo "Could not find directory '$dir' while looking for patches" + echo "Could not find directory '$dir' while looking for patches" 2>&1 | teelog exit 1 fi @@ -631,7 +632,7 @@ echo "Building boost for android for $ARCH" cd $BOOST_DIR - echo "Adding pathname: `dirname $CXXPATH`" + echo "Adding pathname: `dirname $CXXPATH`" | teelog # `AndroidBinariesPath` could be used by user-config-*.jam export AndroidBinariesPath=`dirname $CXXPATH` export PATH=$AndroidBinariesPath:$PATH @@ -677,9 +678,13 @@ echo "Building boost for android for $ARCH" unset WITHOUT_LIBRARIES fi - echo "Silently building Boost, this can take minutes..." + if [ $VERBOSE = 'no' ]; then + echo "Silently building Boost, this can take minutes..." + fi + { - time ./b2 -q \ + set -x + $TIME_CMD ./b2 -q \ -d+2 \ --user-config=$SCRIPTDIR/user-config.jam \ --ignore-site-config \ @@ -696,17 +701,16 @@ echo "Building boost for android for $ARCH" -sICONV_PATH=`pwd`/../libiconv-libicu-android/$ARCH \ -sICU_PATH=`pwd`/../libiconv-libicu-android/$ARCH \ --build-dir="$BUILD_DIR" \ - --prefix="$PREFIX_ARCH_DIR" \ + --prefix="$PREFIX" \ $EXTRA_PARAMS \ $LIBRARIES \ $LIBRARIES_BROKEN \ - install > $PROGDIR/build.log 2>&1 \ - || { dump "ERROR: Failed to build boost for android for $ARCH!" ; rm -rf $PREFIX_ARCH_DIR ; exit 1 ; } - } - + install 2>&1 \ + || { set +x; dump "ERROR: Failed to build boost for android for $ARCH!" ; rm -rf $PREFIX ; exit 1 ; } + } | teelog +) # # PIPESTATUS variable is defined only in Bash, and we are using /bin/sh, which is not Bash on newer Debian/Ubuntu -) dump "Done!" diff --git a/build-common.sh b/build-common.sh index 1ca7507ae..bcd652bd2 100644 --- a/build-common.sh +++ b/build-common.sh @@ -78,6 +78,20 @@ log2 () fi } +# use | teelog for this +teelog () +{ + if [ "$VERBOSE" = "yes" ] ; then + if [ -n "$TMPLOG" ] ; then + cat | tee -a $TMPLOG + else + cat + fi + else + cat >> $TMPLOG + fi +} + run () { if [ "$VERBOSE" = "yes" ] ; then From 14953af0b0f78d54bdf3e061b0d8cbc4d7d3ee02 Mon Sep 17 00:00:00 2001 From: Super Genius Date: Fri, 23 Dec 2022 20:50:49 -0800 Subject: [PATCH 10/15] Removing building Headers for 1.8.0 because patches happen on non symlinked headers --- build-android.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build-android.sh b/build-android.sh index 4670a1e35..8086a4778 100755 --- a/build-android.sh +++ b/build-android.sh @@ -520,12 +520,6 @@ then exit 1 fi - # - # Well we are going to need headers generated. if we are going to patch them. - # - echo "Performing header generation" - ./b2 headers - cd $PROGDIR # ------------------------------------------------------------- From 56d70f10b91c545c73438c47bf8cb1c501476855 Mon Sep 17 00:00:00 2001 From: SuperGNUS Date: Fri, 23 Dec 2022 22:10:06 -0800 Subject: [PATCH 11/15] Removing debugging output --- build-android.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build-android.sh b/build-android.sh index 8086a4778..cc6462489 100755 --- a/build-android.sh +++ b/build-android.sh @@ -677,7 +677,6 @@ echo "Building boost for android for $ARCH" fi { - set -x $TIME_CMD ./b2 -q \ -d+2 \ --user-config=$SCRIPTDIR/user-config.jam \ @@ -700,7 +699,7 @@ echo "Building boost for android for $ARCH" $LIBRARIES \ $LIBRARIES_BROKEN \ install 2>&1 \ - || { set +x; dump "ERROR: Failed to build boost for android for $ARCH!" ; rm -rf $PREFIX ; exit 1 ; } + || { dump "ERROR: Failed to build boost for android for $ARCH!" ; rm -rf $PREFIX ; exit 1 ; } } | teelog ) # From 8da3871b2870445e273a37239089e28888b5cad3 Mon Sep 17 00:00:00 2001 From: devcareer00 Date: Wed, 17 May 2023 15:51:23 +0200 Subject: [PATCH 12/15] Added missing runtime-link option --- build-android.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-android.sh b/build-android.sh index cc6462489..851d86dc0 100755 --- a/build-android.sh +++ b/build-android.sh @@ -687,6 +687,7 @@ echo "Building boost for android for $ARCH" $cflags \ $cxxflags \ link=static \ + runtime-link=static \ threading=multi \ --layout=${LAYOUT} \ $WITHOUT_LIBRARIES \ From 1bca67a55d59aa4c65c0399bdad0f66924fc3b5d Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Tue, 25 Jun 2024 13:10:21 -0300 Subject: [PATCH 13/15] Fix: Files with wrong path --- patches/boost-1_85_0/boost-1_85_0.patch | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/patches/boost-1_85_0/boost-1_85_0.patch b/patches/boost-1_85_0/boost-1_85_0.patch index 1b03a7f23..37e2c20d4 100644 --- a/patches/boost-1_85_0/boost-1_85_0.patch +++ b/patches/boost-1_85_0/boost-1_85_0.patch @@ -1,6 +1,6 @@ -diff -urN boost_1_85_0.orig/boost/asio/detail/config.hpp boost_1_85_0/boost/asio/detail/config.hpp ---- boost_1_85_0.orig/boost/asio/detail/config.hpp 2024-04-11 13:48:00.000000000 -0500 -+++ boost_1_85_0/boost/asio/detail/config.hpp 2024-06-18 10:32:44.578013858 -0500 +diff -urN boost_1_85_0.orig/libs/asio/include/boost/asio/detail/config.hpp boost_1_85_0/libs/asio/include/boost/asio/detail/config.hpp +--- boost_1_85_0.orig/libs/asio/include/boost/asio/detail/config.hpp 2024-04-11 13:48:00.000000000 -0500 ++++ boost_1_85_0/libs/asio/include/boost/asio/detail/config.hpp 2024-06-18 10:32:44.578013858 -0500 @@ -492,7 +492,11 @@ # if (_LIBCPP_VERSION < 7000) # if (__cplusplus >= 201402) @@ -14,9 +14,9 @@ diff -urN boost_1_85_0.orig/boost/asio/detail/config.hpp boost_1_85_0/boost/asio # endif // __has_include() # endif // (__cplusplus >= 201402) # endif // (_LIBCPP_VERSION < 7000) -diff -urN boost_1_85_0.orig/boost/asio/detail/config.hpp.orig boost_1_85_0/boost/asio/detail/config.hpp.orig ---- boost_1_85_0.orig/boost/asio/detail/config.hpp.orig 1969-12-31 18:00:00.000000000 -0600 -+++ boost_1_85_0/boost/asio/detail/config.hpp.orig 2024-06-18 10:32:44.578013858 -0500 +diff -urN boost_1_85_0.orig/libs/asio/include/boost/asio/detail/config.hpp.orig boost_1_85_0/libs/asio/include/boost/asio/detail/config.hpp.orig +--- boost_1_85_0.orig/libs/asio/include/boost/asio/detail/config.hpp.orig 1969-12-31 18:00:00.000000000 -0600 ++++ boost_1_85_0/libs/asio/include/boost/asio/detail/config.hpp.orig 2024-06-18 10:32:44.578013858 -0500 @@ -0,0 +1,1397 @@ +// +// detail/config.hpp @@ -1415,9 +1415,9 @@ diff -urN boost_1_85_0.orig/boost/asio/detail/config.hpp.orig boost_1_85_0/boost +#endif // !defined(BOOST_ASIO_HAS_SNPRINTF) + +#endif // BOOST_ASIO_DETAIL_CONFIG_HPP -diff -urN boost_1_85_0.orig/boost/config/user.hpp boost_1_85_0/boost/config/user.hpp ---- boost_1_85_0.orig/boost/config/user.hpp 2024-04-11 13:48:00.000000000 -0500 -+++ boost_1_85_0/boost/config/user.hpp 2024-06-18 10:32:44.578013858 -0500 +diff -urN boost_1_85_0.orig/libs/config/include/boost/config/user.hpp boost_1_85_0/libs/config/include/boost/config/user.hpp +--- boost_1_85_0.orig/libs/config/include/boost/config/user.hpp 2024-04-11 13:48:00.000000000 -0500 ++++ boost_1_85_0/libs/config/include/boost/config/user.hpp 2024-06-18 10:32:44.578013858 -0500 @@ -13,6 +13,13 @@ // configuration policy: // From 510cea82bf5b99516ec035bea8baf0d4620a66b9 Mon Sep 17 00:00:00 2001 From: Eduardo Menges Mattje Date: Thu, 26 Sep 2024 08:31:37 -0300 Subject: [PATCH 14/15] Added support for NDK `27.1` --- build-android.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-android.sh b/build-android.sh index 851d86dc0..388bb1a55 100755 --- a/build-android.sh +++ b/build-android.sh @@ -413,7 +413,7 @@ case "$NDK_RN" in TOOLSET=clang CONFIG_VARIANT=ndk19 ;; - "22.1"|"23.0"|"23.1"|"25.0"|"25.1"|"25.2"|"26.0"|"26.1"|"26.2"|"26.3"|"27.0") + "22.1"|"23.0"|"23.1"|"25.0"|"25.1"|"25.2"|"26.0"|"26.1"|"26.2"|"26.3"|"27.0"|"27.1") TOOLCHAIN=${TOOLCHAIN:-llvm} CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++ TOOLSET=clang From c583d2de468c19f4dd4bf78b0cd4460641ce43fd Mon Sep 17 00:00:00 2001 From: Henrique A Klein Date: Tue, 12 Nov 2024 16:11:10 -0300 Subject: [PATCH 15/15] Feat: Incremented NDK version to 27.2 --- build-android.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-android.sh b/build-android.sh index 388bb1a55..510cecf90 100755 --- a/build-android.sh +++ b/build-android.sh @@ -413,7 +413,7 @@ case "$NDK_RN" in TOOLSET=clang CONFIG_VARIANT=ndk19 ;; - "22.1"|"23.0"|"23.1"|"25.0"|"25.1"|"25.2"|"26.0"|"26.1"|"26.2"|"26.3"|"27.0"|"27.1") + "22.1"|"23.0"|"23.1"|"25.0"|"25.1"|"25.2"|"26.0"|"26.1"|"26.2"|"26.3"|"27.0"|"27.1"|"27.2") TOOLCHAIN=${TOOLCHAIN:-llvm} CXXPATH=$AndroidNDKRoot/toolchains/${TOOLCHAIN}/prebuilt/${PlatformOS}-x86_64/bin/clang++ TOOLSET=clang