2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
8 supported_build_types
="msan-no-origins msan-chained-origins"
9 supported_releases
="precise trusty"
10 ubuntu_release
=$
(lsb_release
-cs)
13 echo "Usage: build_and_package.sh <build_type>"
14 echo "Supported build types: all ${supported_build_types}"
17 function build_libraries
{
20 "msan-chained-origins")
21 local gyp_defines
="msan=1 msan_track_origins=2"
24 local gyp_defines
="msan=1 msan_track_origins=0"
32 local archive_name
=${build_type}-${ubuntu_release}
33 local out_dir
=out-
${archive_name}
35 echo "Building instrumented libraries in ${out_dir}..."
40 GYP_DEFINES
="${gyp_defines} \
41 use_instrumented_libraries=1 instrumented_libraries_jobs=8" \
42 GYP_GENERATOR_FLAGS
="output_dir=${out_dir}" \
45 ninja
-j4 -C ${out_dir}/Release instrumented_libraries
47 echo "Creating archive ${archive_name}.tgz..."
49 files
=$
(ls -1 ${out_dir}/Release
/instrumented_libraries
)
51 tar zcf
${archive_name}.tgz
-C ${out_dir}/Release
/instrumented_libraries \
52 --exclude="?san/*.txt" ${files}
55 echo upload_to_google_storage.py
-b \
56 chromium-instrumented-libraries
${archive_name}.tgz
57 echo You should
then commit the resulting .sha1
file.
60 if ! [[ "${supported_releases}" =~
${ubuntu_release} ]]
62 echo "Unsupported Ubuntu release: ${ubuntu_release}"
63 echo "Supported releases: ${supported_releases}"
73 if ! [[ "all ${supported_build_types}" =~
$1 ]]
80 for build_type
in ${supported_build_types}
82 build_libraries
${build_type}