kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danburk...@apache.org
Subject [9/9] incubator-kudu git commit: Enable C++11
Date Wed, 13 Jan 2016 17:18:24 GMT
Enable C++11

This is a rollup of changes necessary to move Kudu to C++11.
Component changes have been individually reviewed, as follows:

-----------------------------------------------------------------------

Enable Red Hat devtoolset in RHEL 6 Environments

We are moving to C++11 in the near future, and will require a C++11 compatible
compiler on all suported platforms. Since the RHEL 6 system compiler (GCC 4.4)
does not support C++11, we need an alternate. The Red Hat devtoolset provides a
toolchain with GCC 4.9. Libraries (such as libkudu_client.so) which are compiled
with the Red Hat devtoolset toolchain automatically statically link portions of
the standard library which are new for C++11. This will allow us to take
advantage of C++11 features in the client, but still remain compatible with
stock RHEL 6 systems.

This commit modifies the Jenkins build and test scripts to take advantage of the
devtoolset toolchain, hides the std library symbols that the devtoolset
links into library objects, and adds the devtoolset location to the default gcc
toolchain search paths for the thirdparty LLVM compiler. Additionally, since a
system compiler which supports C++11 can now be assumed, the precompiled clang
compiler is no longer a dependency on Linux and has been removed.

Change Id: I5505911044aa9fda8fb5010c6fe446c8f5c5616e

Build thirdparty clang with system compiler

We build LLVM 3.4.2 in thirdparty, but it requires a c++11 compiler to build.
Now that we require the system compiler to be c++11 compatible, we no longer
need the bootstrapping compiler.

Change Id: I4800d9eec0a566bcf71c59abdeae6a6d8b6cb40a
http://gerrit.cloudera.org:8080/1476

-----------------------------------------------------------------------

Enable C++11

Change Id: Ia9463b46428450e1a29c1684d47b46f96bf965cb
http://gerrit.cloudera.org:8080/#/c/1466

-----------------------------------------------------------------------

C++11: replace list_of with initializer lists

Change Id: I0d258e35a38be3a47854e51bd110dc07f05bdd3f
http://gerrit.cloudera.org:8080/#/c/1467

-----------------------------------------------------------------------

Replace boost::tuple with std::tuple

Change Id: Ia258a1833a4ae3509a3781717386324fdd63ef88
http://gerrit.cloudera.org:8080/#/c/1468

-----------------------------------------------------------------------

C++11: replace util::gtl::is_sorted with std::is_sorted

Change Id: Ifc51c4519c5c055aa62887fc6dcc1836572102f5
http://gerrit.cloudera.org:8080/#/c/1470

-----------------------------------------------------------------------

C++11: remove tr1

Change Id: I6c5559f9d14860fd568f86809377d94e5e1d3e6e
http://gerrit.cloudera.org:8080/#/c/1472

-----------------------------------------------------------------------

Add kudu::client::sp::shared_ptr as public shared pointer type

Change Id: I02d1c3691294f82498b9dfd25253cfca0b196dda
http://gerrit.cloudera.org:8080/#/c/1473

-----------------------------------------------------------------------

Replace gnu_cxx::hash with std::hash

gnu_cxx::hash is obsolete since c++11 introduced std::hash.

Change Id: Ic7e6af40cf8e6ca5069ad0185d4c136c4793fc31
http://gerrit.cloudera.org:8080/#/c/1477

-----------------------------------------------------------------------

Add OS X search paths when compiling with thirdparty clang

Change Id: I56051b321c9c9d3a1a521b4188e47961f64acd50
http://gerrit.cloudera.org:8080/#/c/1478

-----------------------------------------------------------------------

Replace boost::unique_lock with std::unique_lock

These particular uses of boost locks were failing to compile on Centos6 because
the system boost version is buggy when compiling with move semantics.

Change Id: I424077b29ac2ae10761df4afb12f554213c049be
http://gerrit.cloudera.org:8080/#/c/1479

-----------------------------------------------------------------------

Replace boost::shared_lock with kudu::shared_lock in WriteTransaction

The Boost shared_lock implementation distributed with Centos6 does not compile
with move semantics (specifically the operator= method). std::shared_lock is not
available till c++14.

Change Id: Icd42e3cb88f8c5e5d992d3f0d0324b6c9f81d915
http://gerrit.cloudera.org:8080/#/c/1480

-----------------------------------------------------------------------

Update mem tracker allocator for libc++ compatibility

The unordered_map type in libc++ is finicky about custom allocators.

Change Id: I8ca226abb2c7e3ca95c68533979e97dea4552b63
http://gerrit.cloudera.org:8080/#/c/1481

-----------------------------------------------------------------------

Update thirdparty llvm from 3.4 to 3.7

This updates our thirdparty LLVM version from 3.4 to 3.7. Major changes:

* ASAN and TSAN builds now use the thirdparty clang instead of the bootstrapping
  clang toolchain. The clang toolchain has been removed from the build process.
* Python 2.7 is now built in thirdparty on systems which have a different system
  Python version. Python 2.7 is a build dependency of LLVM 3.6+.
* Updated LLVM API calls in the codegen module.

Change Id: I9023dd138373bb580892877e437b9199b690bde3
http://gerrit.cloudera.org:8080/#/c/1572

-----------------------------------------------------------------------

Build instrumented thirdparty with libstdc++ in TSAN mode

The new c++11 toolchain is more sensitive to TSAN issues in the standard
library. This commit adds a TSAN instrumented libstdcxx 4.9.3 to the thirdparty
build when building with TSAN.

Change Id: I2157469910c38b6e1c750e431c564e7d2f7b7e58
http://gerrit.cloudera.org:8080/#/c/1657

-----------------------------------------------------------------------

Update YCM config for c++11

Change Id: I64b24b148d19fe3b0fa0acd655f081143118b191
http://gerrit.cloudera.org:8080/#/c/1658

-----------------------------------------------------------------------

Remove import of macos mach-o/loader.h from gutil/port.h

The llvm/Support/MachO.h header redefines constants as enum variants using the
same identifier as macro constants declared in the mach-o/loader.h system
header. This causes issues when macho-o/loader.h is included before the LLVM
header.

