build: require gcc >= 5.3 and switch to C++14

Change-Id: Iba0a1fc8e4a0a0d5ec4150d4dca96792a73237e3
Refs: #3076, #4462
diff --git a/.jenkins.d/00-deps.sh b/.jenkins.d/00-deps.sh
index 765338d..c362297 100755
--- a/.jenkins.d/00-deps.sh
+++ b/.jenkins.d/00-deps.sh
@@ -9,13 +9,12 @@
 if has OSX $NODE_LABELS; then
     brew update
     brew upgrade
-    brew install boost pkg-config cryptopp openssl log4cxx
+    brew install pkg-config boost openssl
     brew cleanup
 fi
 
 if has Ubuntu $NODE_LABELS; then
     sudo apt-get -qq update
     sudo apt-get -qq install build-essential pkg-config libboost-all-dev \
-                             libcrypto++-dev libsqlite3-dev libssl-dev \
-                             liblog4cxx10-dev
+                             libsqlite3-dev libssl-dev
 fi
diff --git a/.jenkins.d/10-ndn-cxx.sh b/.jenkins.d/10-ndn-cxx.sh
index e5f7585..c9e2a63 100755
--- a/.jenkins.d/10-ndn-cxx.sh
+++ b/.jenkins.d/10-ndn-cxx.sh
@@ -8,13 +8,25 @@
 
 pushd "${CACHE_DIR:-/tmp}" >/dev/null
 
-INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
+INSTALLED_VERSION=
+if has OSX $NODE_LABELS; then
+    BOOST=$(brew ls --versions boost)
+    OLD_BOOST=$(cat boost.txt || :)
+    if [[ $OLD_BOOST != $BOOST ]]; then
+        echo "$BOOST" > boost.txt
+        INSTALLED_VERSION=NONE
+    fi
+fi
+
+if [[ -z $INSTALLED_VERSION ]]; then
+    INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE)
+fi
 
 sudo rm -Rf ndn-cxx-latest
 
 git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
 
-LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
+LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
 
 if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
     sudo rm -Rf ndn-cxx
@@ -23,21 +35,22 @@
     sudo rm -Rf ndn-cxx-latest
 fi
 
-sudo rm -Rf /usr/local/include/ndn-cxx
+sudo rm -f /usr/local/bin/ndnsec*
+sudo rm -fr /usr/local/include/ndn-cxx
 sudo rm -f /usr/local/lib/libndn-cxx*
-sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
+sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx.pc
 
 pushd ndn-cxx >/dev/null
 
-./waf -j1 --color=yes configure --enable-shared --disable-static --without-osx-keychain
-./waf -j1 --color=yes build
-sudo ./waf -j1 --color=yes install
+./waf configure --color=yes --enable-shared --disable-static --without-osx-keychain
+./waf build --color=yes -j${WAF_JOBS:-1}
+sudo env "PATH=$PATH" ./waf install --color=yes
 
 popd >/dev/null
 popd >/dev/null
 
 if has Linux $NODE_LABELS; then
     sudo ldconfig
-elif has FreeBSD $NODE_LABELS; then
-    sudo ldconfig -a
+elif has FreeBSD10 $NODE_LABELS; then
+    sudo ldconfig -m
 fi
diff --git a/.jenkins.d/README.md b/.jenkins.d/README.md
index b1bd93a..39fa40b 100644
--- a/.jenkins.d/README.md
+++ b/.jenkins.d/README.md
@@ -13,13 +13,13 @@
 
   * `[OS_TYPE]`: `Linux`
   * `[DISTRO_TYPE]`: `Ubuntu`
-  * `[DISTRO_VERSION]`: `Ubuntu-14.04`, `Ubuntu-16.04`
+  * `[DISTRO_VERSION]`: `Ubuntu-16.04`, `Ubuntu-18.04`
 
   Possible values for OS X / macOS:
 
   * `[OS_TYPE]`: `OSX`
   * `[DISTRO_TYPE]`: `OSX` (can be absent)
-  * `[DISTRO_VERSION]`: `OSX-10.10`, `OSX-10.11`, `OSX-10.12`
+  * `[DISTRO_VERSION]`: `OSX-10.11`, `OSX-10.12`, `OSX-10.13`
 
 - `JOB_NAME`: optional variable to define type of the job.  Depending on the defined job type,
   the build scripts can perform different tasks.
@@ -29,3 +29,8 @@
   * empty: default build process
   * `code-coverage` (Linux OS is assumed): debug build with tests and code coverage analysis
   * `limited-build`: only a single debug build with tests
+
+- `CACHE_DIR`: the variable defines a path to folder containing cached files from previous builds,
+  e.g., a compiled version of ndn-cxx library.  If not set, `/tmp` is used.
+
+- `WAF_JOBS`: number of parallel build jobs used by waf, defaults to 1.