summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorFranziskus Kiefer <franziskuskiefer@gmail.com>2017-03-07 12:52:39 +0100
committerFranziskus Kiefer <franziskuskiefer@gmail.com>2017-03-07 12:52:39 +0100
commit5dbbe79d0dccf7be2bf11a133cda5146efeae2b7 (patch)
treec52cc91bf9a8417142e4eba8950124638b43bd0c /build.sh
parent614f4bbe19b9d5bd0a13a660687111997c95f7bd (diff)
downloadnss-hg-5dbbe79d0dccf7be2bf11a133cda5146efeae2b7.tar.gz
Bug 1345086 - add option to use system sqlite, r=ttaubert
Differential Revision: https://nss-review.dev.mozaws.net/D239
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh49
1 files changed, 9 insertions, 40 deletions
diff --git a/build.sh b/build.sh
index c9ff426bb..010828985 100755
--- a/build.sh
+++ b/build.sh
@@ -19,43 +19,7 @@ source "$cwd"/coreconf/sanitizers.sh
# Usage info
show_help()
{
- cat << EOF
-Usage: ${0##*/} [-hcv] [-j <n>] [--nspr] [--gyp|-g] [--opt|-o] [-m32]
- [--test] [--pprof] [--scan-build[=output]] [--ct-verif]
- [--asan] [--ubsan] [--msan] [--sancov[=edge|bb|func|...]]
- [--disable-tests] [--fuzz[=tls|oss]]
-
-This script builds NSS with gyp and ninja.
-
-This build system is still under development. It does not yet support all
-the features or platforms that NSS supports.
-
-NSS build tool options:
-
- -h display this help and exit
- -c clean before build
- -v verbose build
- -j <n> run at most <n> concurrent jobs
- --nspr force a rebuild of NSPR
- --gyp|-g force a rerun of gyp
- --opt|-o do an opt build
- -m32 do a 32-bit build on a 64-bit system
- --test ignore map files and export everything we have
- --fuzz build fuzzing targets (this always enables test builds)
- --fuzz=tls to enable TLS fuzzing mode
- --fuzz=oss to build for OSS-Fuzz
- --pprof build with gperftool support
- --ct-verif build with valgrind for ct-verif
- --scan-build run the build with scan-build (scan-build has to be in the path)
- --scan-build=/out/path sets the output path for scan-build
- --asan do an asan build
- --ubsan do an ubsan build
- --ubsan=bool,shift,... sets specific UB sanitizers
- --msan do an msan build
- --sancov do sanitize coverage builds
- --sancov=func sets coverage to function level for example
- --disable-tests don't build tests and corresponding cmdline utils
-EOF
+ cat "$cwd"/help.txt
}
run_verbose()
@@ -84,6 +48,7 @@ verbose=0
fuzz=0
fuzz_tls=0
fuzz_oss=0
+no_local_nspr=0
gyp_params=(--depth="$cwd" --generator-output=".")
nspr_params=()
@@ -121,6 +86,9 @@ while [ $# -gt 0 ]; do
--ct-verif) gyp_params+=(-Dct_verif=1) ;;
--disable-tests) gyp_params+=(-Ddisable_tests=1) ;;
--no-zdefs) gyp_params+=(-Dno_zdefs=1) ;;
+ --system-sqlite) gyp_params+=(-Duse_system_sqlite=1) ;;
+ --with-nspr=?*) set_nspr_path "${1#*=}"; no_local_nspr=1 ;;
+ --system-nspr) set_nspr_path "/usr/include/nspr/:"; no_local_nspr=1 ;;
*) show_help; exit 2 ;;
esac
shift
@@ -207,7 +175,7 @@ fi
mkdir -p "$dist_dir"
echo $target > "$dist_dir"/latest
-if [ "$rebuild_nspr" = 1 ]; then
+if [[ "$rebuild_nspr" = 1 && "$no_local_nspr" = 0 ]]; then
nspr_build "${nspr_params[@]}"
mv -f "$nspr_config".new "$nspr_config"
fi
@@ -216,8 +184,9 @@ if [ "$rebuild_gyp" = 1 ]; then
# These extra arguments aren't used in determining whether to rebuild.
obj_dir="$dist_dir"/$target
gyp_params+=(-Dnss_dist_obj_dir=$obj_dir)
- gyp_params+=(-Dnspr_lib_dir=$obj_dir/lib)
- gyp_params+=(-Dnspr_include_dir=$obj_dir/include/nspr)
+ if [ "$no_local_nspr" = 0 ]; then
+ set_nspr_path "$obj_dir/include/nspr:$obj_dir/lib"
+ fi
run_verbose run_scanbuild gyp -f ninja "${gyp_params[@]}" "$cwd"/nss.gyp