This commit removes the reliance on mach-o/loader.h in gutil/port.h by removing
some unused macros for working with attribute sections in binaries. The solution
is not perfect, since the system header may be necessary in the future, but hopefully
by then a fix will have landed in upstream LLVM
(https://llvm.org/bugs/show_bug.cgi?id=25871).

Change Id: Ib41ee2b53f39589d48622a12378a51e1a49c74bb
http://gerrit.cloudera.org:8080/#/c/1592

-----------------------------------------------------------------------

C++11: Simplify thirdparty TSAN build

This commit addresses Adar's feedback on the C++11 patch. TSAN instrumented
dependencies are now always built on Linux and installed into an alternate
prefix. This commit will be squashed into the C++11 mega patch prior to
submission.

The thirdparty directory now includes three prefixes: thirdparty/installed for
tools and C-only libraries, thirdparty/installed-deps for C++ dependencies, and
thirdparty/installed-deps-tsan for C++ dependencies for TSAN builds. Keeping the
prefixes seperate allows us to not require rebuilding thirdparty when switching
to or from a TSAN instrumented build.

Change Id: I5e9824db19383556da88053779bdde1e66cdfa44

-----------------------------------------------------------------------

Change-Id: Ic52cbf98f583a3a953b1910e0017a8af448660d7
Reviewed-on: http://gerrit.cloudera.org:8080/1687
Reviewed-by: Dan Burkert <dan@cloudera.com>
Tested-by: Dan Burkert <dan@cloudera.com>


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

Branch: refs/heads/master
Commit: 9806863e78107505a622b44112a897189d9b3c24
Parents: 815b02d
Author: Dan Burkert <dan@cloudera.com>
Authored: Mon Nov 30 12:15:36 2015 -0800
Committer: Dan Burkert <dan@cloudera.com>
Committed: Wed Jan 13 16:49:49 2016 +0000

----------------------------------------------------------------------
 .ycm_extra_conf.py                              |   3 +-
 CMakeLists.txt                                  |  28 +-
 README.adoc                                     |  17 +-
 build-support/enable_devtoolset.sh              |  24 +-
 build-support/jenkins/build-and-test.sh         |  19 +-
 build-support/lint.sh                           |   2 +-
 .../kudu-lint/cmake_modules/FindLLVM.cmake      |  19 +-
 build-support/tsan-suppressions.txt             |   4 +
 cmake_modules/FindBitshuffle.cmake              |  58 +--
 cmake_modules/FindCrcutil.cmake                 |  66 +--
 cmake_modules/FindCyrusSASL.cmake               |  41 +-
 cmake_modules/FindGFlags.cmake                  |  64 +--
 cmake_modules/FindGLog.cmake                    |  62 +--
 cmake_modules/FindGMock.cmake                   |  92 ++---
 cmake_modules/FindGPerf.cmake                   |  81 ++--
 cmake_modules/FindKRPC.cmake                    |   2 +-
 cmake_modules/FindLibEv.cmake                   |  62 +--
 cmake_modules/FindLibUnwind.cmake               |  54 +--
 cmake_modules/FindLz4.cmake                     |  58 +--
 cmake_modules/FindProtobuf.cmake                | 102 ++---
 cmake_modules/FindSnappy.cmake                  |  64 +--
 cmake_modules/FindSqueasel.cmake                |  53 +--
 cmake_modules/FindVmem.cmake                    |  64 +--
 cmake_modules/FindZlib.cmake                    |  62 +--
 java/kudu-client/dev-support/build-proto.sh     |   2 +-
 java/kudu-client/pom.xml                        |   2 +-
 .../benchmarks/tpch/rpc_line_item_dao-test.cc   |   3 +-
 src/kudu/benchmarks/tpch/rpc_line_item_dao.cc   |   7 +-
 src/kudu/benchmarks/tpch/rpc_line_item_dao.h    |   7 +-
 src/kudu/benchmarks/tpch/tpch-schemas.h         |  18 +-
 src/kudu/benchmarks/tpch/tpch1.cc               |   4 +-
 src/kudu/benchmarks/ycsb-schema.h               |   1 -
 src/kudu/cfile/binary_dict_block.h              |   4 +-
 src/kudu/cfile/block_compression.h              |   2 +-
 src/kudu/cfile/bloomfile-test.cc                |   2 +-
 src/kudu/cfile/bloomfile.cc                     |   7 +-
 src/kudu/cfile/cfile-dump.cc                    |   1 -
 src/kudu/cfile/cfile-test.cc                    |   7 +-
 src/kudu/cfile/cfile_util.h                     |   2 +-
 src/kudu/cfile/cfile_writer.h                   |   4 +-
 src/kudu/cfile/type_encodings.cc                |  10 +-
 src/kudu/client/CMakeLists.txt                  |   1 +
 src/kudu/client/batcher.cc                      |  12 +-
 src/kudu/client/batcher.h                       |  13 +-
 src/kudu/client/client-internal.cc              |   2 +-
 src/kudu/client/client-internal.h               |   9 +-
 src/kudu/client/client-test-util.cc             |   2 +-
 src/kudu/client/client-test-util.h              |   5 +-
 src/kudu/client/client-test.cc                  |  24 +-
 src/kudu/client/client-unittest.cc              |  12 +-
 src/kudu/client/client.cc                       |  17 +-
 src/kudu/client/client.h                        |  19 +-
 src/kudu/client/meta_cache.cc                   |   4 +-
 src/kudu/client/meta_cache.h                    |  14 +-
 src/kudu/client/samples/CMakeLists.txt          |   6 -
 src/kudu/client/samples/sample.cc               |   3 +-
 src/kudu/client/scanner-internal.h              |   2 +-
 src/kudu/client/schema.cc                       |   4 +-
 src/kudu/client/session-internal.cc             |   5 +-
 src/kudu/client/session-internal.h              |  13 +-
 src/kudu/client/shared_ptr.h                    |  63 +++
 src/kudu/client/symbols.map                     |  10 +-
 src/kudu/client/table-internal.cc               |   3 +-
 src/kudu/client/table-internal.h                |   4 +-
 src/kudu/client/write_op.cc                     |   4 +-
 src/kudu/client/write_op.h                      |  12 +-
 src/kudu/codegen/CMakeLists.txt                 |  16 +-
 src/kudu/codegen/README                         |   4 +-
 src/kudu/codegen/code_generator.cc              |  48 ++-
 src/kudu/codegen/codegen-test.cc                |  67 +--
 src/kudu/codegen/compilation_manager.cc         |   2 +-
 src/kudu/codegen/jit_wrapper.cc                 |   6 +-
 src/kudu/codegen/jit_wrapper.h                  |   7 +-
 src/kudu/codegen/module_builder.cc              |  46 +--
 src/kudu/codegen/module_builder.h               |   8 +-
 src/kudu/codegen/row_projector.cc               |  28 +-
 src/kudu/codegen/row_projector.h                |   4 +-
 src/kudu/common/encoded_key-test.cc             |  33 +-
 src/kudu/common/generic_iterators-test.cc       |  10 +-
 src/kudu/common/generic_iterators.cc            |   3 +-
 src/kudu/common/generic_iterators.h             |  30 +-
 src/kudu/common/key_encoder.cc                  |  10 +-
 src/kudu/common/partial_row-test.cc             |  10 +-
 src/kudu/common/partition-test.cc               |  37 +-
 src/kudu/common/predicate-test.cc               |   8 +-
 src/kudu/common/predicate_encoder-test.cc       |  19 +-
 src/kudu/common/row.h                           |   8 +-
 src/kudu/common/row_changelist-test.cc          |   1 -
 src/kudu/common/row_key-util-test.cc            |  35 +-
 src/kudu/common/row_operations-test.cc          |  93 ++---
 src/kudu/common/row_operations.h                |   4 +-
 src/kudu/common/schema-test.cc                  | 146 +++----
 src/kudu/common/schema.cc                       |   4 +-
 src/kudu/common/schema.h                        |  25 +-
 src/kudu/common/types.cc                        |  14 +-
 src/kudu/common/wire_protocol-test-util.h       |  10 +-
 src/kudu/common/wire_protocol-test.cc           |  11 +-
 src/kudu/consensus/consensus-test-util.h        |  12 +-
 src/kudu/consensus/consensus.cc                 |   6 +-
 src/kudu/consensus/consensus.h                  |   8 +-
 src/kudu/consensus/consensus_meta-test.cc       |  14 +-
 src/kudu/consensus/consensus_peers.cc           |   5 +-
 src/kudu/consensus/consensus_peers.h            |   8 +-
 src/kudu/consensus/consensus_queue-test.cc      |  11 +-
 src/kudu/consensus/consensus_queue.cc           |   6 +-
 src/kudu/consensus/consensus_queue.h            |   4 +-
 src/kudu/consensus/leader_election-test.cc      |   5 +-
 src/kudu/consensus/leader_election.cc           |   1 -
 src/kudu/consensus/leader_election.h            |   7 +-
 src/kudu/consensus/local_consensus.cc           |   5 +-
 src/kudu/consensus/log-test-base.h              |   9 +-
 src/kudu/consensus/log-test.cc                  |   3 +-
 src/kudu/consensus/log.cc                       |   4 +-
 src/kudu/consensus/log.h                        |  15 +-
 src/kudu/consensus/log_cache-test.cc            |   4 +-
 src/kudu/consensus/log_cache.h                  |   7 +-
 src/kudu/consensus/log_util.cc                  |   8 +-
 src/kudu/consensus/log_util.h                   |  16 +-
 src/kudu/consensus/mt-log-test.cc               |   4 +-
 src/kudu/consensus/peer_manager.h               |   4 +-
 src/kudu/consensus/raft_consensus-test.cc       |   2 +-
 src/kudu/consensus/raft_consensus.cc            |   4 +-
 src/kudu/consensus/raft_consensus.h             |  10 +-
 .../consensus/raft_consensus_quorum-test.cc     |   5 +-
 src/kudu/consensus/raft_consensus_state-test.cc |   2 -
 src/kudu/consensus/raft_consensus_state.cc      |   2 -
 src/kudu/consensus/raft_consensus_state.h       |   2 -
 src/kudu/fs/block_manager-stress-test.cc        |   6 +-
 src/kudu/fs/block_manager-test.cc               |  24 +-
 src/kudu/fs/block_manager.h                     |   4 +-
 src/kudu/fs/block_manager_util-test.cc          |   9 +-
 src/kudu/fs/block_manager_util.cc               |   4 +-
 src/kudu/fs/file_block_manager.cc               |   6 +-
 src/kudu/fs/file_block_manager.h                |   8 +-
 src/kudu/fs/fs_manager-test.cc                  |  22 +-
 src/kudu/fs/fs_manager.cc                       |  27 +-
 src/kudu/fs/fs_manager.h                        |   9 +-
 src/kudu/fs/log_block_manager.cc                |   5 +-
 src/kudu/fs/log_block_manager.h                 |  20 +-
 src/kudu/gutil/algorithm.h                      |  27 --
 src/kudu/gutil/port.h                           | 116 ------
 src/kudu/gutil/stl_util.h                       |  28 +-
 src/kudu/gutil/strings/stringpiece.cc           |  33 +-
 src/kudu/gutil/strings/stringpiece.h            |  20 +-
 src/kudu/gutil/sysinfo.cc                       |   2 -
 src/kudu/integration-tests/all_types-itest.cc   |   6 +-
 .../alter_table-randomized-test.cc              |   8 +-
 src/kudu/integration-tests/alter_table-test.cc  |  27 +-
 .../integration-tests/client-stress-test.cc     |  10 +-
 .../integration-tests/cluster_itest_util.cc     |   4 +-
 src/kudu/integration-tests/cluster_itest_util.h |  18 +-
 src/kudu/integration-tests/cluster_verifier.cc  |  13 +-
 .../integration-tests/create-table-itest.cc     |   2 +-
 .../create-table-stress-test.cc                 |   9 +-
 src/kudu/integration-tests/delete_table-test.cc |   8 +-
 .../external_mini_cluster-itest-base.h          |   7 +-
 .../external_mini_cluster-test.cc               |   3 +-
 .../integration-tests/external_mini_cluster.cc  |  30 +-
 .../integration-tests/external_mini_cluster.h   |  22 +-
 .../flex_partitioning-itest.cc                  |  40 +-
 .../full_stack-insert-scan-test.cc              |  50 +--
 .../integration-tests/linked_list-test-util.h   |  18 +-
 src/kudu/integration-tests/linked_list-test.cc  |   4 +-
 .../integration-tests/master_failover-itest.cc  |  12 +-
 .../master_replication-itest.cc                 |   6 +-
 src/kudu/integration-tests/mini_cluster.cc      |   8 +-
 src/kudu/integration-tests/mini_cluster.h       |  11 +-
 .../integration-tests/raft_consensus-itest.cc   |  67 ++-
 src/kudu/integration-tests/registration-test.cc |   9 +-
 .../integration-tests/remote_bootstrap-itest.cc |   9 +-
 .../tablet_replacement-itest.cc                 |  25 +-
 src/kudu/integration-tests/test_workload.cc     |   2 +-
 src/kudu/integration-tests/test_workload.h      |   2 +-
 src/kudu/integration-tests/ts_itest-base.h      |  11 +-
 src/kudu/integration-tests/ts_recovery-itest.cc |   4 +-
 .../ts_tablet_manager-itest.cc                  |   9 +-
 .../update_scan_delta_compact-test.cc           |   8 +-
 src/kudu/master/catalog_manager.cc              |   7 +-
 src/kudu/master/catalog_manager.h               |  18 +-
 src/kudu/master/master-path-handlers.cc         |   4 +-
 src/kudu/master/master-test-util.h              |   2 -
 src/kudu/master/master-test.cc                  |  32 +-
 src/kudu/master/master.cc                       |   4 +-
 src/kudu/master/master.h                        |   4 +-
 src/kudu/master/master_rpc.cc                   |   2 +-
 src/kudu/master/master_rpc.h                    |   4 +-
 src/kudu/master/master_service.cc               |   8 +-
 src/kudu/master/master_service.h                |   2 -
 src/kudu/master/mini_master.cc                  |   3 +-
 src/kudu/master/sys_catalog-test.cc             |   5 +-
 src/kudu/master/sys_catalog.cc                  |   3 +-
 src/kudu/master/ts_descriptor.cc                |   2 +-
 src/kudu/master/ts_descriptor.h                 |  14 +-
 src/kudu/master/ts_manager.cc                   |   6 +-
 src/kudu/master/ts_manager.h                    |  20 +-
 src/kudu/rpc/acceptor_pool.cc                   |   5 +-
 src/kudu/rpc/acceptor_pool.h                    |   1 -
 src/kudu/rpc/auth_store.cc                      |   2 +-
 src/kudu/rpc/auth_store.h                       |   4 +-
 src/kudu/rpc/connection.cc                      |   2 +-
 src/kudu/rpc/connection.h                       |  12 +-
 src/kudu/rpc/inbound_call.cc                    |   5 +-
 src/kudu/rpc/inbound_call.h                     |   2 -
 src/kudu/rpc/messenger.cc                       |   2 +-
 src/kudu/rpc/messenger.h                        |  16 +-
 src/kudu/rpc/mt-rpc-test.cc                     |   2 +-
 src/kudu/rpc/negotiation.cc                     |   2 +-
 src/kudu/rpc/outbound_call.h                    |   1 -
 src/kudu/rpc/protoc-gen-krpc.cc                 |  11 +-
 src/kudu/rpc/proxy.cc                           |   6 +-
 src/kudu/rpc/proxy.h                            |   6 +-
 src/kudu/rpc/reactor-test.cc                    |   2 +-
 src/kudu/rpc/reactor.cc                         |   2 +-
 src/kudu/rpc/reactor.h                          |  17 +-
 src/kudu/rpc/rpc-bench.cc                       |   2 +-
 src/kudu/rpc/rpc-test-base.h                    |  21 +-
 src/kudu/rpc/rpc-test.cc                        |   7 +-
 src/kudu/rpc/rpc.cc                             |   2 +-
 src/kudu/rpc/rpc.h                              |   9 +-
 src/kudu/rpc/rpc_controller.h                   |   4 +-
 src/kudu/rpc/rpc_stub-test.cc                   |   2 +-
 src/kudu/rpc/sasl_server.cc                     |   9 +-
 src/kudu/rpc/sasl_server.h                      |   3 +-
 src/kudu/rpc/service_pool.cc                    |   5 +-
 src/kudu/rpc/service_pool.h                     |   1 -
 src/kudu/server/default-path-handlers.cc        |  12 +-
 src/kudu/server/generic_service.cc              |   4 +-
 src/kudu/server/rpc_server.cc                   |   8 +-
 src/kudu/server/rpc_server.h                    |   8 +-
 src/kudu/server/rpcz-path-handler.cc            |   9 +-
 src/kudu/server/rpcz-path-handler.h             |   4 +-
 src/kudu/server/server_base.cc                  |   2 +-
 src/kudu/server/server_base.h                   |  10 +-
 src/kudu/server/tracing-path-handlers.cc        |  21 +-
 src/kudu/tablet/cfile_set-test.cc               |  13 +-
 src/kudu/tablet/cfile_set.cc                    |   6 +-
 src/kudu/tablet/cfile_set.h                     |  16 +-
 src/kudu/tablet/compaction-test.cc              |  17 +-
 src/kudu/tablet/compaction.cc                   |  10 +-
 src/kudu/tablet/compaction.h                    |  12 +-
 src/kudu/tablet/compaction_policy-test.cc       |  10 +-
 src/kudu/tablet/compaction_policy.h             |  12 +-
 src/kudu/tablet/composite-pushdown-test.cc      |  12 +-
 src/kudu/tablet/concurrent_btree.h              |   8 +-
 src/kudu/tablet/delta_applier.cc                |   2 +-
 src/kudu/tablet/delta_applier.h                 |  10 +-
 src/kudu/tablet/delta_compaction-test.cc        |   5 +-
 src/kudu/tablet/delta_compaction.cc             |   9 +-
 src/kudu/tablet/delta_compaction.h              |  10 +-
 src/kudu/tablet/delta_iterator_merger.cc        |   2 +-
 src/kudu/tablet/delta_iterator_merger.h         |  10 +-
 src/kudu/tablet/delta_stats.h                   |   4 +-
 src/kudu/tablet/delta_store.cc                  |   4 +-
 src/kudu/tablet/delta_store.h                   |   4 +-
 src/kudu/tablet/delta_tracker.cc                |  18 +-
 src/kudu/tablet/delta_tracker.h                 |  31 +-
 src/kudu/tablet/deltafile-test.cc               |   8 +-
 src/kudu/tablet/deltafile.cc                    |   2 +-
 src/kudu/tablet/deltafile.h                     |  16 +-
 src/kudu/tablet/deltamemstore-test.cc           |  12 +-
 src/kudu/tablet/deltamemstore.cc                |   2 +-
 src/kudu/tablet/deltamemstore.h                 |  21 +-
 src/kudu/tablet/diskrowset-test-base.h          |  16 +-
 src/kudu/tablet/diskrowset-test.cc              |  15 +-
 src/kudu/tablet/diskrowset.cc                   |   3 +-
 src/kudu/tablet/diskrowset.h                    |  24 +-
 src/kudu/tablet/lock_manager-test.cc            |   4 +-
 src/kudu/tablet/maintenance_manager-test.cc     |   9 +-
 src/kudu/tablet/maintenance_manager.cc          |   7 +-
 src/kudu/tablet/maintenance_manager.h           |  10 +-
 src/kudu/tablet/major_delta_compaction-test.cc  |  38 +-
 src/kudu/tablet/memrowset-test.cc               |   5 +-
 src/kudu/tablet/memrowset.cc                    |   4 +-
 src/kudu/tablet/memrowset.h                     |  24 +-
 src/kudu/tablet/metadata-test.cc                |  20 +-
 src/kudu/tablet/mock-rowsets.h                  |   6 +-
 src/kudu/tablet/mt-diskrowset-test.cc           |   8 +-
 .../tablet/mt-rowset_delta_compaction-test.cc   |   5 +-
 src/kudu/tablet/mt-tablet-test.cc               |   8 +-
 src/kudu/tablet/mvcc.h                          |   4 +-
 src/kudu/tablet/rowset.cc                       |   4 +-
 src/kudu/tablet/rowset.h                        |   8 +-
 src/kudu/tablet/rowset_info.cc                  |  12 +-
 src/kudu/tablet/rowset_tree-test.cc             |  11 +-
 src/kudu/tablet/rowset_tree.cc                  |   3 +-
 src/kudu/tablet/rowset_tree.h                   |   1 -
 src/kudu/tablet/svg_dump.cc                     |   6 +-
 src/kudu/tablet/svg_dump.h                      |   4 +-
 src/kudu/tablet/tablet-harness.h                |   8 +-
 src/kudu/tablet/tablet-pushdown-test.cc         |   9 +-
 src/kudu/tablet/tablet-schema-test.cc           |  14 +-
 src/kudu/tablet/tablet-test-base.h              |  37 +-
 src/kudu/tablet/tablet-test-util.h              |  10 +-
 src/kudu/tablet/tablet-test.cc                  |  13 +-
 src/kudu/tablet/tablet.cc                       |  27 +-
 src/kudu/tablet/tablet.h                        |  46 +--
 src/kudu/tablet/tablet_bootstrap-test.cc        |   2 +-
 src/kudu/tablet/tablet_bootstrap.cc             |  31 +-
 src/kudu/tablet/tablet_bootstrap.h              |   6 +-
 src/kudu/tablet/tablet_metadata.cc              |   2 +-
 src/kudu/tablet/tablet_metadata.h               |  12 +-
 src/kudu/tablet/tablet_mm_ops-test.cc           |  29 +-
 src/kudu/tablet/tablet_peer-test.cc             |  10 +-
 src/kudu/tablet/tablet_peer.cc                  |   2 +-
 src/kudu/tablet/tablet_peer.h                   |  12 +-
 src/kudu/tablet/tablet_random_access-test.cc    |   6 +-
 .../transactions/alter_schema_transaction.cc    |   5 +-
 .../transactions/alter_schema_transaction.h     |   5 +-
 .../tablet/transactions/transaction_driver.cc   |   2 +-
 .../transactions/transaction_tracker-test.cc    |   4 +-
 .../tablet/transactions/transaction_tracker.cc  |   2 +-
 .../tablet/transactions/transaction_tracker.h   |  10 +-
 .../tablet/transactions/write_transaction.cc    |   7 +-
 .../tablet/transactions/write_transaction.h     |   4 +-
 src/kudu/tools/create-demo-table.cc             |   9 +-
 src/kudu/tools/fs_dump-tool.cc                  |  29 +-
 src/kudu/tools/fs_list-tool.cc                  |  16 +-
 src/kudu/tools/fs_tool.cc                       |   8 +-
 src/kudu/tools/fs_tool.h                        |  10 +-
 src/kudu/tools/insert-generated-rows.cc         |   6 +-
 src/kudu/tools/ksck-test.cc                     |  33 +-
 src/kudu/tools/ksck.cc                          |  22 +-
 src/kudu/tools/ksck.h                           |  52 +--
 src/kudu/tools/ksck_remote-test.cc              |  19 +-
 src/kudu/tools/ksck_remote.cc                   |   4 +-
 src/kudu/tools/ksck_remote.h                    |  23 +-
 src/kudu/tools/kudu-admin-test.cc               |   8 +-
 src/kudu/tools/kudu-admin.cc                    |   9 +-
 src/kudu/tools/kudu-ksck.cc                     |   2 +-
 src/kudu/tools/ts-cli.cc                        |  28 +-
 src/kudu/tserver/heartbeater.cc                 |   3 +-
 src/kudu/tserver/mini_tablet_server.cc          |   3 +-
 .../tserver/remote_bootstrap_client-test.cc     |   2 +-
 src/kudu/tserver/remote_bootstrap_client.cc     |   3 +-
 src/kudu/tserver/remote_bootstrap_client.h      |   8 +-
 src/kudu/tserver/remote_bootstrap_service.h     |   6 +-
 .../tserver/remote_bootstrap_session-test.cc    |  11 +-
 src/kudu/tserver/remote_bootstrap_session.cc    |  10 +-
 src/kudu/tserver/remote_bootstrap_session.h     |  13 +-
 src/kudu/tserver/scanners.cc                    |   1 -
 src/kudu/tserver/scanners.h                     |  11 +-
 src/kudu/tserver/tablet_peer_lookup.h           |   2 +-
 src/kudu/tserver/tablet_server-test-base.h      |  18 +-
 src/kudu/tserver/tablet_server-test.cc          | 187 ++++-----
 src/kudu/tserver/tablet_server.cc               |   4 +-
 src/kudu/tserver/tablet_server.h                |   6 +-
 src/kudu/tserver/tablet_server_test_util.cc     |   2 +-
 src/kudu/tserver/tablet_server_test_util.h      |   5 +-
 src/kudu/tserver/tablet_service.cc              |   4 +-
 src/kudu/tserver/tablet_service.h               |   8 +-
 src/kudu/tserver/ts_tablet_manager-test.cc      |   7 +-
 src/kudu/tserver/ts_tablet_manager.cc           |   8 +-
 src/kudu/tserver/ts_tablet_manager.h            |  12 +-
 src/kudu/tserver/tserver-path-handlers.cc       |   4 +-
 src/kudu/twitter-demo/ingest_firehose.cc        |   8 +-
 src/kudu/twitter-demo/insert_consumer.cc        |   5 +-
 src/kudu/twitter-demo/insert_consumer.h         |  12 +-
 src/kudu/twitter-demo/twitter-schema.h          |   2 -
 src/kudu/util/atomic-test.cc                    |  10 +-
 src/kudu/util/blocking_queue-test.cc            |   9 +-
 src/kudu/util/blocking_queue.h                  |   6 +-
 src/kudu/util/cache-test.cc                     |   5 +-
 src/kudu/util/cache.cc                          |   4 +-
 src/kudu/util/debug/trace_event_impl.cc         |  10 +-
 src/kudu/util/debug/trace_event_impl.h          |  16 +-
 src/kudu/util/env-test.cc                       |  20 +-
 src/kudu/util/env_posix.cc                      |   8 +-
 src/kudu/util/env_util.cc                       |   4 +-
 src/kudu/util/env_util.h                        |  10 +-
 src/kudu/util/failure_detector.cc               |   4 +-
 src/kudu/util/failure_detector.h                |   8 +-
 src/kudu/util/flag_tags-test.cc                 |   4 +-
 src/kudu/util/flag_tags.cc                      |   4 +-
 src/kudu/util/flag_tags.h                       |   4 +-
 src/kudu/util/flags.cc                          |   4 +-
 src/kudu/util/kernel_stack_watchdog.cc          |   2 -
 src/kudu/util/kernel_stack_watchdog.h           |   4 +-
 src/kudu/util/locks.h                           |  16 +-
 src/kudu/util/logging-test.cc                   |  32 +-
 src/kudu/util/logging_test_util.h               |  60 +++
 src/kudu/util/mem_tracker-test.cc               |  21 +-
 src/kudu/util/mem_tracker.cc                    |   5 +-
 src/kudu/util/mem_tracker.h                     |  45 +-
 src/kudu/util/memcmpable_varint-test.cc         |  13 +-
 src/kudu/util/memenv/memenv-test.cc             |  17 +-
 src/kudu/util/memory/arena-test.cc              |   6 +-
 src/kudu/util/memory/arena.cc                   |   2 +-
 src/kudu/util/memory/arena.h                    |  15 +-
 src/kudu/util/memory/memory.h                   |  29 +-
 src/kudu/util/metrics-test.cc                   |  10 +-
 src/kudu/util/metrics.cc                        |   1 -
 src/kudu/util/metrics.h                         |  12 +-
 src/kudu/util/mt-metrics-test.cc                |   2 -
 src/kudu/util/mt-threadlocal-test.cc            |   4 +-
 src/kudu/util/net/net_util.cc                   |   7 +-
 src/kudu/util/net/sockaddr.h                    |   6 +-
 src/kudu/util/nvm_cache.cc                      |   6 +-
 src/kudu/util/pb_util-test.cc                   |   8 +-
 src/kudu/util/pb_util.cc                        |  14 +-
 src/kudu/util/pstack_watcher-test.cc            |   4 +-
 src/kudu/util/pstack_watcher.cc                 |   4 +-
 src/kudu/util/shared_ptr_util.h                 |  36 --
 src/kudu/util/striped64-test.cc                 |   2 +-
 src/kudu/util/subprocess.cc                     |  12 +-
 src/kudu/util/sync_point.h                      |  10 +-
 src/kudu/util/test_graph.cc                     |   2 +-
 src/kudu/util/test_graph.h                      |   8 +-
 src/kudu/util/thread.cc                         |   6 +-
 src/kudu/util/threadpool-test.cc                |   6 +-
 src/kudu/util/threadpool.cc                     |   4 +-
 src/kudu/util/threadpool.h                      |  11 +-
 thirdparty/.gitignore                           |   4 +
 thirdparty/build-definitions.sh                 | 309 ++++++++++++++
 thirdparty/build-if-necessary.sh                |   1 -
 thirdparty/build-thirdparty.sh                  | 414 +++++++++----------
 thirdparty/download-thirdparty.sh               |  24 +-
 .../patches/llvm-devtoolset-toolchain.patch     |  16 +
 thirdparty/patches/llvm-fix-amazon-linux.patch  |  35 +-
 thirdparty/patches/llvm-fix-jit-debugging.patch |  25 --
 .../llvm-stop-including-msan_interface.patch    |  63 ---
 thirdparty/vars.sh                              |  31 +-
 421 files changed, 2943 insertions(+), 3656 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/.ycm_extra_conf.py
----------------------------------------------------------------------
diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py
index 38d2071..e453734 100644
--- a/.ycm_extra_conf.py
+++ b/.ycm_extra_conf.py
@@ -58,10 +58,9 @@ flags = [
 '-g',
 '-ggdb',
 '-fPIC',
-'-Wno-c++11-extensions',
 '-Qunused-arguments',
 '-Wno-ambiguous-member-template',
-'-stdlib=libstdc++',
+'-std=c++11',
 '-I',
 'src',
 '-isystem',

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 90ea9c9..f803da7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -159,12 +159,6 @@ set(CMAKE_CXX_FLAGS "${CXX_COMMON_FLAGS} ${CMAKE_CXX_FLAGS}")
 include(CompilerInfo)
 
 if ("${COMPILER_FAMILY}" STREQUAL "clang")
-  # Clang helpfully provides a few extensions from C++11 such as the 'override'
-  # keyword on methods. This doesn't change behavior, and we selectively enable
-  # it in src/gutil/port.h only on clang. So, we can safely use it, and don't want
-  # to trigger warnings when we do so.
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-extensions")
-
   # Using Clang with ccache causes a bunch of spurious warnings that are
   # purportedly fixed in the next version of ccache. See the following for details:
   #
@@ -187,10 +181,6 @@ if ("${COMPILER_FAMILY}" STREQUAL "clang")
   else()
     message("Running without a controlling terminal or in a dumb terminal")
   endif()
-
-  # Use libstdc++ and not libc++. The latter lacks support for tr1 in OSX
-  # and since 10.9 is now the default.
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
 endif()
 
 # Sanity check linking option.
@@ -241,6 +231,7 @@ endif()
 
 # For any C code, use the same flags.
 set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 
 # Flag to enable clang undefined behavior sanitizer
 # We explicitly don't enable all of the sanitizer flags:
@@ -275,7 +266,9 @@ if (${KUDU_USE_TSAN})
   add_definitions("-D_GLIBCXX_EXTERN_TEMPLATE=0")
 
   # Some of the above also need to be passed to the linker.
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=thread")
+  set(TSAN_LIB_DIR "${CMAKE_SOURCE_DIR}/thirdparty/installed-deps-tsan/gcc/lib")
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,${TSAN_LIB_DIR} -fsanitize=thread")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${TSAN_LIB_DIR}")
 
   # Strictly speaking, TSAN doesn't require dynamic linking. But it does
   # require all code to be position independent, and the easiest way to
@@ -638,9 +631,14 @@ function(ADD_THIRDPARTY_LIB LIB_NAME)
   endif()
 endfunction()
 
-# Look in thirdparty/installed before anywhere else for system dependencies.
+# Look in thirdparty prefix paths before anywhere else for system dependencies.
 set(THIRDPARTY_PREFIX ${CMAKE_SOURCE_DIR}/thirdparty/installed)
-set(CMAKE_PREFIX_PATH ${THIRDPARTY_PREFIX})
+set(CMAKE_PREFIX_PATH ${THIRDPARTY_PREFIX} ${CMAKE_PREFIX_PATH})
+if (${KUDU_USE_TSAN})
+  set(CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/thirdparty/installed-deps-tsan ${CMAKE_PREFIX_PATH})
+else()
+  set(CMAKE_PREFIX_PATH ${CMAKE_SOURCE_DIR}/thirdparty/installed-deps ${CMAKE_PREFIX_PATH})
+endif()
 
 ## Cyrus SASL
 find_package(CyrusSASL REQUIRED)
@@ -686,11 +684,11 @@ ADD_THIRDPARTY_LIB(gmock
 ## Protobuf
 set(PROTO_SRC_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/src)
 set(PROTO_DST_ROOT ${CMAKE_CURRENT_BINARY_DIR}/src)
-find_package( Protobuf REQUIRED )
+find_package(Protobuf REQUIRED)
 include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR})
 ADD_THIRDPARTY_LIB(protobuf
   STATIC_LIB "${PROTOBUF_STATIC_LIBRARY}"
-  SHARED_LIB "${PROTOBUF_LIBRARY}")
+  SHARED_LIB "${PROTOBUF_SHARED_LIBRARY}")
 ADD_THIRDPARTY_LIB(protoc
   STATIC_LIB "${PROTOBUF_PROTOC_STATIC_LIBRARY}"
   SHARED_LIB "${PROTOBUF_PROTOC_LIBRARY}"

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/README.adoc
----------------------------------------------------------------------
diff --git a/README.adoc b/README.adoc
index 7f03ac7..c24a731 100644
--- a/README.adoc
+++ b/README.adoc
@@ -166,9 +166,20 @@ limited utility.
 
 === Running tests with ThreadSanitizer enabled
 
-ThreadSanitizer (TSAN) is a clang feature which can detect improperly synchronized access to data
-along with many other threading bugs. To enable TSAN, pass `-DKUDU_USE_TSAN=1` to the `cmake`
-invocation, recompile, and run tests.
+ThreadSanitizer (TSAN) is a feature of recent Clang and GCC compilers which can
+detect improperly synchronized access to data along with many other threading
+bugs. To enable TSAN, pass `-DKUDU_USE_TSAN=1` to the `cmake` invocation,
+recompile, and run tests. For example:
+
+[source,bash]
+----
+$ rm -Rf CMakeCache.txt CMakeFiles/
+$ CC=$(pwd)/thirdparty/clang-toolchain/bin/clang \
+    CXX=$(pwd)/thirdparty/clang-toolchain/bin/clang++ \
+    cmake -DKUDU_USE_TSAN=1 .
+$ make -j8
+$ ctest -j8
+----
 
 . Enabling TSAN supressions while running tests
 [NOTE]

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/build-support/enable_devtoolset.sh
----------------------------------------------------------------------
diff --git a/build-support/enable_devtoolset.sh b/build-support/enable_devtoolset.sh
index 95cdbf5..f600188 100755
--- a/build-support/enable_devtoolset.sh
+++ b/build-support/enable_devtoolset.sh
@@ -1,17 +1,21 @@
 #!/bin/bash
-# Copyright 2015 Cloudera, Inc.
 #
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
 #
-#     http://www.apache.org/licenses/LICENSE-2.0
+#   http://www.apache.org/licenses/LICENSE-2.0
 #
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
 
 set -e
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/build-support/jenkins/build-and-test.sh
----------------------------------------------------------------------
diff --git a/build-support/jenkins/build-and-test.sh b/build-support/jenkins/build-and-test.sh
index dced1d3..4330b09 100755
--- a/build-support/jenkins/build-and-test.sh
+++ b/build-support/jenkins/build-and-test.sh
@@ -79,9 +79,10 @@ BUILD_TYPE=$(echo "$BUILD_TYPE" | tr a-z A-Z) # capitalize
 DEFAULT_ALLOW_SLOW_TESTS=1
 
 # TSAN builds are pretty slow, so don't do SLOW tests unless explicitly
-# requested
+# requested. Setting KUDU_USE_TSAN influences the thirdparty build.
 if [ "$BUILD_TYPE" = "TSAN" ]; then
   DEFAULT_ALLOW_SLOW_TESTS=0
+  export KUDU_USE_TSAN=1
 fi
 
 export KUDU_FLAKY_TEST_ATTEMPTS=${KUDU_FLAKY_TEST_ATTEMPTS:-1}
@@ -135,7 +136,7 @@ if [ -d "$TOOLCHAIN_DIR" ]; then
   PATH=$TOOLCHAIN_DIR/apache-maven-3.0/bin:$PATH
 fi
 
-thirdparty/build-if-necessary.sh
+$ROOT/build-support/enable_devtoolset.sh thirdparty/build-if-necessary.sh
 
 THIRDPARTY_BIN=$(pwd)/thirdparty/installed/bin
 export PPROF_PATH=$THIRDPARTY_BIN/pprof
@@ -147,13 +148,13 @@ CLANG=$(pwd)/thirdparty/clang-toolchain/bin/clang
 # ASAN/TSAN can't build the Python bindings because the exported Kudu client
 # library (which the bindings depend on) is missing ASAN/TSAN symbols.
 if [ "$BUILD_TYPE" = "ASAN" ]; then
-  CC=$CLANG CXX=$CLANG++ \
-   $THIRDPARTY_BIN/cmake -DKUDU_USE_ASAN=1 -DKUDU_USE_UBSAN=1 .
+  $ROOT/build-support/enable_devtoolset.sh \
+    "CC=$CLANG CXX=$CLANG++ $THIRDPARTY_BIN/cmake -DKUDU_USE_ASAN=1 -DKUDU_USE_UBSAN=1 ."
   BUILD_TYPE=fastdebug
   BUILD_PYTHON=0
 elif [ "$BUILD_TYPE" = "TSAN" ]; then
-  CC=$CLANG CXX=$CLANG++ \
-   $THIRDPARTY_BIN/cmake -DKUDU_USE_TSAN=1 .
+  $ROOT/build-support/enable_devtoolset.sh \
+    "CC=$CLANG CXX=$CLANG++ $THIRDPARTY_BIN/cmake -DKUDU_USE_TSAN=1"
   BUILD_TYPE=fastdebug
   EXTRA_TEST_FLAGS="$EXTRA_TEST_FLAGS -LE no_tsan"
   BUILD_PYTHON=0
@@ -165,7 +166,7 @@ elif [ "$BUILD_TYPE" = "LEAKCHECK" ]; then
 elif [ "$BUILD_TYPE" = "COVERAGE" ]; then
   DO_COVERAGE=1
   BUILD_TYPE=debug
-  $THIRDPARTY_BIN/cmake -DKUDU_GENERATE_COVERAGE=1 .
+  $ROOT/build-support/enable_devtoolset.sh "$THIRDPARTY_BIN/cmake -DKUDU_GENERATE_COVERAGE=1 ."
   # Reset coverage info from previous runs
   find src -name \*.gcda -o -name \*.gcno -exec rm {} \;
 elif [ "$BUILD_TYPE" = "LINT" ]; then
@@ -174,7 +175,7 @@ elif [ "$BUILD_TYPE" = "LINT" ]; then
   mkdir -p Testing/Temporary
   mkdir -p $TEST_LOGDIR
 
-  $THIRDPARTY_BIN/cmake .
+  $ROOT/build-support/enable_devtoolset.sh "$THIRDPARTY_BIN/cmake ."
   make lint | tee $TEST_LOGDIR/lint.log
   exit $?
 fi
@@ -202,7 +203,7 @@ if [ "$KUDU_FLAKY_TEST_ATTEMPTS" -gt 1 ]; then
   fi
 fi
 
-$THIRDPARTY_BIN/cmake . -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
+$ROOT/build-support/enable_devtoolset.sh "$THIRDPARTY_BIN/cmake . -DCMAKE_BUILD_TYPE=${BUILD_TYPE}"
 
 # our tests leave lots of data lying around, clean up before we run
 make clean

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/build-support/lint.sh
----------------------------------------------------------------------
diff --git a/build-support/lint.sh b/build-support/lint.sh
index 5d43fb8..180491e 100755
--- a/build-support/lint.sh
+++ b/build-support/lint.sh
@@ -51,7 +51,7 @@ cd $ROOT
 
 $ROOT/thirdparty/installed/bin/cpplint.py \
   --verbose=4 \
-  --filter=-whitespace/comments,-readability/todo,-build/header_guard,-build/include_order,-legal/copyright \
+  --filter=-whitespace/comments,-readability/todo,-build/header_guard,-build/include_order,-legal/copyright,-build/c++11 \
   $FILES 2>&1 | grep -v 'Done processing' | tee $TMP
 
 NUM_ERRORS=$(grep "Total errors found" $TMP | awk '{print $4}')

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/build-support/tools/kudu-lint/cmake_modules/FindLLVM.cmake
----------------------------------------------------------------------
diff --git a/build-support/tools/kudu-lint/cmake_modules/FindLLVM.cmake b/build-support/tools/kudu-lint/cmake_modules/FindLLVM.cmake
index a6c18e8..346e89a 100644
--- a/build-support/tools/kudu-lint/cmake_modules/FindLLVM.cmake
+++ b/build-support/tools/kudu-lint/cmake_modules/FindLLVM.cmake
@@ -28,13 +28,9 @@ if(NOT DEFINED CLANG_ROOT)
   set(CLANG_ROOT $ENV{CLANG_ROOT})
 endif()
 
-foreach(prog_name llvm-config llvm-config-3.4)
-  find_program(LLVM_CONFIG_EXECUTABLE ${prog_name} DOC "${prog_name} executable"
-    HINTS ${CLANG_ROOT}/bin)
-  if(LLVM_CONFIG_EXECUTABLE)
-    break()
-  endif()
-endforeach(prog_name)
+find_program(LLVM_CONFIG_EXECUTABLE llvm-config
+  DOC "llvm-config executable"
+  HINTS ${CLANG_ROOT}/bin)
 
 if(LLVM_CONFIG_EXECUTABLE)
   message(STATUS "LLVM llvm-config found at: ${LLVM_CONFIG_EXECUTABLE}")
@@ -48,11 +44,8 @@ execute_process(
   OUTPUT_STRIP_TRAILING_WHITESPACE
 )
 
-string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*" "\\1" LLVM_VERSION_MAJOR
-	     "${LLVM_VERSION}")
-
-string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*" "\\2" LLVM_VERSION_MINOR
-	     "${LLVM_VERSION}")
+string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*" "\\1" LLVM_VERSION_MAJOR ${LLVM_VERSION})
+string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*" "\\2" LLVM_VERSION_MINOR ${LLVM_VERSION})
 
 execute_process(
   COMMAND ${LLVM_CONFIG_EXECUTABLE} --includedir
@@ -82,6 +75,6 @@ execute_process(
   COMMAND ${LLVM_CONFIG_EXECUTABLE} --libs ${LLVM_FIND_COMPONENTS}
   OUTPUT_VARIABLE LLVM_LIBS
   OUTPUT_STRIP_TRAILING_WHITESPACE
-  )
+)
 
 set(LLVM_FOUND TRUE)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/build-support/tsan-suppressions.txt
