Update CI scripts

Synced from ndn-tools

Change-Id: I1faf341ab032a2e5ca2a70e2c1142379581fba34
diff --git a/.jenkins.d/10-build.sh b/.jenkins.d/10-build.sh
index ef94d90..b902b1e 100755
--- a/.jenkins.d/10-build.sh
+++ b/.jenkins.d/10-build.sh
@@ -6,42 +6,39 @@
 
 set -x
 
-git submodule init
-git submodule sync
-git submodule update
+if [[ $JOB_NAME == *"code-coverage" ]]; then
+    COVERAGE="--with-coverage"
+elif [[ -z $DISABLE_ASAN ]]; then
+    ASAN="--with-sanitizer=address"
+fi
 
 # Cleanup
-sudo ./waf -j1 --color=yes distclean
+sudo env "PATH=$PATH" ./waf --color=yes distclean
 
 if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
   # Configure/build in optimized mode with tests
-  ./waf -j1 --color=yes configure --with-tests
-  ./waf -j1 --color=yes build
+  ./waf --color=yes configure --with-tests
+  ./waf --color=yes build -j${WAF_JOBS:-1}
 
   # Cleanup
-  sudo ./waf -j1 --color=yes distclean
+  sudo env "PATH=$PATH" ./waf --color=yes distclean
 
   # Configure/build in optimized mode without tests
-  ./waf -j1 --color=yes configure
-  ./waf -j1 --color=yes build
+  ./waf --color=yes configure
+  ./waf --color=yes build -j${WAF_JOBS:-1}
 
   # Cleanup
-  sudo ./waf -j1 --color=yes distclean
+  sudo env "PATH=$PATH" ./waf --color=yes distclean
 fi
 
 # Configure/build in debug mode with tests
-if [[ $JOB_NAME == *"code-coverage" ]]; then
-    COVERAGE="--with-coverage"
-elif ! has OSX-10.9 $NODE_LABELS && ! has OSX-10.11 $NODE_LABELS; then
-    ASAN="--with-sanitizer=address"
-fi
-./waf -j1 --color=yes configure --debug --with-tests --with-sanitizer=address $COVERAGE $ASAN
-./waf -j1 --color=yes build
+./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
+./waf --color=yes build -j${WAF_JOBS:-1}
 
 # (tests will be run against debug version)
 
 # Install
-sudo ./waf -j1 --color=yes install
+sudo env "PATH=$PATH" ./waf --color=yes install
 
 if has Linux $NODE_LABELS; then
     sudo ldconfig