ci: update Travis configuration

 * Add testing on arm64, ppc64le, and s390x with select compiler versions
 * Allow disabling the headers check by setting DISABLE_HEADERS_CHECK
 * Drop all versions of gcc < 7 and clang < 5
 * Add clang 11 (development branch)
 * Reenable ASan on Linux with gcc 9 and clang 7, the upstream
   bugs have been fixed; ASan on clang 8 remains disabled
 * Drop Xcode 9.2 (macOS 10.12 is no longer supported)
 * Upgrade Xcode 11 to 11.3
 * Remove USE_OPENSSL_1_1 and always build with openssl 1.1.1,
   since that's the only version available on Homebrew now
 * Workaround issue with missing /usr/local/opt/openssl on macOS
 * Various cleanups

Change-Id: I90e7d61d176b60c1e6b90d2374a7a51dd1deabb3
diff --git a/.jenkins.d/40-headers-check.sh b/.jenkins.d/40-headers-check.sh
new file mode 100755
index 0000000..1258646
--- /dev/null
+++ b/.jenkins.d/40-headers-check.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+
+# It's intentional not to use `set -x`, because this script explicitly prints useful information
+# and should not run in trace mode.
+# It's intentional not to use `set -e`, because this script wants to check all headers
+# (similar to running all test cases), instead of failing at the first error.
+
+if [[ -n $DISABLE_HEADERS_CHECK ]]; then
+  echo 'Skipping headers check.'
+  exit 0
+fi
+
+CXX=${CXX:-g++}
+STD=-std=c++14
+CXXFLAGS="-O2 -Wall -Wno-unused-const-variable -Wno-unused-local-typedef $(pkg-config --cflags libndn-cxx)"
+INCLUDEDIR="$(pkg-config --variable=includedir libndn-cxx)"/ndn-cxx
+
+echo "Using: $CXX $STD $CXXFLAGS"
+
+NCHECKED=0
+NERRORS=0
+while IFS= read -r -d '' H; do
+  echo "Checking header ${H#${INCLUDEDIR}/}"
+  "$CXX" -xc++ $STD $CXXFLAGS -c -o /dev/null "$H"
+  [[ $? -eq 0 ]] || ((NERRORS++))
+  ((NCHECKED++))
+done < <(find "$INCLUDEDIR" -name '*.hpp' -type f -print0 2>/dev/null)
+
+if [[ $NCHECKED -eq 0 ]]; then
+  echo 'No headers found. Is ndn-cxx installed?'
+  exit 1
+else
+  echo "$NCHECKED headers checked."
+fi
+
+if [[ $NERRORS -gt 0 ]]; then
+  echo "$NERRORS headers could not be compiled."
+  exit 1
+fi