summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorTim Taubert <ttaubert@mozilla.com>2017-01-10 10:34:02 -0500
committerTim Taubert <ttaubert@mozilla.com>2017-01-10 10:34:02 -0500
commit92f858d7ec9fc1fd7796254625834d904acd15f8 (patch)
tree2a85b9bb60e66c582efe23aef460a9c8996ed995 /build.sh
parent3fb79d4f945741ee0817fddd2f79cba065d3a7ef (diff)
downloadnss-hg-92f858d7ec9fc1fd7796254625834d904acd15f8.tar.gz
Bug 1328205 - Unbreak building and testing with 'build.sh -c' r=me
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh26
1 files changed, 14 insertions, 12 deletions
diff --git a/build.sh b/build.sh
index dc0e26b64..ede4b7383 100755
--- a/build.sh
+++ b/build.sh
@@ -158,9 +158,6 @@ dist_dir="$cwd"/../dist
dist_dir=$(mkdir -p "$dist_dir"; cd "$dist_dir"; pwd -P)
gyp_params+=(-Dnss_dist_dir="$dist_dir")
-# save the chosen target
-echo $target > "$dist_dir"/latest
-
# pass on CC and CCC to scanbuild
if [ "${#scanbuild[@]}" -gt 0 ]; then
if [ -n "$CC" ]; then
@@ -185,12 +182,26 @@ normalize_config()
gyp_config="$cwd"/out/gyp_config
nspr_config="$cwd"/out/$target/nspr_config
+
# If we don't have a build directory make sure that we rebuild.
if [ ! -d "$target_dir" ]; then
rebuild_nspr=1
rebuild_gyp=1
fi
+# -c = clean first
+if [ "$clean" = 1 ]; then
+ rebuild_gyp=1
+ rebuild_nspr=1
+ nspr_clean
+ rm -rf "$cwd"/out
+ rm -rf "$dist_dir"
+ mkdir -p "$dist_dir"
+fi
+
+# save the chosen target
+echo $target > "$dist_dir"/latest
+
normalize_config "$gyp_config".new "${gyp_params[@]}"
if ! diff -q "$gyp_config".new "$gyp_config" >/dev/null 2>&1; then
rebuild_gyp=1
@@ -204,15 +215,6 @@ if [ ! -d "$dist_dir"/$target ] || \
rebuild_nspr=1
fi
-# -c = clean first
-if [ "$clean" = 1 ]; then
- rebuild_gyp=1
- rebuild_nspr=1
- nspr_clean
- rm -rf "$cwd"/out
- rm -rf "$dist_dir"
-fi
-
if [ "$rebuild_nspr" = 1 ]; then
nspr_build "${nspr_params[@]}"
mv -f "$nspr_config".new "$nspr_config"