Repository: kudu
Updated Branches:
  refs/heads/master a29871f30 -> 3e659dcd9


KUDU-1870: Fix Boost build to respect CC/CXX

Boost doesn't respect the CC/CXX environment variables, but
they may have been set in the Kudu build environment. This
fixes this issue by configuring Boost's compiler using the
CC/CXX flags if they were set.

Testing:
- Ran thirdparty build locally, including for tsan. Checked
  that gcc/clang appeared to be set appropriately.
- Ran Impala's toolchain build with this change, verifying
  the toolchain compiler in CC/CXX was used.

Change-Id: I67002e074a67a3a83b8a96167906dbffe2db9522
Reviewed-on: http://gerrit.cloudera.org:8080/5986
Reviewed-by: Adar Dembo <[email protected]>
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/3e659dcd
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/3e659dcd
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/3e659dcd

Branch: refs/heads/master
Commit: 3e659dcd914adfbdc544b083dfd1e0686b9018c4
Parents: a29871f
Author: Matthew Jacobs <[email protected]>
Authored: Mon Feb 13 14:33:06 2017 -0800
Committer: Todd Lipcon <[email protected]>
Committed: Tue Feb 14 22:09:40 2017 +0000

----------------------------------------------------------------------
 thirdparty/build-definitions.sh | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/3e659dcd/thirdparty/build-definitions.sh
----------------------------------------------------------------------
diff --git a/thirdparty/build-definitions.sh b/thirdparty/build-definitions.sh
index 270d0e6..d33739b 100644
--- a/thirdparty/build-definitions.sh
+++ b/thirdparty/build-definitions.sh
@@ -663,18 +663,10 @@ build_boost() {
   BOOST_CXXFLAGS="$EXTRA_CXXFLAGS -fPIC 
-DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG"
   BOOST_LDFLAGS="$EXTRA_LDFLAGS"
 
-
   case $BUILD_TYPE in
     "normal")
-      # Default: use the default toolset.
       ;;
     "tsan")
-      # We're using a custom clang, so we specify its path in the jamfile.
-      echo "using clang : : $CXX ;" > $USER_JAMFILE
-      echo "User jamfile location: $USER_JAMFILE"
-      echo "User jamfile contents:"
-      cat $USER_JAMFILE
-      TOOLSET="toolset=clang"
       BOOST_LDFLAGS="-stdlib=libc++ $BOOST_LDFLAGS"
       ;;
     *)
@@ -683,6 +675,21 @@ build_boost() {
       ;;
   esac
 
+  # If CC and CXX are set, set the compiler in user-config.jam.
+  if [ -n "$CC" -a -n "$CXX" ]; then
+    # Determine the name of the compiler referenced in $CC. This assumes the 
compiler
+    # prints its name as the first word of the first line, which appears to 
work for gcc
+    # and clang, even when they're called through ccache.
+    local COMPILER=$($CC --version | awk 'NR==1 {print $1;}')
+
+    TOOLSET="toolset=${COMPILER}"
+    echo "Using $TOOLSET"
+    echo "using ${COMPILER} : : $CXX ;" > $USER_JAMFILE
+    echo "User jamfile location: $USER_JAMFILE"
+    echo "User jamfile contents:"
+    cat $USER_JAMFILE
+  fi
+
   # Build the date_time boost lib.
   ./bootstrap.sh --prefix=$PREFIX threading=multi --with-libraries=date_time
   ./b2 clean $TOOLSET --build-dir="$BOOST_BDIR"

Reply via email to