2 # Copyright 2019 Rene Rivera
3 # Copyright (C) 2005, 2006 Douglas Gregor.
4 # Copyright (C) 2006 The Trustees of Indiana University
6 # Distributed under the Boost Software License, Version 1.0.
7 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
9 # boostinspect:notab - Tabs are required for the Makefile.
25 # Handle case where builtin shell version of echo command doesn't
26 # support -n. Use the installed echo executable if there is one
27 # rather than builtin version to ensure -n is supported.
29 if test "x$ECHO" = x; then
45 -prefix=* | --prefix=*)
46 PREFIX=`expr "x$option" : "x-*prefix=\(.*\)"`
49 -exec-prefix=* | --exec-prefix=*)
50 EPREFIX=`expr "x$option" : "x-*exec-prefix=\(.*\)"`
53 -libdir=* | --libdir=*)
54 LIBDIR=`expr "x$option" : "x-*libdir=\(.*\)"`
57 -includedir=* | --includedir=*)
58 INCLUDEDIR=`expr "x$option" : "x-*includedir=\(.*\)"`
61 -show-libraries | --show-libraries )
62 flag_show_libraries=yes
65 -with-bjam=* | --with-bjam=* )
66 BJAM=`expr "x$option" : "x-*with-bjam=\(.*\)"`
69 -with-icu | --with-icu )
73 -with-icu=* | --with-icu=* )
75 ICU_ROOT=`expr "x$option" : "x-*with-icu=\(.*\)"`
78 -without-icu | --without-icu )
82 -with-libraries=* | --with-libraries=* )
83 library_list=`expr "x$option" : "x-*with-libraries=\(.*\)"`
84 if test "$library_list" != "all"; then
87 for library in $library_list
89 LIBS="$LIBS --with-$library"
91 if test $library = python; then
97 if test "x$requested_python" != xyes; then
103 -without-libraries=* | --without-libraries=* )
104 library_list=`expr "x$option" : "x-*without-libraries=\(.*\)"`
107 for library in $library_list
109 LIBS="$LIBS --without-$library"
111 if test $library = python; then
118 -with-python=* | --with-python=* )
119 PYTHON=`expr "x$option" : "x-*with-python=\(.*\)"`
122 -with-python-root=* | --with-python-root=* )
123 PYTHON_ROOT=`expr "x$option" : "x-*with-python-root=\(.*\)"`
126 -with-python-version=* | --with-python-version=* )
127 PYTHON_VERSION=`expr "x$option" : "x-*with-python-version=\(.*\)"`
130 -with-toolset=* | --with-toolset=* )
131 TOOLSET=`expr "x$option" : "x-*with-toolset=\(.*\)"`
135 { echo "error: unrecognized option: $option
136 Try \`$0 --help' for more information." >&2
137 { (exit 1); exit 1; }; }
143 if test "x$want_help" = xyes; then
145 \`./bootstrap.sh' prepares Boost for building on a few kinds of systems.
147 Usage: $0 [OPTION]...
149 Defaults for the options are specified in brackets.
152 -h, --help display this help and exit
153 --with-bjam=BJAM use existing Boost.Jam executable (bjam)
154 [automatically built]
155 --with-toolset=TOOLSET use specific Boost.Build toolset
156 [automatically detected]
157 --show-libraries show the set of libraries that require build
158 and installation steps (i.e., those libraries
159 that can be used with --with-libraries or
160 --without-libraries), then exit
161 --with-libraries=list build only a particular set of libraries,
162 describing using either a comma-separated list of
163 library names or "all"
165 --without-libraries=list build all libraries except the ones listed []
166 --with-icu enable Unicode/ICU support in Regex
167 [automatically detected]
168 --without-icu disable Unicode/ICU support in Regex
169 --with-icu=DIR specify the root of the ICU library installation
170 and enable Unicode/ICU support in Regex
171 [automatically detected]
172 --with-python=PYTHON specify the Python executable [python]
173 --with-python-root=DIR specify the root of the Python installation
174 [automatically detected]
175 --with-python-version=X.Y specify the Python version as X.Y
176 [automatically detected]
178 Installation directories:
179 --prefix=PREFIX install Boost into the given PREFIX
181 --exec-prefix=EPREFIX install Boost binaries into the given EPREFIX
184 More precise control over installation directories:
185 --libdir=DIR install libraries here [EPREFIX/lib]
186 --includedir=DIR install headers here [PREFIX/include]
190 test -n "$want_help" && exit 0
192 my_dir=$(dirname "$0")
194 # Determine the toolset, if not already decided
195 if test "x$TOOLSET" = x; then
196 guessed_toolset=`$my_dir/tools/build/src/engine/build.sh --guess-toolset`
197 case $guessed_toolset in
198 acc | clang | gcc | como | mipspro | pathscale | pgi | qcc | vacpp )
199 TOOLSET=$guessed_toolset
215 # Not supported by Boost.Build
223 if test "x$BJAM" = x; then
224 $ECHO -n "Building Boost.Build engine with toolset $TOOLSET... "
226 (cd "$my_dir/tools/build/src/engine" && ./build.sh "$TOOLSET") > bootstrap.log 2>&1
227 if [ $? -ne 0 ]; then
229 echo "Failed to build Boost.Build build engine"
230 echo "Consult 'bootstrap.log' for more details"
234 BJAM="$my_dir/tools/build/src/engine/b2"
235 echo "tools/build/src/engine/b2"
240 # TBD: Turn BJAM into an absolute path
242 # If there is a list of libraries
243 if test "x$flag_show_libraries" = xyes; then
246 The following Boost libraries have portions that require a separate build
247 and installation step. Any library not listed here can be used by including
250 The Boost libraries requiring separate building and installation are:
252 $BJAM -d0 --show-libraries | grep '^[[:space:]]*-'
257 if test "x$EPREFIX" = x; then
261 if test "x$LIBDIR" = x; then
262 LIBDIR="$EPREFIX/lib"
265 if test "x$INCLUDEDIR" = x; then
266 INCLUDEDIR="$PREFIX/include"
270 if test "x$flag_no_python" = x; then
271 result=`$PYTHON -c "exit" > /dev/null 2>&1`
272 if [ "$?" -ne "0" ]; then
277 if test "x$flag_no_python" = x; then
278 if test "x$PYTHON_VERSION" = x; then
279 $ECHO -n "Detecting Python version... "
280 PYTHON_VERSION=`$PYTHON -c "import sys; print (\"%d.%d\" % (sys.version_info[0], sys.version_info[1]))"`
284 if test "x$PYTHON_ROOT" = x; then
285 $ECHO -n "Detecting Python root... "
286 PYTHON_ROOT=`$PYTHON -c "import sys; print(sys.prefix)"`
292 $ECHO -n "Unicode/ICU support for Boost.Regex?... "
293 if test "x$flag_icu" != xno; then
294 if test "x$ICU_ROOT" = x; then
295 if command -v pkg-config > /dev/null && pkg-config icu-uc ; then
296 ICU_ROOT=`pkg-config --variable=prefix icu-uc`
299 if test "x$ICU_ROOT" = x; then
300 COMMON_ICU_PATHS="/usr /usr/local /sw"
301 for p in $COMMON_ICU_PATHS; do
302 if test -r $p/include/unicode/utypes.h; then
307 if test "x$ICU_ROOT" = x; then
310 BJAM_CONFIG="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT"
314 BJAM_CONFIG="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT"
321 # Backup the user's existing project-config.jam
322 JAM_CONFIG_OUT="project-config.jam"
323 if test -r "project-config.jam"; then
326 while test -r "project-config.jam.$counter"; do
327 counter=`expr $counter + 1`
330 echo "Backing up existing Boost.Build configuration in project-config.jam.$counter"
331 mv "project-config.jam" "project-config.jam.$counter"
334 # Generate user-config.jam
335 echo "Generating Boost.Build configuration in project-config.jam for $TOOLSET..."
336 cat > project-config.jam <<EOF
337 # Boost.Build Configuration
338 # Automatically generated by bootstrap.sh
343 # Compiler configuration. This definition will be used unless
344 # you already have defined some toolsets in your user-config.jam
346 if ! $TOOLSET in [ feature.values <toolset> ]
351 project : default-build <toolset>$TOOLSET ;
354 # - Python configuration
355 if test "x$flag_no_python" = x; then
356 cat >> project-config.jam <<EOF
358 # Python configuration
360 if ! [ python.configured ]
362 using python : $PYTHON_VERSION : "$PYTHON_ROOT" ;
367 if test "x$ICU_ROOT" != x; then
368 cat >> project-config.jam << EOF
370 path-constant ICU_PATH : $ICU_ROOT ;
375 cat >> project-config.jam << EOF
377 # List of --with-<library> and --without-<library>
378 # options. If left empty, all libraries will be built.
379 # Options specified on the command line completely
380 # override this variable.
383 # These settings are equivalent to corresponding command-line
385 option.set prefix : $PREFIX ;
386 option.set exec-prefix : $EPREFIX ;
387 option.set libdir : $LIBDIR ;
388 option.set includedir : $INCLUDEDIR ;
390 # Stop on first error
391 option.set keep-going : false ;
396 Bootstrapping is done. To build, run:
400 To generate header files, run:
404 To adjust configuration, edit 'project-config.jam'.
410 - Getting started guide:
411 http://www.boost.org/more/getting_started/unix-variants.html
413 - Boost.Build documentation:
414 http://www.boost.org/build/