build: use C++11

Change-Id: I0e58ac4e9cb42d07a9b58125d761875f91c7744c
Refs: #1930
diff --git a/.jenkins.d/10-ndn-cxx.sh b/.jenkins.d/10-ndn-cxx.sh
new file mode 100755
index 0000000..823b816
--- /dev/null
+++ b/.jenkins.d/10-ndn-cxx.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+set -x
+set -e
+
+cd /tmp
+BUILD="no"
+if [ ! -d ndn-cxx ]; then
+    git clone --depth 1 git://github.com/named-data/ndn-cxx
+    cd ndn-cxx
+    BUILD="yes"
+else
+    cd ndn-cxx
+    INSTALLED_VERSION=`git rev-parse HEAD || echo NONE`
+    sudo rm -Rf latest-version
+    git clone --depth 1 git://github.com/named-data/ndn-cxx latest-version
+    cd latest-version
+    LATEST_VERSION=`git rev-parse HEAD || echo UNKNOWN`
+    cd ..
+    rm -Rf latest-version
+    if [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then
+        cd ..
+        sudo rm -Rf ndn-cxx
+        git clone --depth 1 git://github.com/named-data/ndn-cxx
+        cd ndn-cxx
+        BUILD="yes"
+    fi
+fi
+
+sudo rm -Rf /usr/local/include/ndn-cxx
+sudo rm -f /usr/local/lib/libndn-cxx*
+sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
+
+if [ "$BUILD" = "yes" ]; then
+    ./waf distclean --color=yes
+fi
+
+./waf configure --color=yes --without-osx-keychain
+./waf -j1 --color=yes
+sudo ./waf install --color=yes
diff --git a/.jenkins.d/20-build.sh b/.jenkins.d/20-build.sh
new file mode 100755
index 0000000..985216e
--- /dev/null
+++ b/.jenkins.d/20-build.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+set -x
+set -e
+
+git submodule init
+git submodule sync
+git submodule update
+
+COVERAGE=$( python -c "print '--with-coverage' if 'code-coverage' in '$JOB_NAME' else ''" )
+
+# Cleanup
+sudo ./waf -j1 --color=yes distclean
+
+# Configure/build in debug mode
+./waf -j1 --color=yes configure --with-tests --debug
+./waf -j1 --color=yes build
+
+# Cleanup
+sudo ./waf -j1 --color=yes distclean
+
+# Configure/build in optimized mode without tests with precompiled headers
+./waf -j1 --color=yes configure
+./waf -j1 --color=yes build
+
+# Cleanup
+sudo ./waf -j1 --color=yes distclean
+
+# Configure/build in optimized mode
+./waf -j1 --color=yes configure --with-tests $COVERAGE
+./waf -j1 --color=yes build
+
+# (tests will be run against optimized version)
+
+# Install
+sudo ./waf -j1 --color=yes install
diff --git a/.jenkins.d/30-nfd.sh b/.jenkins.d/30-nfd.sh
new file mode 100755
index 0000000..2f139cd
--- /dev/null
+++ b/.jenkins.d/30-nfd.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+set -x
+set -e
+
+cd /tmp
+BUILD="no"
+if [ ! -d NFD ]; then
+    git clone --recursive --depth 1 git://github.com/named-data/NFD
+    cd NFD
+    BUILD="yes"
+else
+    cd NFD
+    INSTALLED_VERSION=`git rev-parse HEAD || echo NONE`
+    sudo rm -Rf latest-version
+    git clone --recursive --depth 1 git://github.com/named-data/NFD latest-version
+    cd latest-version
+    LATEST_VERSION=`git rev-parse HEAD || echo UNKNOWN`
+    cd ..
+    rm -Rf latest-version
+    if [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then
+        cd ..
+        sudo rm -Rf NFD
+        git clone --recursive --depth 1 git://github.com/named-data/NFD
+        cd NFD
+        BUILD="yes"
+    fi
+fi
+
+if [ "$BUILD" = "yes" ]; then
+    sudo ./waf -j1 --color=yes distclean
+fi
+
+git submodule update --init
+
+./waf configure -j1 --color=yes
+./waf -j1 --color=yes
+sudo ./waf install -j1 --color=yes
diff --git a/.jenkins.d/40-tests.sh b/.jenkins.d/40-tests.sh
new file mode 100755
index 0000000..aa90b64
--- /dev/null
+++ b/.jenkins.d/40-tests.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+set -x
+set -e
+
+# Run tests
+sudo rm -Rf ~/.ndn
+mkdir ~/.ndn
+
+sudo cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf
+
+IS_OSX=$( python -c "print 'yes' if 'OSX' in '$NODE_LABELS'.strip().split(' ') else 'no'" )
+IS_LINUX=$( python -c "print 'yes' if 'Linux' in '$NODE_LABELS'.strip().split(' ') else 'no'" )
+
+if [ $IS_OSX = "yes" ]; then
+    security unlock-keychain -p "named-data"
+fi
+
+sudo killall nrd || true
+sudo killall nfd || true
+
+/usr/local/bin/nfd-start
+
+./build/unit-tests -l test_suite
+
+sudo killall nrd || true
+sudo killall nfd || true