# boost/cfg - "Build" settings for package

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

[technotes]

1. When  "boost" is updated,  it may be  necessary  to update or patch
"cmake".

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

2. As of mid-2019,  "boost" 1.70 will break projects that use "cmake".
"boost" shouldn't be updated to 1.70 or beyond until the  problems are
known to be corrected.

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

3. "user-config.jam"  may  need to be  patched to match the  "python3"
release in use.

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

4. As of early 2010, "bjam --show-libraries" listed the following lib-
raries:

      date_time         (a),     (c), (d), (e)
      filesystem        (a), (b),     (d), (e)
      following         (a),
      graph             (a),
      graph_parallel    (a),
      iostreams         (a),
      libraries         (a),
      math              (a),
      mpi               (a),
      program_options   (a),          (d)
      python            (a),               (e)
      regex             (a),          (d)
      require           (a),
      serialization     (a),     (c),      (e)
      signals           (a), (b)
      system            (a),
      test              (a),     (c)
      thread            (a),     (c), (d), (e)
      wave              (a)

Related notes:

a. As of  early 2010, this distro  built the  "boost" libraries marked
with (a).  (a) included all of  the libraries listed here.  Small ver-
sions of the distro omitted some of the libraries.

b. As of late 2007, the "boost" libraries marked with (b) were suffic-
ient to support "pingus" and "smc".  However, the latter packages' re-
quirements may have changed since then.

c. As of late 2007,  "gnash"  required at least the  "boost" libraries
marked with (c).  It may, or may not, have required additional "boost"
libraries.

d. As of late 2007, "libtorrent" required the "boost" libraries marked
with (d).

e. As of mid-2008,  Miro (formerly known as Democracy Player) required
the "boost" libraries marked with (e).

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

[buildtimes]

00.04 hours (or 002.48 minutes) - 2021 L.A. dedi box: 6x2 CPU 32GB RAM
00.07 hours (or 004.37 minutes) - 2023 dedi Xeon E3-1200 v3  4x2  32GB
                                  RAM
00.10 hours (or 006.10 minutes) - HP EliteBook 8560w 32GB RAM
00.12 hours (or 006.93 minutes) - ThinkPad E540 i7 4x2 16GB RAM
00.13 hours (or 007.60 minutes) - ThinkPad W530 i7 4x2 32GB RAM
00.21 hours (or 012.82 minutes) - Dell Inspiron 6400 2.0 GHz Intel Duo
                                  7200 2GB RAM
00.73 hours (or 043.80 minutes) - Compaq 1.7 GHz Intel Pentium 4 512MB
                                  RAM

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

[settings]
altpkg    = yes
configure = none
license   = See "license*.txt" in installed tree
licfile   = LICENSE_1_0.txt
tmpsize   = 1041M
unpack    = relaxed

setpaths  = boost python3

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

[depends]
bzip2
jam
python2-core:strict
python3-core:strict
python:strict
zlib

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

[build]
export HOME=`pwd`
PV3=`pythonver3`

sed -e "s@__META_PRODTREE__@$PRODTREE@g" \
    -e "s@__META_PYTHONVER3__@$PV3@g" \
    < $PKGDIR_SPECIAL/user-config.jam.in \
    >                 user-config.jam

DOCDIR=$PKGDIR_PROD/doc
INCDIR=$PKGDIR_PROD/include
LIBDIR=$PKGDIR_PROD/lib

mkdir -p $DOCDIR $INCDIR $LIBDIR
rm -fr /usr/local/include/boost

n=`getconf _NPROCESSORS_ONLN`
PJOBS=$n
if [ "@PJOBS"   == "@4"  ]; then PJOBS=2; fi
if [ "@PJOBS"   == "@8"  ]; then PJOBS=6; fi
if [ "@LACBITS" == "@32" ]; then PJOBS=2; fi

#ifdef NOTDEF                   # used for 1.82 and below
# X=`find . -name has_binary_operator.hpp`
# sed -e '1 i#ifndef Q_MOC_RUN' \
#     -e '$ a#endif'            \
#     -i $X
#endif

# Courtesty of BLFS:
case $(uname -m) in
   i?86)
      sed -e "s/defined(__MINGW32__)/& || defined(__i386__)/" \
          -i ./libs/stacktrace/src/exception_headers.h ;;
esac

# echo `date` ./b2 clean toolset=gcc
# echo        ./b2 clean toolset=gcc

echo ./bootstrap.sh \
     --prefix=$PKGDIR_PROD                  \
     --with-python=`which python3`          \
     --with-python-root=$PRODTREE/python3   \
     --show-libraries                       \
     --with-libraries=all                   \
     --with-toolset=gcc

./bootstrap.sh \
     --prefix=$PKGDIR_PROD                  \
     --with-python=python3                  \
     --with-python=`which python3`          \
     --with-python-root=$PRODTREE/python3   \
     --show-libraries                       \
     --with-libraries=all                   \
     --with-toolset=gcc

# echo `date` ./b2 clean
# ./b2 clean toolset=gcc

# To use the  LLVM internal C++ library,  assuming that it exists, add
# this after "toolset=gcc":
#
#     cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++"
#
# Warning: This may cause a "signals" library not to be built.

echo `date` b2 stage
./b2 stage   threading=multi link=shared toolset=gcc \
     --prefix=$PKGDIR_PROD -j$PJOBS

echo `date` b2 install
./b2 install threading=multi link=shared toolset=gcc \
     --prefix=$PKGDIR_PROD ||
./b2 install threading=multi link=shared toolset=gcc \
     --prefix=$PKGDIR_PROD

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

# Original URLs. These URLs were valid at one point, but may have died
# since then. If you download newer versions of tarballs [etc.], don't
# delete  the  original versions,  as you may not  be able  to replace
# them.

[urls]
url_debian  = http://packages.debian.org/unstable/source/boost
url_home    = http://www.boost.org/
url_lfs     = n/a

url_tarball = https://github.com/boostorg/boost/releases/download/\
boost-1.87.0/boost-1.87.0-b2-nodocs.tar.xz

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

)[history]
170430 Updated from 1.60.0 to 1.64.0
170923 Updated from 1.64.0 to 1.65.1
171103 Patched to fix a problem related to "getpagesize"
190714 Updated to 1.69
220822 Updated to 1.77
240123 Patched to make compatible with "clang" 17
240624 Updated to 1.82
240624 Added an upstream patch to fix FTBFS with other packages
241228 Added an upstream patch to fix FTBFS with "gcc" 14
250121 Updated to 1.87