mirror of
https://github.com/boostorg/build.git
synced 2026-02-13 00:12:11 +00:00
Boost.Build system with clang. I also fixed a few things in the clang-linux
toolchain;
- Clang doesn't support -pg.
- Adding -O0 to turn optimization off is silly, because it is set to zero by
default if omitted on the command line. The compiler will whine about
unused options if you later add another -O flag. The Boost.Build UTF
interface adds a second -O0, so you end up with two redundant command line
options and a warning from bjam/clang for every invocation of the compiler
when using the test framework.
[SVN r66441]
120 lines
2.5 KiB
Bash
Executable File
120 lines
2.5 KiB
Bash
Executable File
#!/bin/sh
|
|
# Copyright (C) 2005, 2006 Douglas Gregor.
|
|
# Copyright (C) 2006 The Trustees of Indiana University
|
|
# Copyright (C) 2010 Bryce Lelbach
|
|
#
|
|
# 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=""
|
|
|
|
for option
|
|
do
|
|
case $option in
|
|
|
|
-help | --help | -h)
|
|
want_help=yes ;;
|
|
|
|
-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 <<EOF
|
|
\`./bootstrap.sh' creates minimal Boost.Build, which can install itself.
|
|
|
|
Usage: $0 [OPTION]...
|
|
|
|
Defaults for the options are specified in brackets.
|
|
|
|
Configuration:
|
|
-h, --help display this help and exit
|
|
--with-bjam=BJAM use existing Boost.Jam executable (bjam)
|
|
[automatically built]
|
|
--with-toolset=TOOLSET use specific Boost.Build toolset
|
|
[automatically detected]
|
|
EOF
|
|
fi
|
|
test -n "$want_help" && exit 0
|
|
|
|
# TBD: Determine where the script is located
|
|
my_dir="."
|
|
|
|
# Determine the toolset, if not already decided
|
|
if test "x$TOOLSET" = x; then
|
|
guessed_toolset=`$my_dir/engine/src/build.sh --guess-toolset`
|
|
case $guessed_toolset in
|
|
acc | darwin | gcc | como | mipspro | pathscale | pgi | qcc | vacpp )
|
|
TOOLSET=$guessed_toolset
|
|
;;
|
|
|
|
intel-* )
|
|
TOOLSET=intel
|
|
;;
|
|
|
|
mingw )
|
|
TOOLSET=gcc
|
|
;;
|
|
|
|
clang* )
|
|
TOOLSET=clang
|
|
;;
|
|
|
|
sun* )
|
|
TOOLSET=sun
|
|
;;
|
|
|
|
* )
|
|
# Not supported by Boost.Build
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
case $TOOLSET in
|
|
clang*)
|
|
TOOLSET=clang
|
|
;;
|
|
esac
|
|
|
|
|
|
rm -f config.log
|
|
|
|
# Build bjam
|
|
if test "x$BJAM" = x; then
|
|
echo -n "Bootstrapping the build engine with toolset $TOOLSET... "
|
|
pwd=`pwd`
|
|
(cd "$my_dir/engine/src" && ./build.sh "$TOOLSET") > bootstrap.log 2>&1
|
|
if [ $? -ne 0 ]; then
|
|
echo
|
|
echo "Failed to bootstrap the build engine"
|
|
echo "Consult 'bootstrap.log' for more details"
|
|
exit 1
|
|
fi
|
|
cd "$pwd"
|
|
arch=`cd $my_dir/engine/src && ./bootstrap/jam0 -d0 -f build.jam --toolset=$TOOLSET --toolset-root= --show-locate-target && cd ..`
|
|
BJAM="$my_dir/engine/src/$arch/bjam"
|
|
echo "engine/src/$arch/bjam"
|
|
cp "$BJAM" .
|
|
fi
|
|
|
|
cat << EOF
|
|
|
|
Bootstrapping is done. To build and install, run:
|
|
|
|
./bjam install --prefix=<DIR>
|
|
|
|
EOF
|