----------------------------------------------------------------------
diff --git a/build-support/tsan-suppressions.txt b/build-support/tsan-suppressions.txt
index cefe270..a833cd9 100644
--- a/build-support/tsan-suppressions.txt
+++ b/build-support/tsan-suppressions.txt
@@ -77,7 +77,11 @@ race:boost::uuids::detail::seed_rng::sha1_random_digest_
 # suppression.
 # ------------------------------------------------------------
 
+# KUDU-1283: TSAN warning from consensus OpId
+race:kudu::consensus::OpId::CopyFrom
+
 # KUDU-186: sketchy synchronization in catalog manager
+race:kudu::master::CatalogManager::Shutdown
 race:kudu::master::CatalogManagerBgTasks::Shutdown
 race:kudu::master::CatalogManager::~CatalogManager
 

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindBitshuffle.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindBitshuffle.cmake b/cmake_modules/FindBitshuffle.cmake
index 11e9340..ed9b04d 100644
--- a/cmake_modules/FindBitshuffle.cmake
+++ b/cmake_modules/FindBitshuffle.cmake
@@ -1,56 +1,18 @@
 # - Find Bitshuffle (bitshuffle.h, bitshuffle.a)
 # This module defines
 #  BITSHUFFLE_INCLUDE_DIR, directory containing headers
