2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 01:12:13 +00:00

Spoke to volodya about this; these changes add support for bootstrapping the

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]
This commit is contained in:
Bryce Adelstein-Lelbach
2010-11-07 19:51:05 +00:00
parent 3c944bab6c
commit bd623592dd
5 changed files with 30 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
#!/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)
@@ -68,6 +69,10 @@ if test "x$TOOLSET" = x; then
TOOLSET=gcc
;;
clang* )
TOOLSET=clang
;;
sun* )
TOOLSET=sun
;;
@@ -78,6 +83,13 @@ if test "x$TOOLSET" = x; then
esac
fi
case $TOOLSET in
clang*)
TOOLSET=clang
;;
esac
rm -f config.log
# Build bjam
@@ -104,4 +116,4 @@ Bootstrapping is done. To build and install, run:
./bjam install --prefix=<DIR>
EOF
EOF

View File

@@ -193,6 +193,14 @@ toolset como como : "-o " : -D
[ opt --debug : --no_inlining ]
-I$(--python-include) -I$(--extra-include)
: -L$(--python-lib[1]) -l$(--python-lib[2]) ;
## Clang Linux 2.8+
toolset clang clang : "-o " : -D
: -Wno-unused -Wno-format
[ opt --release : -Os ]
[ opt --debug : -g -O0 -fno-inline ]
[ opt --profile : -finline-functions -g ]
-I$(--python-include) -I$(--extra-include)
: -L$(--python-lib[1]) -l$(--python-lib[2]) ;
## MacOSX Darwin, using GCC 2.9.x, 3.x
toolset darwin cc : "-o " : -D
:

View File

@@ -208,6 +208,11 @@ case $BOOST_JAM_TOOLSET in
BOOST_JAM_CC=cc
;;
clang*)
BOOST_JAM_CC="clang -Wno-unused -Wno-format"
BOOST_JAM_TOOLSET=clang
;;
tru64cxx)
BOOST_JAM_CC=cc
;;

View File

@@ -50,8 +50,8 @@ void do_ts(int** graph, int current_vertex, int* colors, int** result_ptr)
if (colors[adjacent_vertex] == white)
do_ts(graph, adjacent_vertex, colors, result_ptr);
else if (colors[adjacent_vertex] == gray)
; /* This is loop. Not sure what to do... */
//else if (colors[adjacent_vertex] == gray)
//; /* This is loop. Not sure what to do... */
}
colors[current_vertex] = black;
**result_ptr = current_vertex;

View File

@@ -71,7 +71,7 @@ rule init ( version ? : command * : options * )
SPACE = " " ;
# Declare flags and action for compilation.
toolset.flags clang-linux.compile OPTIONS <optimization>off : -O0 ;
toolset.flags clang-linux.compile OPTIONS <optimization>off : ;
toolset.flags clang-linux.compile OPTIONS <optimization>speed : -O3 ;
toolset.flags clang-linux.compile OPTIONS <optimization>space : -Os ;
@@ -85,7 +85,7 @@ toolset.flags clang-linux.compile OPTIONS <warnings>all : -Wall -pedantic ;
toolset.flags clang-linux.compile OPTIONS <warnings-as-errors>on : -Werror ;
toolset.flags clang-linux.compile OPTIONS <debug-symbols>on : -g ;
toolset.flags clang-linux.compile OPTIONS <profiling>on : -pg ;
toolset.flags clang-linux.compile OPTIONS <profiling>on : ;
toolset.flags clang-linux.compile OPTIONS <rtti>off : -fno-rtti ;
rule compile.c++ ( targets * : sources * : properties * )