2 # Copyright (C) 2005, 2006 Douglas Gregor.
3 # Copyright (C) 2006 The Trustees of Indiana University
5 # Distributed under the Boost Software License, Version 1.0.
6 # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
8 # boostinspect:notab - Tabs are required for the Makefile.
24 # Handle case where builtin shell version of echo command doesn't
25 # support -n. Use the installed echo executable if there is one
26 # rather than builtin version to ensure -n is supported.
28 if test "x$ECHO" = x
; then
44 -prefix=* |
--prefix=*)
45 PREFIX
=`expr "x$option" : "x-*prefix=\(.*\)"`
48 -exec-prefix=* |
--exec-prefix=*)
49 EPREFIX
=`expr "x$option" : "x-*exec-prefix=\(.*\)"`
52 -libdir=* |
--libdir=*)
53 LIBDIR
=`expr "x$option" : "x-*libdir=\(.*\)"`
56 -includedir=* |
--includedir=*)
57 INCLUDEDIR
=`expr "x$option" : "x-*includedir=\(.*\)"`
60 -show-libraries |
--show-libraries )
61 flag_show_libraries
=yes
64 -with-bjam=* |
--with-bjam=* )
65 BJAM
=`expr "x$option" : "x-*with-bjam=\(.*\)"`
68 -with-icu |
--with-icu )
72 -with-icu=* |
--with-icu=* )
74 ICU_ROOT
=`expr "x$option" : "x-*with-icu=\(.*\)"`
77 -without-icu |
--without-icu )
81 -with-libraries=* |
--with-libraries=* )
82 library_list
=`expr "x$option" : "x-*with-libraries=\(.*\)"`
83 if test "$library_list" != "all"; then
86 for library
in $library_list
88 LIBS
="$LIBS --with-$library"
90 if test $library = python
; then
96 if test "x$requested_python" != xyes
; then
102 -without-libraries=* |
--without-libraries=* )
103 library_list
=`expr "x$option" : "x-*without-libraries=\(.*\)"`
106 for library
in $library_list
108 LIBS
="$LIBS --without-$library"
110 if test $library = python
; then
117 -with-python=* |
--with-python=* )
118 PYTHON
=`expr "x$option" : "x-*with-python=\(.*\)"`
121 -with-python-root=* |
--with-python-root=* )
122 PYTHON_ROOT
=`expr "x$option" : "x-*with-python-root=\(.*\)"`
125 -with-python-version=* |
--with-python-version=* )
126 PYTHON_VERSION
=`expr "x$option" : "x-*with-python-version=\(.*\)"`
129 -with-toolset=* |
--with-toolset=* )
130 TOOLSET
=`expr "x$option" : "x-*with-toolset=\(.*\)"`
134 { echo "error: unrecognized option: $option
135 Try \`$0 --help' for more information." >&2
136 { (exit 1); exit 1; }; }
142 if test "x$want_help" = xyes
; then
144 \`./bootstrap.sh' prepares Boost for building on a few kinds of systems.
146 Usage: $0 [OPTION]...
148 Defaults for the options are specified in brackets.
151 -h, --help display this help and exit
152 --with-bjam=BJAM use existing Boost.Jam executable (bjam)
153 [automatically built]
154 --with-toolset=TOOLSET use specific Boost.Build toolset
155 [automatically detected]
156 --show-libraries show the set of libraries that require build
157 and installation steps (i.e., those libraries
158 that can be used with --with-libraries or
159 --without-libraries), then exit
160 --with-libraries=list build only a particular set of libraries,
161 describing using either a comma-separated list of
162 library names or "all"
164 --without-libraries=list build all libraries except the ones listed []
165 --with-icu enable Unicode/ICU support in Regex
166 [automatically detected]
167 --without-icu disable Unicode/ICU support in Regex
168 --with-icu=DIR specify the root of the ICU library installation
169 and enable Unicode/ICU support in Regex
170 [automatically detected]
171 --with-python=PYTHON specify the Python executable [python]
172 --with-python-root=DIR specify the root of the Python installation
173 [automatically detected]
174 --with-python-version=X.Y specify the Python version as X.Y
175 [automatically detected]
177 Installation directories:
178 --prefix=PREFIX install Boost into the given PREFIX
180 --exec-prefix=EPREFIX install Boost binaries into the given EPREFIX
183 More precise control over installation directories:
184 --libdir=DIR install libraries here [EPREFIX/lib]
185 --includedir=DIR install headers here [PREFIX/include]
189 test -n "$want_help" && exit 0
191 my_dir
=$
(dirname "$0")
193 # Determine the toolset, if not already decided
194 if test "x$TOOLSET" = x
; then
195 guessed_toolset
=`$my_dir/tools/build/src/engine/build.sh --guess-toolset`
196 case $guessed_toolset in
197 acc | darwin | gcc | como | mipspro | pathscale | pgi | qcc | vacpp
)
198 TOOLSET
=$guessed_toolset
214 # Not supported by Boost.Build
222 if test "x$BJAM" = x
; then
223 $ECHO -n "Building Boost.Build engine with toolset $TOOLSET... "
225 (cd "$my_dir/tools/build/src/engine" && .
/build.sh
"$TOOLSET") > bootstrap.log
2>&1
226 if [ $?
-ne 0 ]; then
228 echo "Failed to build Boost.Build build engine"
229 echo "Consult 'bootstrap.log' for more details"
233 arch
=`cd $my_dir/tools/build/src/engine && ./bootstrap/jam0 -d0 -f build.jam --toolset=$TOOLSET --toolset-root= --show-locate-target && cd ..`
234 BJAM
="$my_dir/tools/build/src/engine/$arch/b2"
235 echo "tools/build/src/engine/$arch/b2"
237 cp "$my_dir/tools/build/src/engine/$arch/bjam" .
241 # TBD: Turn BJAM into an absolute path
243 # If there is a list of libraries
244 if test "x$flag_show_libraries" = xyes
; then
247 The following Boost libraries have portions that require a separate build
248 and installation step. Any library not listed here can be used by including
251 The Boost libraries requiring separate building and installation are:
253 $BJAM -d0 --show-libraries |
grep '^[[:space:]]*-'
258 if test "x$EPREFIX" = x
; then
262 if test "x$LIBDIR" = x
; then
263 LIBDIR
="$EPREFIX/lib"
266 if test "x$INCLUDEDIR" = x
; then
267 INCLUDEDIR
="$PREFIX/include"
271 if test "x$flag_no_python" = x
; then
272 result
=`$PYTHON -c "exit" > /dev/null 2>&1`
273 if [ "$?" -ne "0" ]; then
278 if test "x$flag_no_python" = x
; then
279 if test "x$PYTHON_VERSION" = x
; then
280 $ECHO -n "Detecting Python version... "
281 PYTHON_VERSION
=`$PYTHON -c "import sys; print (\"%d.%d\" % (sys.version_info[0], sys.version_info[1]))"`
285 if test "x$PYTHON_ROOT" = x
; then
286 $ECHO -n "Detecting Python root... "
287 PYTHON_ROOT
=`$PYTHON -c "import sys; print(sys.prefix)"`
293 $ECHO -n "Unicode/ICU support for Boost.Regex?... "
294 if test "x$flag_icu" != xno
; then
295 if test "x$ICU_ROOT" = x
; then
296 COMMON_ICU_PATHS
="/usr /usr/local /sw"
297 for p
in $COMMON_ICU_PATHS; do
298 if test -r $p/include
/unicode
/utypes.h
; then
303 if test "x$ICU_ROOT" = x
; then
306 BJAM_CONFIG
="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT"
310 BJAM_CONFIG
="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT"
317 # Backup the user's existing project-config.jam
318 JAM_CONFIG_OUT
="project-config.jam"
319 if test -r "project-config.jam"; then
322 while test -r "project-config.jam.$counter"; do
323 counter
=`expr $counter + 1`
326 echo "Backing up existing Boost.Build configuration in project-config.jam.$counter"
327 mv "project-config.jam" "project-config.jam.$counter"
330 # Generate user-config.jam
331 echo "Generating Boost.Build configuration in project-config.jam..."
332 cat > project-config.jam
<<EOF
333 # Boost.Build Configuration
334 # Automatically generated by bootstrap.sh
339 # Compiler configuration. This definition will be used unless
340 # you already have defined some toolsets in your user-config.jam
342 if ! $TOOLSET in [ feature.values <toolset> ]
347 project : default-build <toolset>$TOOLSET ;
350 # - Python configuration
351 if test "x$flag_no_python" = x
; then
352 cat >> project-config.jam
<<EOF
354 # Python configuration
356 if ! [ python.configured ]
358 using python : $PYTHON_VERSION : $PYTHON_ROOT ;
363 if test "x$ICU_ROOT" != x
; then
364 cat >> project-config.jam
<< EOF
366 path-constant ICU_PATH : $ICU_ROOT ;
371 cat >> project-config.jam
<< EOF
373 # List of --with-<library> and --without-<library>
374 # options. If left empty, all libraries will be built.
375 # Options specified on the command line completely
376 # override this variable.
379 # These settings are equivivalent to corresponding command-line
381 option.set prefix : $PREFIX ;
382 option.set exec-prefix : $EPREFIX ;
383 option.set libdir : $LIBDIR ;
384 option.set includedir : $INCLUDEDIR ;
386 # Stop on first error
387 option.set keep-going : false ;
392 Bootstrapping is done. To build, run:
396 To adjust configuration, edit 'project-config.jam'.
402 - Getting started guide:
403 http://www.boost.org/more/getting_started/unix-variants.html
405 - Boost.Build documentation:
406 http://www.boost.org/build/doc/html/index.html