2 # Copyright 2019-2020 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 B2 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 B2
223 if test "x$BJAM" = x
; then
224 $ECHO "Building B2 engine.."
226 (cd "$my_dir/tools/build/src/engine" && .
/build.sh
)
227 if [ $?
-ne 0 ]; then
229 echo "Failed to build B2 build engine"
233 BJAM
="$my_dir/tools/build/src/engine/b2"
234 echo "tools/build/src/engine/b2"
239 # TBD: Turn BJAM into an absolute path
241 # If there is a list of libraries
242 if test "x$flag_show_libraries" = xyes
; then
245 The following Boost libraries have portions that require a separate build
246 and installation step. Any library not listed here can be used by including
249 The Boost libraries requiring separate building and installation are:
251 $BJAM -d0 --show-libraries |
grep '^[[:space:]]*-'
256 if test "x$EPREFIX" = x
; then
260 if test "x$LIBDIR" = x
; then
261 LIBDIR
="$EPREFIX/lib"
264 if test "x$INCLUDEDIR" = x
; then
265 INCLUDEDIR
="$PREFIX/include"
269 if test "x$flag_no_python" = x
; then
270 result
=`$PYTHON -c "exit" > /dev/null 2>&1`
271 if [ "$?" -ne "0" ]; then
276 if test "x$flag_no_python" = x
; then
277 if test "x$PYTHON_VERSION" = x
; then
278 $ECHO -n "Detecting Python version... "
279 PYTHON_VERSION
=`$PYTHON -c "import sys; print (\"%d.%d\" % (sys.version_info[0], sys.version_info[1]))"`
283 if test "x$PYTHON_ROOT" = x
; then
284 $ECHO -n "Detecting Python root... "
285 PYTHON_ROOT
=`$PYTHON -c "import sys; print(sys.prefix)"`
291 $ECHO -n "Unicode/ICU support for Boost.Regex?... "
292 if test "x$flag_icu" != xno
; then
293 if test "x$ICU_ROOT" = x
; then
294 if command -v pkg-config
> /dev
/null
&& pkg-config icu-uc
; then
295 ICU_ROOT
=`pkg-config --variable=prefix icu-uc`
298 if test "x$ICU_ROOT" = x
; then
299 COMMON_ICU_PATHS
="/usr /usr/local /sw"
300 for p
in $COMMON_ICU_PATHS; do
301 if test -r $p/include
/unicode
/utypes.h
; then
306 if test "x$ICU_ROOT" = x
; then
309 BJAM_CONFIG
="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT"
313 BJAM_CONFIG
="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT"
320 # Backup the user's existing project-config.jam
321 JAM_CONFIG_OUT
="project-config.jam"
322 if test -r "project-config.jam"; then
325 while test -r "project-config.jam.$counter"; do
326 counter
=`expr $counter + 1`
329 echo "Backing up existing B2 configuration in project-config.jam.$counter"
330 mv "project-config.jam" "project-config.jam.$counter"
333 # Generate user-config.jam
334 echo "Generating B2 configuration in project-config.jam for $TOOLSET..."
335 cat > project-config.jam
<<EOF
337 # Automatically generated by bootstrap.sh
342 # Compiler configuration. This definition will be used unless
343 # you already have defined some toolsets in your user-config.jam
345 if ! $TOOLSET in [ feature.values <toolset> ]
350 project : default-build <toolset>$TOOLSET ;
353 # - Python configuration
354 if test "x$flag_no_python" = x
; then
355 cat >> project-config.jam
<<EOF
357 # Python configuration
359 if ! [ python.configured ]
361 using python : $PYTHON_VERSION : "$PYTHON_ROOT" ;
366 if test "x$ICU_ROOT" != x
; then
367 cat >> project-config.jam
<< EOF
369 path-constant ICU_PATH : $ICU_ROOT ;
374 cat >> project-config.jam
<< EOF
376 # List of --with-<library> and --without-<library>
377 # options. If left empty, all libraries will be built.
378 # Options specified on the command line completely
379 # override this variable.
382 # These settings are equivalent to corresponding command-line
384 option.set prefix : $PREFIX ;
385 option.set exec-prefix : $EPREFIX ;
386 option.set libdir : $LIBDIR ;
387 option.set includedir : $INCLUDEDIR ;
389 # Stop on first error
390 option.set keep-going : false ;
395 Bootstrapping is done. To build, run:
399 To generate header files, run:
403 To adjust configuration, edit 'project-config.jam'.
409 - Getting started guide:
410 http://www.boost.org/more/getting_started/unix-variants.html
413 http://www.boost.org/build/