From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/boost/bootstrap.sh | 416 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 416 insertions(+) create mode 100755 src/boost/bootstrap.sh (limited to 'src/boost/bootstrap.sh') diff --git a/src/boost/bootstrap.sh b/src/boost/bootstrap.sh new file mode 100755 index 00000000..ca0b08d5 --- /dev/null +++ b/src/boost/bootstrap.sh @@ -0,0 +1,416 @@ +#!/bin/sh +# Copyright 2019 Rene Rivera +# Copyright (C) 2005, 2006 Douglas Gregor. +# Copyright (C) 2006 The Trustees of Indiana University +# +# 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) + +# boostinspect:notab - Tabs are required for the Makefile. + +BJAM="" +TOOLSET="" +BJAM_CONFIG="" +BUILD="" +PREFIX=/usr/local +EPREFIX= +LIBDIR= +INCLUDEDIR= +LIBS="" +PYTHON=python +PYTHON_VERSION= +PYTHON_ROOT= +ICU_ROOT= + +# Handle case where builtin shell version of echo command doesn't +# support -n. Use the installed echo executable if there is one +# rather than builtin version to ensure -n is supported. +ECHO=`which echo` +if test "x$ECHO" = x; then + ECHO=echo +fi + +# Internal flags +flag_no_python= +flag_icu= +flag_show_libraries= + +for option +do + case $option in + + -help | --help | -h) + want_help=yes ;; + + -prefix=* | --prefix=*) + PREFIX=`expr "x$option" : "x-*prefix=\(.*\)"` + ;; + + -exec-prefix=* | --exec-prefix=*) + EPREFIX=`expr "x$option" : "x-*exec-prefix=\(.*\)"` + ;; + + -libdir=* | --libdir=*) + LIBDIR=`expr "x$option" : "x-*libdir=\(.*\)"` + ;; + + -includedir=* | --includedir=*) + INCLUDEDIR=`expr "x$option" : "x-*includedir=\(.*\)"` + ;; + + -show-libraries | --show-libraries ) + flag_show_libraries=yes + ;; + + -with-bjam=* | --with-bjam=* ) + BJAM=`expr "x$option" : "x-*with-bjam=\(.*\)"` + ;; + + -with-icu | --with-icu ) + flag_icu=yes + ;; + + -with-icu=* | --with-icu=* ) + flag_icu=yes + ICU_ROOT=`expr "x$option" : "x-*with-icu=\(.*\)"` + ;; + + -without-icu | --without-icu ) + flag_icu=no + ;; + + -with-libraries=* | --with-libraries=* ) + library_list=`expr "x$option" : "x-*with-libraries=\(.*\)"` + if test "$library_list" != "all"; then + old_IFS=$IFS + IFS=, + for library in $library_list + do + LIBS="$LIBS --with-$library" + + if test $library = python; then + requested_python=yes + fi + done + IFS=$old_IFS + + if test "x$requested_python" != xyes; then + flag_no_python=yes + fi + fi + ;; + + -without-libraries=* | --without-libraries=* ) + library_list=`expr "x$option" : "x-*without-libraries=\(.*\)"` + old_IFS=$IFS + IFS=, + for library in $library_list + do + LIBS="$LIBS --without-$library" + + if test $library = python; then + flag_no_python=yes + fi + done + IFS=$old_IFS + ;; + + -with-python=* | --with-python=* ) + PYTHON=`expr "x$option" : "x-*with-python=\(.*\)"` + ;; + + -with-python-root=* | --with-python-root=* ) + PYTHON_ROOT=`expr "x$option" : "x-*with-python-root=\(.*\)"` + ;; + + -with-python-version=* | --with-python-version=* ) + PYTHON_VERSION=`expr "x$option" : "x-*with-python-version=\(.*\)"` + ;; + + -with-toolset=* | --with-toolset=* ) + TOOLSET=`expr "x$option" : "x-*with-toolset=\(.*\)"` + ;; + + -*) + { echo "error: unrecognized option: $option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + esac +done + +if test "x$want_help" = xyes; then + cat < bootstrap.log 2>&1 + if [ $? -ne 0 ]; then + echo + echo "Failed to build Boost.Build build engine" + echo "Consult 'bootstrap.log' for more details" + exit 1 + fi + cd "$pwd" + BJAM="$my_dir/tools/build/src/engine/b2" + echo "tools/build/src/engine/b2" + cp "$BJAM" . + +fi + +# TBD: Turn BJAM into an absolute path + +# If there is a list of libraries +if test "x$flag_show_libraries" = xyes; then + cat < /dev/null 2>&1` + if [ "$?" -ne "0" ]; then + flag_no_python=yes + fi +fi + +if test "x$flag_no_python" = x; then + if test "x$PYTHON_VERSION" = x; then + $ECHO -n "Detecting Python version... " + PYTHON_VERSION=`$PYTHON -c "import sys; print (\"%d.%d\" % (sys.version_info[0], sys.version_info[1]))"` + echo $PYTHON_VERSION + fi + + if test "x$PYTHON_ROOT" = x; then + $ECHO -n "Detecting Python root... " + PYTHON_ROOT=`$PYTHON -c "import sys; print(sys.prefix)"` + echo $PYTHON_ROOT + fi +fi + +# Configure ICU +$ECHO -n "Unicode/ICU support for Boost.Regex?... " +if test "x$flag_icu" != xno; then + if test "x$ICU_ROOT" = x; then + if command -v pkg-config > /dev/null && pkg-config icu-uc ; then + ICU_ROOT=`pkg-config --variable=prefix icu-uc` + fi + fi + if test "x$ICU_ROOT" = x; then + COMMON_ICU_PATHS="/usr /usr/local /sw" + for p in $COMMON_ICU_PATHS; do + if test -r $p/include/unicode/utypes.h; then + ICU_ROOT=$p + fi + done + + if test "x$ICU_ROOT" = x; then + echo "not found." + else + BJAM_CONFIG="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT" + echo "$ICU_ROOT" + fi + else + BJAM_CONFIG="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT" + echo "$ICU_ROOT" + fi +else + echo "disabled." +fi + +# Backup the user's existing project-config.jam +JAM_CONFIG_OUT="project-config.jam" +if test -r "project-config.jam"; then + counter=1 + + while test -r "project-config.jam.$counter"; do + counter=`expr $counter + 1` + done + + echo "Backing up existing Boost.Build configuration in project-config.jam.$counter" + mv "project-config.jam" "project-config.jam.$counter" +fi + +# Generate user-config.jam +echo "Generating Boost.Build configuration in project-config.jam for $TOOLSET..." +cat > project-config.jam < ] +{ + using $TOOLSET ; +} + +project : default-build $TOOLSET ; +EOF + +# - Python configuration +if test "x$flag_no_python" = x; then + cat >> project-config.jam <> project-config.jam << EOF + +path-constant ICU_PATH : $ICU_ROOT ; + +EOF +fi + +cat >> project-config.jam << EOF + +# List of --with- and --without- +# options. If left empty, all libraries will be built. +# Options specified on the command line completely +# override this variable. +libraries = $LIBS ; + +# These settings are equivalent to corresponding command-line +# options. +option.set prefix : $PREFIX ; +option.set exec-prefix : $EPREFIX ; +option.set libdir : $LIBDIR ; +option.set includedir : $INCLUDEDIR ; + +# Stop on first error +option.set keep-going : false ; +EOF + +cat << EOF + +Bootstrapping is done. To build, run: + + ./b2 + +To generate header files, run: + + ./b2 headers + +To adjust configuration, edit 'project-config.jam'. +Further information: + + - Command line help: + ./b2 --help + + - Getting started guide: + http://www.boost.org/more/getting_started/unix-variants.html + + - Boost.Build documentation: + http://www.boost.org/build/ + +EOF -- cgit v1.2.3