-#  BITSHUFFLE_LIBS, directory containing bitshuffle libraries
-#  BITSHUFFLE_STATIC_LIB, path to bitshuffle.a
+#  BITSHUFFLE_STATIC_LIB, path to bitshuffle's static library
 #  BITSHUFFLE_FOUND, whether bitshuffle has been found
 
-set(BITSHUFFLE_SEARCH_HEADER_PATHS
-  ${THIRDPARTY_PREFIX}/include
-)
-
-set(BITSHUFFLE_SEARCH_LIB_PATH
-  ${THIRDPARTY_PREFIX}/lib
-)
-
-find_path(BITSHUFFLE_INCLUDE_DIR bitshuffle.h PATHS
-  ${BITSHUFFLE_SEARCH_HEADER_PATHS}
+find_path(BITSHUFFLE_INCLUDE_DIR bitshuffle.h
   # make sure we don't accidentally pick up a different version
-  NO_DEFAULT_PATH
-)
-
-find_library(BITSHUFFLE_LIB_PATH
- NAMES bitshuffle.a
- PATHS ${BITSHUFFLE_SEARCH_LIB_PATH}
- NO_DEFAULT_PATH)
-
-if (BITSHUFFLE_INCLUDE_DIR AND BITSHUFFLE_LIB_PATH)
-  set(BITSHUFFLE_FOUND TRUE)
-  set(BITSHUFFLE_LIBS ${BITSHUFFLE_SEARCH_LIB_PATH})
-  set(BITSHUFFLE_STATIC_LIB ${BITSHUFFLE_SEARCH_LIB_PATH}/bitshuffle.a)
-else ()
-  set(BITSHUFFLE_FOUND FALSE)
-endif ()
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
 
-if (BITSHUFFLE_FOUND)
-  if (NOT Bitshuffle_FIND_QUIETLY)
-    message(STATUS "Found the Bitshuffle library: ${BITSHUFFLE_LIB_PATH}")
-  endif ()
-else ()
-  if (NOT Bitshuffle_FIND_QUIETLY)
-    set(BITSHUFFLE_ERR_MSG "Could not find the Bitshuffle library. Looked for headers")
-    set(BITSHUFFLE_ERR_MSG "${BITSHUFFLE_ERR_MSG} in ${BITSHUFFLE_SEARCH_HEADER_PATHS}, and for libs")
-    set(BITSHUFFLE_ERR_MSG "${BITSHUFFLE_ERR_MSG} in ${BITSHUFFLE_SEARCH_LIB_PATH}")
-    if (Bitshuffle_FIND_REQUIRED)
-      message(FATAL_ERROR "${BITSHUFFLE_ERR_MSG}")
-    else (Bitshuffle_FIND_REQUIRED)
-      message(STATUS "${BITSHUFFLE_ERR_MSG}")
-    endif (Bitshuffle_FIND_REQUIRED)
-  endif ()
-endif ()
+find_library(BITSHUFFLE_STATIC_LIB bitshuffle.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
 
-mark_as_advanced(
-  BITSHUFFLE_INCLUDE_DIR
-  BITSHUFFLE_LIBS
-  BITSHUFFLE_STATIC_LIB
-)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(BITSHUFFLE REQUIRED_VARS
+  BITSHUFFLE_STATIC_LIB BITSHUFFLE_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindCrcutil.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindCrcutil.cmake b/cmake_modules/FindCrcutil.cmake
index 60172e1..6d93a9a 100644
--- a/cmake_modules/FindCrcutil.cmake
+++ b/cmake_modules/FindCrcutil.cmake
@@ -1,60 +1,20 @@
 # - Find CRCUTIL (crcutil/include.h, libcrcutil.a)
 # This module defines
 #  CRCUTIL_INCLUDE_DIR, directory containing headers
-#  CRCUTIL_LIBS, directory containing crcutil libraries
-#  CRCUTIL_STATIC_LIB, path to libcrcutil.a
 #  CRCUTIL_SHARED_LIB, path to libcrcutil's shared library
+#  CRCUTIL_STATIC_LIB, path to libcrcutil's static library
 #  CRCUTIL_FOUND, whether crcutil has been found
 
-set(CRCUTIL_SEARCH_HEADER_PATHS
-  ${THIRDPARTY_PREFIX}/include
-)
-
-set(CRCUTIL_SEARCH_LIB_PATH
-  ${THIRDPARTY_PREFIX}/lib
-)
-
 find_path(CRCUTIL_INCLUDE_DIR crcutil/interface.h
-  PATHS ${CRCUTIL_SEARCH_HEADER_PATHS}
-  NO_DEFAULT_PATH)
-
-find_library(CRCUTIL_LIB_PATH
-  NAMES crcutil
-  PATHS ${CRCUTIL_SEARCH_LIB_PATH}
-  NO_DEFAULT_PATH)
-
-if (CRCUTIL_INCLUDE_DIR AND CRCUTIL_LIB_PATH)
-  set(CRCUTIL_FOUND TRUE)
-  set(CRCUTIL_LIBS ${CRCUTIL_SEARCH_LIB_PATH})
-  set(CRCUTIL_LIB_NAME libcrcutil)
-  set(CRCUTIL_STATIC_LIB ${CRCUTIL_SEARCH_LIB_PATH}/${CRCUTIL_LIB_NAME}.a)
-  set(CRCUTIL_SHARED_LIB
-      ${CRCUTIL_SEARCH_LIB_PATH}/${CRCUTIL_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
-else ()
-  set(CRCUTIL_FOUND FALSE)
-endif ()
-
-if (CRCUTIL_FOUND)
-  if (NOT Crcutil_FIND_QUIETLY)
-    message(STATUS "Found the crcutil library: ${CRCUTIL_LIB_PATH}")
-  endif ()
-else ()
-  if (NOT Crcutil_FIND_QUIETLY)
-    set(CRCUTIL_ERR_MSG "Could not find the Crcutil library. Looked for headers")
-    set(CRCUTIL_ERR_MSG "${CRCUTIL_ERR_MSG} in ${CRCUTIL_SEARCH_HEADER_PATHS} and for libs")
-    set(CRCUTIL_ERR_MSG "${CRCUTIL_ERR_MSG} in ${CRCUTIL_SEARCH_LIB_PATH}")
-    if (Crcutil_FIND_REQUIRED)
-      message(FATAL_ERROR "${CRCUTIL_ERR_MSG}")
-    else (Crcutil_FIND_REQUIRED)
-      message(STATUS "${CRCUTIL_ERR_MSG}")
-    endif (Crcutil_FIND_REQUIRED)
-  endif ()
-endif ()
-
-mark_as_advanced(
-  CRCUTIL_INCLUDE_DIR
-  CRCUTIL_LIBS
-  CRCUTIL_STATIC_LIB
-  CRCUTIL_SHARED_LIB
-)
-
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(CRCUTIL_SHARED_LIB crcutil
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(CRCUTIL_STATIC_LIB libcrcutil.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CRCUTIL REQUIRED_VARS
+  CRCUTIL_SHARED_LIB CRCUTIL_STATIC_LIB CRCUTIL_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindCyrusSASL.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindCyrusSASL.cmake b/cmake_modules/FindCyrusSASL.cmake
index d48cefb..8f92cf5 100644
--- a/cmake_modules/FindCyrusSASL.cmake
+++ b/cmake_modules/FindCyrusSASL.cmake
@@ -19,8 +19,7 @@
 #
 # This module defines
 #  CYRUS_SASL_INCLUDE_DIR, directory containing headers
-#  CYRUS_SASL_SHARED_LIB, path to libsasl2.so
-#  CYRUS_SASL_LIB_DEPS other libraries that SASL depends on
+#  CYRUS_SASL_SHARED_LIB, path to Cyrus SASL's shared library
 #  CYRUS_SASL_FOUND, whether Cyrus SASL and its plugins have been found
 #
 # N.B: we do _not_ include sasl in thirdparty, for a fairly subtle reason. The
@@ -36,38 +35,8 @@
 
 
 find_path(CYRUS_SASL_INCLUDE_DIR sasl/sasl.h)
-find_library(CYRUS_SASL_SHARED_LIB NAMES "libsasl2${CMAKE_SHARED_LIBRARY_SUFFIX}")
+find_library(CYRUS_SASL_SHARED_LIB sasl2)
 
-if (CYRUS_SASL_INCLUDE_DIR AND CYRUS_SASL_SHARED_LIB)
-  set(CYRUS_SASL_FOUND TRUE)
-else ()
-  set(CYRUS_SASL_FOUND FALSE)
-endif ()
-
-if (CYRUS_SASL_FOUND)
-  if (NOT APPLE)
-    set(CYRUS_SASL_LIB_DEPS dl crypt)
-  else ()
-    # the crypt function is in the system C library: no special linker options required.
-    set(CYRUS_SASL_LIB_DEPS dl)
-  endif ()
-  if (NOT CyrusSASL_FIND_QUIETLY)
-    message(STATUS "Found the CyrusSASL library: ${CYRUS_SASL_SHARED_LIB}")
-  endif ()
-else ()
-  if (NOT CyrusSASL_FIND_QUIETLY)
-    set(CYRUS_SASL_ERR_MSG "Could not find the CyrusSASL Library.")
-    set(CYRUS_SASL_ERR_MSG "Install libsasl2-dev or cyrus-sasl-devel packages to build.")
-    if (CyrusSASL_FIND_REQUIRED)
-      message(FATAL_ERROR "${CYRUS_SASL_ERR_MSG}")
-    else (CyrusSASL_FIND_REQUIRED)
-      message(STATUS "${CYRUS_SASL_ERR_MSG}")
-    endif (CyrusSASL_FIND_REQUIRED)
-  endif ()
-endif ()
-
-mark_as_advanced(
-  CYRUS_SASL_INCLUDE_DIR
-  CYRUS_SASL_SHARED_LIB
-  CYRUS_SASL_LIB_DEPS
-)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CYRUS_SASL REQUIRED_VARS
+  CYRUS_SASL_SHARED_LIB CYRUS_SASL_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindGFlags.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindGFlags.cmake b/cmake_modules/FindGFlags.cmake
index 1cf402c..273c72e 100644
--- a/cmake_modules/FindGFlags.cmake
+++ b/cmake_modules/FindGFlags.cmake
@@ -1,57 +1,21 @@
 # - Find GFLAGS (gflags.h, libgflags.a, libgflags.so, and libgflags.so.0)
 # This module defines
 #  GFLAGS_INCLUDE_DIR, directory containing headers
-#  GFLAGS_LIBS, directory containing gflag libraries
-#  GFLAGS_STATIC_LIB, path to libgflags.a
-#  GFLAGS_SHARED_LIB, path to libgflags' shared library
+#  GFLAGS_SHARED_LIB, path to libgflags shared library
+#  GFLAGS_STATIC_LIB, path to libgflags static library
 #  GFLAGS_FOUND, whether gflags has been found
 
-set(GFLAGS_SEARCH_HEADER_PATHS  
-  ${THIRDPARTY_PREFIX}/include
-)
-
-set(GFLAGS_SEARCH_LIB_PATH
-  ${THIRDPARTY_PREFIX}/lib
-)
-
-find_path(GFLAGS_INCLUDE_DIR gflags/gflags.h PATHS
-  ${GFLAGS_SEARCH_HEADER_PATHS}
+find_path(GFLAGS_INCLUDE_DIR gflags/gflags.h
   # make sure we don't accidentally pick up a different version
-  NO_DEFAULT_PATH
-)
-
-find_library(GFLAGS_LIB_PATH NAMES gflags PATHS ${GFLAGS_SEARCH_LIB_PATH} NO_DEFAULT_PATH)
-
-if (GFLAGS_INCLUDE_DIR AND GFLAGS_LIB_PATH)
-  set(GFLAGS_FOUND TRUE)
-  set(GFLAGS_LIB_NAME libgflags)
-  set(GFLAGS_LIBS ${GFLAGS_SEARCH_LIB_PATH})
-  set(GFLAGS_STATIC_LIB ${GFLAGS_SEARCH_LIB_PATH}/${GFLAGS_LIB_NAME}.a)
-  set(GFLAGS_SHARED_LIB ${GFLAGS_LIBS}/${GFLAGS_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
-else ()
-  set(GFLAGS_FOUND FALSE)
-endif ()
-
-if (GFLAGS_FOUND)
-  if (NOT GFlags_FIND_QUIETLY)
-    message(STATUS "Found the GFlags library: ${GFLAGS_LIB_PATH}")
-  endif ()
-else ()
-  if (NOT GFlags_FIND_QUIETLY)
-    set(GFLAGS_ERR_MSG "Could not find the GFlags library. Looked for headers")
-    set(GFLAGS_ERR_MSG "${GFLAGS_ERR_MSG} in ${GFLAGS_SEARCH_HEADER_PATHS}, and for libs")
-    set(GFLAGS_ERR_MSG "${GFLAGS_ERR_MSG} in ${GFLAGS_SEARCH_LIB_PATH}")
-    if (GFlags_FIND_REQUIRED)
-      message(FATAL_ERROR "${GFLAGS_ERR_MSG}")
-    else (GFlags_FIND_REQUIRED)
-      message(STATUS "${GFLAGS_ERR_MSG}")
-    endif (GFlags_FIND_REQUIRED)
-  endif ()
-endif ()
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(GFLAGS_SHARED_LIB gflags
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(GFLAGS_STATIC_LIB libgflags.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
 
-mark_as_advanced(
-  GFLAGS_INCLUDE_DIR
-  GFLAGS_LIBS
-  GFLAGS_STATIC_LIB
-  GFLAGS_SHARED_LIB
-)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GFLAGS REQUIRED_VARS
+  GFLAGS_SHARED_LIB GFLAGS_STATIC_LIB GFLAGS_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindGLog.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindGLog.cmake b/cmake_modules/FindGLog.cmake
index f836843..c214bd0 100644
--- a/cmake_modules/FindGLog.cmake
+++ b/cmake_modules/FindGLog.cmake
@@ -1,57 +1,21 @@
 # - Find GLOG (logging.h, libglog.a, libglog.so, and libglog.so.0)
 # This module defines
 #  GLOG_INCLUDE_DIR, directory containing headers
-#  GLOG_LIBS, directory containing glog libraries
-#  GLOG_STATIC_LIB, path to libglog.a
 #  GLOG_SHARED_LIB, path to libglog's shared library
+#  GLOG_STATIC_LIB, path to libglog's static library
 #  GLOG_FOUND, whether glog has been found
 
-set(GLOG_SEARCH_HEADER_PATHS
-  ${CMAKE_SOURCE_DIR}/thirdparty/installed/include
-)
-
-set(GLOG_SEARCH_LIB_PATH
-  ${CMAKE_SOURCE_DIR}/thirdparty/installed/lib
-)
-
-find_path(GLOG_INCLUDE_DIR glog/logging.h PATHS
-  ${GLOG_SEARCH_HEADER_PATHS}
+find_path(GLOG_INCLUDE_DIR glog/logging.h
   # make sure we don't accidentally pick up a different version
-  NO_DEFAULT_PATH
-)
-
-find_library(GLOG_LIB_PATH NAMES glog PATHS ${GLOG_SEARCH_LIB_PATH} NO_DEFAULT_PATH)
-
-if (GLOG_INCLUDE_DIR AND GLOG_LIB_PATH)
-  set(GLOG_FOUND TRUE)
-  set(GLOG_LIBS ${GLOG_SEARCH_LIB_PATH})
-  set(GLOG_LIB_NAME libglog)
-  set(GLOG_STATIC_LIB ${GLOG_SEARCH_LIB_PATH}/${GLOG_LIB_NAME}.a)
-  set(GLOG_SHARED_LIB ${GLOG_LIBS}/${GLOG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
-else ()
-  set(GLOG_FOUND FALSE)
-endif ()
-
-if (GLOG_FOUND)
-  if (NOT GLog_FIND_QUIETLY)
-    message(STATUS "Found the GLog library: ${GLOG_LIB_PATH}")
-  endif ()
-else ()
-  if (NOT GLog_FIND_QUIETLY)
-    set(GLOG_ERR_MSG "Could not find the GLog library. Looked for headers")
-    set(GLOG_ERR_MSG "${GLOG_ERR_MSG} in ${GLOG_SEARCH_HEADER_PATHS}, and for libs")
-    set(GLOG_ERR_MSG "${GLOG_ERR_MSG} in ${GLOG_SEARCH_LIB_PATH}")
-    if (GLog_FIND_REQUIRED)
-      message(FATAL_ERROR "${GLOG_ERR_MSG}")
-    else (GLog_FIND_REQUIRED)
-      message(STATUS "${GLOG_ERR_MSG}")
-    endif (GLog_FIND_REQUIRED)
-  endif ()
-endif ()
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(GLOG_SHARED_LIB glog
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(GLOG_STATIC_LIB libglog.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
 
-mark_as_advanced(
-  GLOG_INCLUDE_DIR
-  GLOG_LIBS
-  GLOG_STATIC_LIB
-  GLOG_SHARED_LIB
-)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GLOG REQUIRED_VARS
+  GLOG_SHARED_LIB GLOG_STATIC_LIB GLOG_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindGMock.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindGMock.cmake b/cmake_modules/FindGMock.cmake
index 84200e0..7b6eb70 100644
--- a/cmake_modules/FindGMock.cmake
+++ b/cmake_modules/FindGMock.cmake
@@ -27,67 +27,31 @@
 # This module defines
 # GMOCK_INCLUDE_DIR, where to find gmock include files, etc.
 # GTEST_INCLUDE_DIR, where to find gtest include files
-# GMock_FOUND, If false, do not try to use gmock.
-# GMOCK_STATIC_LIBRARY, Location of libgmock.a
-# GMOCK_SHARED_LIBRARY, Location of libttest's shared library
-
-# also defined, but not for general use are
-# GMOCK_LIBRARY, where to find the GMock library.
-
-set(GMOCK_SEARCH_PATH ${CMAKE_SOURCE_DIR}/thirdparty/installed)
-
-set(GMOCK_H gmock/gmock.h)
-set(GTEST_H gtest/gtest.h)
-
-find_path(GMOCK_INCLUDE_DIR ${GMOCK_H}
-  PATHS ${GMOCK_SEARCH_PATH}/include
-        NO_DEFAULT_PATH
-  DOC   "Path to the ${GMOCK_H} file"
-)
-find_path(GTEST_INCLUDE_DIR ${GTEST_H}
-  PATHS ${GMOCK_SEARCH_PATH}/include
-        NO_DEFAULT_PATH
-  DOC   "Path to the ${GTEST_H} file"
-)
-find_library(GMOCK_LIBRARY
-  NAMES gmock
-  PATHS ${GMOCK_SEARCH_PATH}/lib/
-        NO_DEFAULT_PATH
-  DOC   "Google's framework for writing C++ tests (gmock)"
-)
-
-set(GMOCK_LIB_NAME libgmock)
-if(GMOCK_INCLUDE_DIR AND GTEST_INCLUDE_DIR AND GMOCK_LIBRARY)
-  set(GMOCK_STATIC_LIBRARY ${GMOCK_SEARCH_PATH}/lib/${GMOCK_LIB_NAME}.a)
-  if(EXISTS "${GMOCK_STATIC_LIBRARY}")
-    set(GMOCK_FOUND TRUE)
-  endif()
-
-  set(GMOCK_SHARED_LIBRARY ${GMOCK_SEARCH_PATH}/lib/${GMOCK_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
-  if(EXISTS "${GMOCK_SHARED_LIBRARY}")
-    set(GMOCK_FOUND TRUE)
-  endif()
-else()
-  set(GMOCK_FOUND FALSE)
-endif()
-
-if(GMOCK_FOUND)
-  if(NOT GMock_FIND_QUIETLY)
-    message(STATUS "Found the GMock library: ${GMOCK_STATIC_LIBRARY} ${GMOCK_SHARED_LIBRARY}")
-  endif(NOT GMock_FIND_QUIETLY)
-else(GMOCK_FOUND)
-  if(NOT GMock_FIND_QUIETLY)
-    if(GMock_FIND_REQUIRED)
-      message(FATAL_ERROR "Could not find the GMock library")
-    else(GMock_FIND_REQUIRED)
-      message(STATUS "Could not find the GMock library")
-    endif(GMock_FIND_REQUIRED)
-  endif(NOT GMock_FIND_QUIETLY)
-endif(GMOCK_FOUND)
-
-mark_as_advanced(
-  GMOCK_INCLUDE_DIR
-  GTEST_INCLUDE_DIR
-  GMOCK_STATIC_LIBRARY
-  GMOCK_SHARED_LIBRARY)
-
+# GMOCK_SHARED_LIBRARY, Location of libgmock's shared library
+# GMOCK_STATIC_LIBRARY, Location of libgmock's static library
+# GMOCK_FOUND, If false, do not try to use gmock.
+
+find_path(GMOCK_INCLUDE_DIR gmock/gmock.h
+          DOC   "Path to the gmock header file"
+          NO_CMAKE_SYSTEM_PATH
+          NO_SYSTEM_ENVIRONMENT_PATH)
+
+find_path(GTEST_INCLUDE_DIR gtest/gtest.h
+          DOC   "Path to the gtest header file"
+          NO_CMAKE_SYSTEM_PATH
+          NO_SYSTEM_ENVIRONMENT_PATH)
+
+find_library(GMOCK_SHARED_LIBRARY gmock
+             DOC   "Google's framework for writing C++ tests (gmock)"
+             NO_CMAKE_SYSTEM_PATH
+             NO_SYSTEM_ENVIRONMENT_PATH)
+
+find_library(GMOCK_STATIC_LIBRARY libgmock.a
+             DOC   "Google's framework for writing C++ tests (gmock) static"
+             NO_CMAKE_SYSTEM_PATH
+             NO_SYSTEM_ENVIRONMENT_PATH)
+
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GMOCK REQUIRED_VARS
+  GMOCK_SHARED_LIBRARY GMOCK_STATIC_LIBRARY GMOCK_INCLUDE_DIR GTEST_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindGPerf.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindGPerf.cmake b/cmake_modules/FindGPerf.cmake
index 3ecdf16..48d4033 100644
--- a/cmake_modules/FindGPerf.cmake
+++ b/cmake_modules/FindGPerf.cmake
@@ -6,64 +6,29 @@
 #  GOOGLE_PERFTOOLS_INCLUDE_DIR, where to find heap-profiler.h, etc.
 #  GOOGLE_PERFTOOLS_FOUND, If false, do not try to use Google perftools.
 # also defined for general use are
-#  TCMALLOC_LIBS, where to find the tcmalloc libraries.
-#  TCMALLOC_STATIC_LIB, path to libtcmalloc.a.
-#  TCMALLOC_SHARED_LIB, path to libtcmalloc's shared library
-#  PROFILER_LIBS, where to find the profiler libraries.
-#  PROFILER_STATIC_LIB, path to libprofiler.a.
+#  TCMALLOC_SHARED_LIB, path to tcmalloc's shared library
+#  TCMALLOC_STATIC_LIB, path to tcmalloc's static library
 #  PROFILER_SHARED_LIB, path to libprofiler's shared library
+#  PROFILER_STATIC_LIB, path to libprofiler's static library
 
 FIND_PATH(GOOGLE_PERFTOOLS_INCLUDE_DIR google/heap-profiler.h
-  ${THIRDPARTY_PREFIX}/include
-  NO_DEFAULT_PATH
-)
-
-SET(GPERF_LIB_SEARCH ${THIRDPARTY_PREFIX}/lib)
-
-FIND_LIBRARY(TCMALLOC_LIB_PATH
-  NAMES libtcmalloc.a
-  PATHS ${GPERF_LIB_SEARCH}
-  NO_DEFAULT_PATH
-)
-
-IF (TCMALLOC_LIB_PATH AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
-    SET(TCMALLOC_LIBS ${GPERF_LIB_SEARCH})
-    SET(TCMALLOC_LIB_NAME libtcmalloc)
-    SET(TCMALLOC_STATIC_LIB ${GPERF_LIB_SEARCH}/${TCMALLOC_LIB_NAME}.a)
-    SET(TCMALLOC_SHARED_LIB ${TCMALLOC_LIBS}/${TCMALLOC_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
-    SET(GOOGLE_PERFTOOLS_FOUND "YES")
-ELSE (TCMALLOC_LIB_PATH AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
-  SET(GOOGLE_PERFTOOLS_FOUND "NO")
-ENDIF (TCMALLOC_LIB_PATH AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
-
-FIND_LIBRARY(PROFILER_LIB_PATH
-  NAMES libprofiler.a
-  PATHS ${GPERF_LIB_SEARCH}
-)
-
-IF (PROFILER_LIB_PATH AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
-  SET(PROFILER_LIBS ${GPERF_LIB_SEARCH})
-  SET(PROFILER_LIB_NAME libprofiler)
-  SET(PROFILER_STATIC_LIB ${GPERF_LIB_SEARCH}/${PROFILER_LIB_NAME}.a)
-  SET(PROFILER_SHARED_LIB ${PROFILER_LIBS}/${PROFILER_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
-ENDIF (PROFILER_LIB_PATH AND GOOGLE_PERFTOOLS_INCLUDE_DIR)
-
-IF (GOOGLE_PERFTOOLS_FOUND)
-  IF (NOT GPerf_FIND_QUIETLY)
-    MESSAGE(STATUS "Found the Google perftools library: ${TCMALLOC_LIBS}")
-  ENDIF (NOT GPerf_FIND_QUIETLY)
-ELSE (GOOGLE_PERFTOOLS_FOUND)
-  IF (GPerf_FIND_REQUIRED)
-    MESSAGE(FATAL_ERROR "Could not find the Google perftools library")
-  ENDIF (GPerf_FIND_REQUIRED)
-ENDIF (GOOGLE_PERFTOOLS_FOUND)
-
-MARK_AS_ADVANCED(
-  TCMALLOC_LIBS
-  TCMALLOC_STATIC_LIB
-  TCMALLOC_SHARED_LIB
-  PROFILER_LIBS
-  PROFILER_STATIC_LIB
-  PROFILER_SHARED_LIB
-  GOOGLE_PERFTOOLS_INCLUDE_DIR
-)
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+FIND_LIBRARY(TCMALLOC_SHARED_LIB tcmalloc
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+FIND_LIBRARY(TCMALLOC_STATIC_LIB libtcmalloc.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+FIND_LIBRARY(PROFILER_SHARED_LIB profiler
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+FIND_LIBRARY(PROFILER_STATIC_LIB libprofiler.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GOOGLE_PERFTOOLS REQUIRED_VARS
+  TCMALLOC_SHARED_LIB TCMALLOC_STATIC_LIB
+  PROFILER_SHARED_LIB PROFILER_STATIC_LIB
+  GOOGLE_PERFTOOLS_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindKRPC.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindKRPC.cmake b/cmake_modules/FindKRPC.cmake
index 1f25ae2..31e0d86 100644
--- a/cmake_modules/FindKRPC.cmake
+++ b/cmake_modules/FindKRPC.cmake
@@ -17,7 +17,7 @@
 #
 # Kudu RPC generator support
 #########
-find_package( Protobuf REQUIRED )
+find_package(Protobuf REQUIRED)
 
 #
 # Generate the KRPC files for a given .proto file.

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindLibEv.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindLibEv.cmake b/cmake_modules/FindLibEv.cmake
index e917188..f1f9d7a 100644
--- a/cmake_modules/FindLibEv.cmake
+++ b/cmake_modules/FindLibEv.cmake
@@ -1,57 +1,21 @@
 # - Find LIBEV (ev++.h, libev.a, and libev.so)
 # This module defines
 #  LIBEV_INCLUDE_DIR, directory containing headers
-#  LIBEV_LIBS, directory containing libev libraries
-#  LIBEV_STATIC_LIB, path to libev.a
 #  LIBEV_SHARED_LIB, path to libev's shared library
+#  LIBEV_STATIC_LIB, path to libev's static library
 #  LIBEV_FOUND, whether libev has been found
 
-set(LIBEV_SEARCH_HEADER_PATHS  
-  ${THIRDPARTY_PREFIX}/include
-)
-
-set(LIBEV_SEARCH_LIB_PATH
-  ${THIRDPARTY_PREFIX}/lib
-)
-
-find_path(LIBEV_INCLUDE_DIR ev++.h PATHS
-    ${LIBEV_SEARCH_HEADER_PATHS}
+find_path(LIBEV_INCLUDE_DIR ev++.h
   # make sure we don't accidentally pick up a different version
-  NO_DEFAULT_PATH
-)
-
-find_library(LIBEV_LIB_PATH NAMES ev PATHS ${LIBEV_SEARCH_LIB_PATH} NO_DEFAULT_PATH)
-
-if (LIBEV_INCLUDE_DIR AND LIBEV_LIB_PATH)
-  set(LIBEV_FOUND TRUE)
-  set(LIBEV_LIBS ${LIBEV_SEARCH_LIB_PATH})
-  set(LIBEV_LIB_NAME libev)
-  set(LIBEV_STATIC_LIB ${LIBEV_SEARCH_LIB_PATH}/${LIBEV_LIB_NAME}.a)
-  set(LIBEV_SHARED_LIB ${LIBEV_SEARCH_LIB_PATH}/${LIBEV_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
-else ()
-  set(LIBEV_FOUND FALSE)
-endif ()
-
-if (LIBEV_FOUND)
-  if (NOT LibEv_FIND_QUIETLY)
-    message(STATUS "Found the LibEv library: ${LIBEV_LIB_PATH}")
-  endif ()
-else ()
-  if (NOT LibEv_FIND_QUIETLY)
-    set(LIBEV_ERR_MSG "Could not find the LibEv library. Looked for headers")
-    set(LIBEV_ERR_MSG "${LIBEV_ERR_MSG} in ${LIBEV_SEARCH_HEADER_PATHS}, and for libs")
-    set(LIBEV_ERR_MSG "${LIBEV_ERR_MSG} in ${LIBEV_SEARCH_LIB_PATH}")
-    if (LibEv_FIND_REQUIRED)
-      message(FATAL_ERROR "${LIBEV_ERR_MSG}")
-    else (LibEv_FIND_REQUIRED)
-      message(STATUS "${LIBEV_ERR_MSG}")
-    endif (LibEv_FIND_REQUIRED)
-  endif ()
-endif ()
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(LIBEV_SHARED_LIB ev
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(LIBEV_STATIC_LIB libev.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
 
-mark_as_advanced(
-  LIBEV_INCLUDE_DIR
-  LIBEV_LIBS
-  LIBEV_STATIC_LIB
-  LIBEV_SHARED_LIB
-)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LIBEV REQUIRED_VARS
+  LIBEV_SHARED_LIB LIBEV_STATIC_LIB LIBEV_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindLibUnwind.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindLibUnwind.cmake b/cmake_modules/FindLibUnwind.cmake
index 3f46690..b6a8622 100644
--- a/cmake_modules/FindLibUnwind.cmake
+++ b/cmake_modules/FindLibUnwind.cmake
@@ -19,47 +19,19 @@
 #
 # This module defines
 #  UNWIND_INCLUDE_DIR, directory containing headers
-#  UNWIND_SHARED_LIB, path to libunwind.so
-#  UNWIND_STATIC_LIB, path to libunwind.a
-
-set(UNWIND_SEARCH_HEADER_PATHS ${THIRDPARTY_PREFIX}/include)
-set(UNWIND_SEARCH_LIB_PATH ${THIRDPARTY_PREFIX}/lib)
+#  UNWIND_SHARED_LIB, path to libunwind's shared library
+#  UNWIND_STATIC_LIB, path to libunwind's static library
 
 find_path(UNWIND_INCLUDE_DIR libunwind.h
-  PATHS ${UNWIND_SEARCH_HEADER_PATHS}
-  NO_DEFAULT_PATH)
-
-find_library(UNWIND_SHARED_LIB
-  NAMES libunwind.so
-  PATHS ${UNWIND_SEARCH_LIB_PATH}
-  NO_DEFAULT_PATH)
-
-if (UNWIND_INCLUDE_DIR AND UNWIND_SHARED_LIB)
-  set(UNWIND_FOUND TRUE)
-  set(UNWIND_STATIC_LIB ${UNWIND_SEARCH_LIB_PATH}/libunwind.a)
-else ()
-  set(UNWIND_FOUND FALSE)
-endif ()
-
-if (UNWIND_FOUND)
-  if (NOT LibUnwind_FIND_QUIETLY)
-    message(STATUS "Found the libunwind library: ${UNWIND_SHARED_LIB}")
-  endif ()
-else ()
-  if (NOT LibUnwind_FIND_QUIETLY)
-    set(UNWIND_ERR_MSG "Could not find the libunwind library. Looked for headers")
-    set(UNWIND_ERR_MSG "${UNWIND_ERR_MSG} in ${UNWIND_SEARCH_HEADER_PATHS}, and for libs")
-    set(UNWIND_ERR_MSG "${UNWIND_ERR_MSG} in ${UNWIND_SEARCH_LIB_PATH}")
-    if (LibUnwind_FIND_REQUIRED)
-      message(FATAL_ERROR "${UNWIND_ERR_MSG}")
-    else (LibUnwind_FIND_REQUIRED)
-      message(STATUS "${UNWIND_ERR_MSG}")
-    endif (LibUnwind_FIND_REQUIRED)
-  endif ()
-endif ()
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(UNWIND_SHARED_LIB unwind
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(UNWIND_STATIC_LIB libunwind.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
 
-mark_as_advanced(
-  UNWIND_INCLUDE_DIR
-  UNWIND_SHARED_LIB
-  UNWIND_STATIC_LIB
-)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(UNWIND REQUIRED_VARS
+  UNWIND_SHARED_LIB UNWIND_STATIC_LIB UNWIND_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindLz4.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindLz4.cmake b/cmake_modules/FindLz4.cmake
index ab1ff4d..87800a8 100644
--- a/cmake_modules/FindLz4.cmake
+++ b/cmake_modules/FindLz4.cmake
@@ -1,53 +1,17 @@
-# - Find LZ4 (lz4.h, liblz4.a, liblz4.so, and liblz4.so.1)
+# - Find LZ4 (lz4.h, liblz4.a)
 # This module defines
 #  LZ4_INCLUDE_DIR, directory containing headers
-#  LZ4_LIBS, directory containing lz4 libraries
-#  LZ4_STATIC_LIB, path to liblz4.a
+#  LZ4_STATIC_LIB, path to liblz4's static library
 #  LZ4_FOUND, whether lz4 has been found
 
-set(LZ4_SEARCH_HEADER_PATHS
-  ${THIRDPARTY_PREFIX}/include
-)
-
-set(LZ4_SEARCH_LIB_PATH
-  ${THIRDPARTY_PREFIX}/lib
-)
-
-find_path(LZ4_INCLUDE_DIR lz4.h PATHS
-  ${LZ4_SEARCH_HEADER_PATHS}
+find_path(LZ4_INCLUDE_DIR lz4.h
   # make sure we don't accidentally pick up a different version
-  NO_DEFAULT_PATH
-)
-
-find_library(LZ4_LIB_PATH NAMES liblz4.a PATHS ${LZ4_SEARCH_LIB_PATH} NO_DEFAULT_PATH)
-
-if (LZ4_INCLUDE_DIR AND LZ4_LIB_PATH)
-  set(LZ4_FOUND TRUE)
-  set(LZ4_LIBS ${LZ4_SEARCH_LIB_PATH})
-  set(LZ4_STATIC_LIB ${LZ4_SEARCH_LIB_PATH}/liblz4.a)
-else ()
-  set(LZ4_FOUND FALSE)
-endif ()
-
-if (LZ4_FOUND)
-  if (NOT Lz4_FIND_QUIETLY)
-    message(STATUS "Found the Lz4 library: ${LZ4_LIB_PATH}")
-  endif ()
-else ()
-  if (NOT Lz4_FIND_QUIETLY)
-    set(LZ4_ERR_MSG "Could not find the Lz4 library. Looked for headers")
-    set(LZ4_ERR_MSG "${LZ4_ERR_MSG} in ${LZ4_SEARCH_HEADER_PATHS}, and for libs")
-    set(LZ4_ERR_MSG "${LZ4_ERR_MSG} in ${LZ4_SEARCH_LIB_PATH}")
-    if (Lz4_FIND_REQUIRED)
-      message(FATAL_ERROR "${LZ4_ERR_MSG}")
-    else (Lz4_FIND_REQUIRED)
-      message(STATUS "${LZ4_ERR_MSG}")
-    endif (Lz4_FIND_REQUIRED)
-  endif ()
-endif ()
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(LZ4_STATIC_LIB liblz4.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
 
-mark_as_advanced(
-  LZ4_INCLUDE_DIR
-  LZ4_LIBS
-  LZ4_STATIC_LIB
-)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LZ4 REQUIRED_VARS
+  LZ4_STATIC_LIB LZ4_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindProtobuf.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindProtobuf.cmake b/cmake_modules/FindProtobuf.cmake
index d1cd76a..e5401de 100644
--- a/cmake_modules/FindProtobuf.cmake
+++ b/cmake_modules/FindProtobuf.cmake
@@ -8,22 +8,19 @@
 # Locate and configure the Google Protocol Buffers library.
 # Defines the following variables:
 #
-#   PROTOBUF_FOUND - Found the Google Protocol Buffers library
-#   PROTOBUF_INCLUDE_DIRS - Include directories for Google Protocol Buffers
-#   PROTOBUF_LIBRARIES - The protobuf library
-#
-# The following cache variables are also defined:
-#   PROTOBUF_LIBRARY - The protobuf library
-#   PROTOBUF_STATIC_LIBRARY - The protobuf library (static link)
-#   PROTOBUF_PROTOC_LIBRARY   - The protoc library
-#   PROTOBUF_INCLUDE_DIR - The include directory for protocol buffers
-#   PROTOBUF_PROTOC_EXECUTABLE - The protoc compiler
+#   PROTOBUF_INCLUDE_DIR - the include directory for protocol buffers
+#   PROTOBUF_SHARED_LIBRARY - path to protobuf's shared library
+#   PROTOBUF_STATIC_LIBRARY - path to protobuf's static library
+#   PROTOBUF_PROTOC_SHARED_LIBRARY - path to protoc's shared library
+#   PROTOBUF_PROTOC_STATIC_LIBRARY - path to protoc's static library
+#   PROTOBUF_PROTOC_EXECUTABLE - the protoc compiler
+#   PROTOBUF_FOUND - whether the Protocol Buffers library has been found
 #
 #  ====================================================================
 #  Example:
 #
 #   find_package(Protobuf REQUIRED)
-#   include_directories(${PROTOBUF_INCLUDE_DIRS})
+#   include_directories(${PROTOBUF_INCLUDE_DIR})
 #
 #   include_directories(${CMAKE_CURRENT_BINARY_DIR})
 #   PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS PROTO_TGTS
@@ -31,7 +28,7 @@
 #     [BINARY_ROOT <root into which binaries are built>]
 #     PROTO_FILES foo.proto)
 #   add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS})
-#   target_link_libraries(bar ${PROTOBUF_LIBRARY})
+#   target_link_libraries(bar ${PROTOBUF_SHARED_LIBRARY})
 #
 # NOTE: You may need to link against pthreads, depending
 # on the platform.
@@ -48,7 +45,6 @@
 #          in order to "serialize" the protoc invocations
 #  ====================================================================
 
-
 #=============================================================================
 # Copyright 2011 Kirill A. Korinskiy <catap@catap.ru>
 # Copyright 2009 Kitware, Inc.
@@ -154,60 +150,36 @@ endfunction()
 
 
 find_path(PROTOBUF_INCLUDE_DIR google/protobuf/service.h
-  ${THIRDPARTY_PREFIX}/include
-  NO_DEFAULT_PATH
-)
-
-# Google's provided vcproj files generate libraries with a "lib"
-# prefix on Windows
-if(WIN32)
-    set(PROTOBUF_ORIG_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
-    set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
-endif()
-
-find_library(PROTOBUF_LIBRARY NAMES libprotobuf${CMAKE_SHARED_LIBRARY_SUFFIX}
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+
+find_library(PROTOBUF_SHARED_LIBRARY protobuf
              DOC "The Google Protocol Buffers Library"
-             PATHS ${THIRDPARTY_PREFIX}/lib
-             NO_DEFAULT_PATH
-)
-find_file(PROTOBUF_STATIC_LIBRARY libprotobuf.a
-         DOC "Static version of the Google Protocol Buffers Library"
-         PATHS ${THIRDPARTY_PREFIX}/lib
-         NO_DEFAULT_PATH)
-
-find_library(PROTOBUF_PROTOC_LIBRARY NAMES libprotoc${CMAKE_SHARED_LIBRARY_SUFFIX}
+             NO_CMAKE_SYSTEM_PATH
+             NO_SYSTEM_ENVIRONMENT_PATH)
+
+find_library(PROTOBUF_STATIC_LIBRARY libprotobuf.a
+             DOC "Static version of the Google Protocol Buffers Library"
+             NO_CMAKE_SYSTEM_PATH
+             NO_SYSTEM_ENVIRONMENT_PATH)
+
+find_library(PROTOBUF_PROTOC_SHARED_LIBRARY protoc
              DOC "The Google Protocol Buffers Compiler Library"
-             PATHS ${THIRDPARTY_PREFIX}/lib
-             NO_DEFAULT_PATH
-)
-find_library(PROTOBUF_PROTOC_STATIC_LIBRARY NAMES libprotoc.a
-         DOC "Static version of the Google Protocol Buffers Compiler Library"
-         PATHS ${THIRDPARTY_PREFIX}/lib
-         NO_DEFAULT_PATH)
-
-find_program(PROTOBUF_PROTOC_EXECUTABLE NAMES protoc
+             NO_CMAKE_SYSTEM_PATH
+             NO_SYSTEM_ENVIRONMENT_PATH)
+
+find_library(PROTOBUF_PROTOC_STATIC_LIBRARY libprotoc.a
+             DOC "Static version of the Google Protocol Buffers Compiler Library"
+             NO_CMAKE_SYSTEM_PATH
+             NO_SYSTEM_ENVIRONMENT_PATH)
+
+find_program(PROTOBUF_PROTOC_EXECUTABLE protoc
              DOC "The Google Protocol Buffers Compiler"
-             PATHS ${THIRDPARTY_PREFIX}/bin
-             NO_DEFAULT_PATH
-)
-
-mark_as_advanced(PROTOBUF_INCLUDE_DIR
-                 PROTOBUF_LIBRARY
-                 PROTOBUF_STATIC_LIBRARY
-                 PROTOBUF_PROTOC_LIBRARY
-                 PROTOBUF_PROTOC_STATIC_LIBRARY
-                 PROTOBUF_PROTOC_EXECUTABLE)
-
-# Restore original find library prefixes
-if(WIN32)
-    set(CMAKE_FIND_LIBRARY_PREFIXES "${PROTOBUF_ORIG_FIND_LIBRARY_PREFIXES}")
-endif()
+             NO_CMAKE_SYSTEM_PATH
+             NO_SYSTEM_ENVIRONMENT_PATH)
 
 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(PROTOBUF DEFAULT_MSG
-    PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR)
-
-if(PROTOBUF_FOUND)
-    set(PROTOBUF_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIR})
-    set(PROTOBUF_LIBRARIES    ${PROTOBUF_LIBRARY})
-endif()
+find_package_handle_standard_args(PROTOBUF REQUIRED_VARS
+  PROTOBUF_SHARED_LIBRARY PROTOBUF_STATIC_LIBRARY
+  PROTOBUF_PROTOC_SHARED_LIBRARY PROTOBUF_PROTOC_STATIC_LIBRARY
+  PROTOBUF_INCLUDE_DIR PROTOBUF_PROTOC_EXECUTABLE)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindSnappy.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindSnappy.cmake b/cmake_modules/FindSnappy.cmake
index 51afe60..75a909f 100644
--- a/cmake_modules/FindSnappy.cmake
+++ b/cmake_modules/FindSnappy.cmake
@@ -1,57 +1,21 @@
 # - Find SNAPPY (snappy.h, libsnappy.a, libsnappy.so, and libsnappy.so.1)
 # This module defines
 #  SNAPPY_INCLUDE_DIR, directory containing headers
-#  SNAPPY_LIBS, directory containing snappy libraries
-#  SNAPPY_STATIC_LIB, path to libsnappy.a
-#  SNAPPY_SHARED_LIB, path to libsnappy's shared library
+#  SNAPPY_SHARED_LIB, path to snappy's shared library
+#  SNAPPY_STATIC_LIB, path to snappy's static library
 #  SNAPPY_FOUND, whether snappy has been found
 
-set(SNAPPY_SEARCH_HEADER_PATHS
-  ${THIRDPARTY_PREFIX}/include
-)
-
-set(SNAPPY_SEARCH_LIB_PATH
-  ${THIRDPARTY_PREFIX}/lib
-)
-
-find_path(SNAPPY_INCLUDE_DIR snappy.h PATHS
-  ${SNAPPY_SEARCH_HEADER_PATHS}
+find_path(SNAPPY_INCLUDE_DIR snappy.h
   # make sure we don't accidentally pick up a different version
-  NO_DEFAULT_PATH
-)
-
-find_library(SNAPPY_LIB_PATH NAMES snappy PATHS ${SNAPPY_SEARCH_LIB_PATH} NO_DEFAULT_PATH)
-
-if (SNAPPY_INCLUDE_DIR AND SNAPPY_LIB_PATH)
-  set(SNAPPY_FOUND TRUE)
-  set(SNAPPY_LIB_NAME libsnappy)
-  set(SNAPPY_LIBS ${SNAPPY_SEARCH_LIB_PATH})
-  set(SNAPPY_STATIC_LIB ${SNAPPY_SEARCH_LIB_PATH}/${SNAPPY_LIB_NAME}.a)
-  set(SNAPPY_SHARED_LIB ${SNAPPY_LIBS}/${SNAPPY_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
-else ()
-  set(SNAPPY_FOUND FALSE)
-endif ()
-
-if (SNAPPY_FOUND)
-  if (NOT Snappy_FIND_QUIETLY)
-    message(STATUS "Found the Snappy library: ${SNAPPY_LIB_PATH}")
-  endif ()
-else ()
-  if (NOT Snappy_FIND_QUIETLY)
-    set(SNAPPY_ERR_MSG "Could not find the Snappy library. Looked for headers")
-    set(SNAPPY_ERR_MSG "${SNAPPY_ERR_MSG} in ${SNAPPY_SEARCH_HEADER_PATHS}, and for libs")
-    set(SNAPPY_ERR_MSG "${SNAPPY_ERR_MSG} in ${SNAPPY_SEARCH_LIB_PATH}")
-    if (Snappy_FIND_REQUIRED)
-      message(FATAL_ERROR "${SNAPPY_ERR_MSG}")
-    else (Snappy_FIND_REQUIRED)
-      message(STATUS "${SNAPPY_ERR_MSG}")
-    endif (Snappy_FIND_REQUIRED)
-  endif ()
-endif ()
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(SNAPPY_SHARED_LIB snappy
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(SNAPPY_STATIC_LIB libsnappy.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
 
-mark_as_advanced(
-  SNAPPY_INCLUDE_DIR
-  SNAPPY_LIBS
-  SNAPPY_STATIC_LIB
-  SNAPPY_SHARED_LIB
-)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SNAPPY REQUIRED_VARS
+  SNAPPY_SHARED_LIB SNAPPY_STATIC_LIB SNAPPY_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindSqueasel.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindSqueasel.cmake b/cmake_modules/FindSqueasel.cmake
index 3a068ad..2d48e27 100644
--- a/cmake_modules/FindSqueasel.cmake
+++ b/cmake_modules/FindSqueasel.cmake
@@ -21,49 +21,18 @@
 #  SQUEASEL_FOUND, whether squeasel has been found
 #  SQUEASEL_STATIC_LIB_DEPS other libraries that are dependencies for SQUEASEL_STATIC_LIB
 
-set(SQUEASEL_SEARCH_HEADER_PATHS
-  ${THIRDPARTY_PREFIX}/include
-)
-
-set(SQUEASEL_SEARCH_LIB_PATH
-  ${THIRDPARTY_PREFIX}/lib
-)
-
 find_path(SQUEASEL_INCLUDE_DIR squeasel.h
-  PATHS ${SQUEASEL_SEARCH_HEADER_PATHS}
   # make sure we don't accidentally pick up a different version
-  NO_DEFAULT_PATH
-)
-
-find_library(SQUEASEL_LIB_PATH
-  NAMES squeasel
-  PATHS ${SQUEASEL_SEARCH_LIB_PATH}
-  NO_DEFAULT_PATH)
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
 
-if (SQUEASEL_LIB_PATH AND SQUEASEL_INCLUDE_DIR)
-  set(SQUEASEL_FOUND TRUE)
-  set(SQUEASEL_LIBS ${SQUEASEL_SEARCH_LIB_PATH})
-  set(SQUEASEL_STATIC_LIB ${SQUEASEL_SEARCH_LIB_PATH}/libsqueasel.a)
-else ()
-  set(SQUEASEL_FOUND FALSE)
-endif ()
+find_library(SQUEASEL_STATIC_LIB libsqueasel.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
 
-if (SQUEASEL_FOUND)
-  if (NOT Squeasel_FIND_QUIETLY)
-    message(STATUS "Found the Squeasel library: ${SQUEASEL_LIB_PATH}")
-  endif ()
-else ()
-  if (NOT Squeasel_FIND_QUIETLY)
-    set(SQUEASEL_ERR_MSG "Could not find the Squeasel library. Looked for headers")
-    set(SQUEASEL_ERR_MSG "${SQUEASEL_ERR_MSG} in ${SQUEASEL_SEARCH_HEADER_PATHS}, and for libs")
-    set(SQUEASEL_ERR_MSG "${SQUEASEL_ERR_MSG} in ${SQUEASEL_SEARCH_LIB_PATH}")
-    if (Squeasel_FIND_REQUIRED)
-      message(FATAL_ERROR "${SQUEASEL_ERR_MSG}")
-    else (Squeasel_FIND_REQUIRED)
-      message(STATUS "${SQUEASEL_ERR_MSG}")
-    endif (Squeasel_FIND_REQUIRED)
-  endif ()
-endif ()
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SQUEASEL REQUIRED_VARS
+  SQUEASEL_STATIC_LIB SQUEASEL_INCLUDE_DIR)
 
 # Add OpenSSL libs to the linker path
 find_package(OpenSSL REQUIRED)
@@ -75,9 +44,3 @@ else ()
   endif ()
 endif ()
 
-mark_as_advanced(
-  SQUEASEL_INCLUDE_DIR
-  SQUEASEL_LIBS
-  SQUEASEL_STATIC_LIB
-  SQUEASEL_STATIC_LIB_DEPS
-)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindVmem.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindVmem.cmake b/cmake_modules/FindVmem.cmake
index bc93333..b85d2c4 100644
--- a/cmake_modules/FindVmem.cmake
+++ b/cmake_modules/FindVmem.cmake
@@ -1,57 +1,21 @@
 # - Find VMEM (libvmem.h, libvmem.so)
 # This module defines
 #  VMEM_INCLUDE_DIR, directory containing headers
-#  VMEM LIBS, directory containing vmem libraries
-#  VMEM_STATIC_LIB, path to libvmem.a
-#  VMEM_SHARED_LIB, path to libvmem.so shared library
+#  VMEM_SHARED_LIB, path to vmem's shared library
+#  VMEM_STATIC_LIB, path to vmem's static library
 #  VMEM_FOUND, whether libvmem has been found
 
-
-set(VMEM_SEARCH_LIB_PATH
-  ${THIRDPARTY_PREFIX}/lib
-)
-set(VMEM_SEARCH_HEADER_PATHS
-  ${THIRDPARTY_PREFIX}/include
-)
-
-find_path(VMEM_INCLUDE_DIR libvmem.h PATHS
-  ${VMEM_SEARCH_HEADER_PATHS}
+find_path(VMEM_INCLUDE_DIR libvmem.h
   # make sure we don't accidentally pick up a different version
-  NO_DEFAULT_PATH
-)
-
-find_library(VMEM_LIB_PATH NAMES vmem PATHS ${VMEM_SEARCH_LIB_PATH} NO_DEFAULT_PATH)
-
-if (VMEM_INCLUDE_DIR AND VMEM_LIB_PATH)
-  set(VMEM_FOUND TRUE)
-  set(VMEM_LIB_NAME libvmem)
-  set(VMEM_LIBS ${VMEM_SEARCH_LIB_PATH})
-  set(VMEM_STATIC_LIB ${VMEM_SEARCH_LIB_PATH}/${VMEM_LIB_NAME}.a)
-  set(VMEM_SHARED_LIB ${VMEM_LIBS}/${VMEM_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
-else ()
-  set(VMEM_FOUND FALSE)
-endif ()
-
-if (VMEM_FOUND)
-  if (NOT VMEM_FIND_QUIETLY)
-    message(STATUS "Found the vmem library: ${VMEM_LIB_PATH}")
-  endif ()
-else ()
-  if (NOT VMEM_FIND_QUIETLY)
-    set(VMEM_ERR_MSG "Could not find the vmem library. Looked for headers")
-    set(VMEM_ERR_MSG "${VMEM_ERR_MSG} in ${VMEM_SEARCH_HEADER_PATHS}, and for libs")
-    set(VMEM_ERR_MSG "${VMEM_ERR_MSG} in ${VMEM_SEARCH_LIB_PATH}")
-    if (Vmem_FIND_REQUIRED)
-      message(FATAL_ERROR "${VMEM_ERR_MSG}")
-    else (Vmem_FIND_REQUIRED)
-      message(STATUS "${VMEM_ERR_MSG}")
-    endif (Vmem_FIND_REQUIRED)
-  endif ()
-endif ()
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(VMEM_SHARED_LIB vmem
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(VMEM_STATIC_LIB libvmem.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
 
-mark_as_advanced(
-  VMEM_INCLUDE_DIR
-  VMEM_LIBS
-  VMEM_STATIC_LIB
-  VMEM_SHARED_LIB
-)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(VMEM REQUIRED_VARS
+  VMEM_SHARED_LIB VMEM_STATIC_LIB VMEM_INCLUDE_DIR)

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/9806863e/cmake_modules/FindZlib.cmake
----------------------------------------------------------------------
diff --git a/cmake_modules/FindZlib.cmake b/cmake_modules/FindZlib.cmake
index 90941b9..ee8078b 100644
--- a/cmake_modules/FindZlib.cmake
+++ b/cmake_modules/FindZlib.cmake
@@ -1,57 +1,21 @@
 # - Find ZLIB (zlib.h, libz.a, libz.so, and libz.so.1)
 # This module defines
 #  ZLIB_INCLUDE_DIR, directory containing headers
-#  ZLIB_LIBS, directory containing zlib libraries
-#  ZLIB_STATIC_LIB, path to libz.a
 #  ZLIB_SHARED_LIB, path to libz's shared library
+#  ZLIB_STATIC_LIB, path to libz's static library
 #  ZLIB_FOUND, whether zlib has been found
 
-set(ZLIB_SEARCH_HEADER_PATHS
-  ${THIRDPARTY_PREFIX}/include
-)
-
-set(ZLIB_SEARCH_LIB_PATH
-  ${THIRDPARTY_PREFIX}/lib
-)
-
-find_path(ZLIB_INCLUDE_DIR zlib.h PATHS
-  ${ZLIB_SEARCH_HEADER_PATHS}
+find_path(ZLIB_INCLUDE_DIR zlib.h
   # make sure we don't accidentally pick up a different version
-  NO_DEFAULT_PATH
-)
-
-find_library(ZLIB_LIB_PATH NAMES z PATHS ${ZLIB_SEARCH_LIB_PATH} NO_DEFAULT_PATH)
-
-if (ZLIB_INCLUDE_DIR AND ZLIB_LIB_PATH)
-  set(ZLIB_FOUND TRUE)
-  set(ZLIB_LIB_NAME libz)
-  set(ZLIB_LIBS ${ZLIB_SEARCH_LIB_PATH})
-  set(ZLIB_STATIC_LIB ${ZLIB_SEARCH_LIB_PATH}/${ZLIB_LIB_NAME}.a)
-  set(ZLIB_SHARED_LIB ${ZLIB_LIBS}/${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
-else ()
-  set(ZLIB_FOUND FALSE)
-endif ()
-
-if (ZLIB_FOUND)
-  if (NOT Zlib_FIND_QUIETLY)
-    message(STATUS "Found the Zlib library: ${ZLIB_LIB_PATH}")
-  endif ()
-else ()
-  if (NOT Zlib_FIND_QUIETLY)
-    set(ZLIB_ERR_MSG "Could not find the Zlib library. Looked for headers")
-    set(ZLIB_ERR_MSG "${ZLIB_ERR_MSG} in ${ZLIB_SEARCH_HEADER_PATHS}, and for libs")
-    set(ZLIB_ERR_MSG "${ZLIB_ERR_MSG} in ${ZLIB_SEARCH_LIB_PATH}")
-    if (Zlib_FIND_REQUIRED)
-      message(FATAL_ERROR "${ZLIB_ERR_MSG}")
-    else (Zlib_FIND_REQUIRED)
-      message(STATUS "${ZLIB_ERR_MSG}")
-    endif (Zlib_FIND_REQUIRED)
-  endif ()
-endif ()
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(ZLIB_SHARED_LIB z
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
+find_library(ZLIB_STATIC_LIB libz.a
+  NO_CMAKE_SYSTEM_PATH
+  NO_SYSTEM_ENVIRONMENT_PATH)
 
-mark_as_advanced(
-  ZLIB_INCLUDE_DIR
-  ZLIB_LIBS
-  ZLIB_STATIC_LIB
-  ZLIB_SHARED_LIB
-)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ZLIB REQUIRED_VARS
+  ZLIB_SHARED_LIB ZLIB_STATIC_LIB ZLIB_INCLUDE_DIR)



Mime
View raw message