build+ci: Update default build flags and CI scripts

This commit also fixes a few compilation errors.

Change-Id: I19bcbe360423dad2532b9caee4edcdc6356b0075
diff --git a/.jenkins.d/40-coverage.sh b/.jenkins.d/40-coverage.sh
index ccbb62e..e6ecdf3 100755
--- a/.jenkins.d/40-coverage.sh
+++ b/.jenkins.d/40-coverage.sh
@@ -2,9 +2,10 @@
 set -x
 set -e
 
-IS_COVR=$( python -c "print 'yes' if 'code-coverage' in '$JOB_NAME' else 'no'" )
+JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+source "$JDIR"/util.sh
 
-if [[ $IS_COVR == "yes" ]]; then
+if [[ "$JOB_NAME" == *"code-coverage" ]]; then
   BASE="`pwd | sed -e 's|/|\\\/|g'`\\"
   (cd build && gcovr -x -f $BASE/src -r ../ -o coverage.xml -b ./)
 fi