build: add CentOS 8 support; drop CentOS 7

Refs: #5040, #5087
Change-Id: I6dcc5e9ee6b4839a6b3f15f1ad6dabf140301ae4
diff --git a/.jenkins b/.jenkins
index 934aceb..b368a74 100755
--- a/.jenkins
+++ b/.jenkins
@@ -1,5 +1,8 @@
 #!/usr/bin/env bash
 set -e
+source .jenkins.d/util.sh
+
+export WAF_JOBS=${WAF_JOBS:-1}
 
 nanos() {
     # Cannot use date(1) because macOS does not support %N format specifier
diff --git a/.jenkins.d/00-deps.sh b/.jenkins.d/00-deps.sh
index 187f595..52a8a97 100755
--- a/.jenkins.d/00-deps.sh
+++ b/.jenkins.d/00-deps.sh
@@ -1,10 +1,5 @@
 #!/usr/bin/env bash
-set -e
-
-JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-source "$JDIR"/util.sh
-
-set -x
+set -ex
 
 if has OSX $NODE_LABELS; then
     FORMULAE=(boost openssl pkg-config)
@@ -27,28 +22,17 @@
         brew install "${FORMULAE[@]}"
         brew cleanup
     fi
-fi
 
-if has Ubuntu $NODE_LABELS; then
+elif has Ubuntu $NODE_LABELS; then
     sudo apt-get -qq update
-    sudo apt-get -qy install build-essential pkg-config python3-minimal \
+    sudo apt-get -qy install g++ pkg-config python3-minimal \
                              libboost-all-dev libssl-dev libsqlite3-dev
 
     if [[ $JOB_NAME == *"code-coverage" ]]; then
         sudo apt-get -qy install gcovr lcov libgd-perl
     fi
-fi
 
-if has CentOS-7 $NODE_LABELS; then
-    sudo yum -y install yum-utils pkgconfig \
-                        openssl-devel libtranslit-icu \
-                        python-devel sqlite-devel \
-                        devtoolset-7-libasan-devel \
-                        devtoolset-7-liblsan-devel
-    sudo yum -y groupinstall 'Development Tools'
-
-    svn checkout https://github.com/cmscaltech/sandie-ndn/trunk/packaging/RPMS/x86_64/boost1_58_0
-    pushd boost1_58_0 >/dev/null
-    sudo rpm -Uv --replacepkgs --replacefiles boost-devel* boost-license* libboost_*
-    popd >/dev/null
+elif has CentOS-8 $NODE_LABELS; then
+    sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
+                        boost-devel openssl-devel sqlite-devel
 fi
diff --git a/.jenkins.d/01-ndn-cxx.sh b/.jenkins.d/01-ndn-cxx.sh
index f10956c..6f50dba 100755
--- a/.jenkins.d/01-ndn-cxx.sh
+++ b/.jenkins.d/01-ndn-cxx.sh
@@ -1,10 +1,5 @@
 #!/usr/bin/env bash
-set -e
-
-JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-source "$JDIR"/util.sh
-
-set -x
+set -ex
 
 sudo rm -f /usr/local/bin/ndnsec*
 sudo rm -fr /usr/local/include/ndn-cxx
diff --git a/.jenkins.d/10-build.sh b/.jenkins.d/10-build.sh
index 024b6e0..dd63348 100755
--- a/.jenkins.d/10-build.sh
+++ b/.jenkins.d/10-build.sh
@@ -1,14 +1,14 @@
 #!/usr/bin/env bash
-set -e
-
-JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-source "$JDIR"/util.sh
-
-set -x
+set -ex
 
 git submodule sync
 git submodule update --init
 
+if has CentOS-8 $NODE_LABELS; then
+    # https://bugzilla.redhat.com/show_bug.cgi?id=1721553
+    PCH="--without-pch"
+fi
+
 if [[ $JOB_NAME == *"code-coverage" ]]; then
     COVERAGE="--with-coverage"
 elif [[ -z $DISABLE_ASAN ]]; then
@@ -18,28 +18,31 @@
 if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
     # Build static library in release mode with tests and without precompiled headers
     ./waf --color=yes configure --enable-static --disable-shared --with-tests --without-pch
-    ./waf --color=yes build -j${WAF_JOBS:-1}
+    ./waf --color=yes build -j$WAF_JOBS
 
     # Cleanup
     ./waf --color=yes distclean
 
     # Build static and shared library in release mode without tests
-    ./waf --color=yes configure --enable-static --enable-shared
-    ./waf --color=yes build -j${WAF_JOBS:-1}
+    ./waf --color=yes configure --enable-static --enable-shared $PCH
+    ./waf --color=yes build -j$WAF_JOBS
 
     # Cleanup
     ./waf --color=yes distclean
 fi
 
 # Build shared library in debug mode with tests and examples
-./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE
-./waf --color=yes build -j${WAF_JOBS:-1}
+./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE $PCH
+./waf --color=yes build -j$WAF_JOBS
 
 # (tests will be run against the debug version)
 
 # Install
 sudo_preserve_env PATH -- ./waf --color=yes install
 
+if has CentOS-8 $NODE_LABELS; then
+    sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
+fi
 if has Linux $NODE_LABELS; then
     sudo ldconfig
 fi
diff --git a/.jenkins.d/20-tests.sh b/.jenkins.d/20-tests.sh
index 9c30a19..d4b9652 100755
--- a/.jenkins.d/20-tests.sh
+++ b/.jenkins.d/20-tests.sh
@@ -1,13 +1,8 @@
 #!/usr/bin/env bash
-set -e
-
-JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-source "$JDIR"/util.sh
-
-set -x
+set -ex
 
 # Prepare environment
-rm -Rf ~/.ndn
+rm -rf ~/.ndn
 
 if has OSX $NODE_LABELS; then
     security unlock-keychain -p named-data
@@ -30,13 +25,13 @@
     fi
 }
 
+# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
 ASAN_OPTIONS="color=always"
-ASAN_OPTIONS+=":detect_stack_use_after_return=true"
-ASAN_OPTIONS+=":check_initialization_order=true"
-ASAN_OPTIONS+=":strict_init_order=true"
-ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1"
-ASAN_OPTIONS+=":detect_container_overflow=false"
-ASAN_OPTIONS+=":strict_string_checks=true"
+ASAN_OPTIONS+=":check_initialization_order=1"
+ASAN_OPTIONS+=":detect_stack_use_after_return=1"
+ASAN_OPTIONS+=":strict_init_order=1"
+ASAN_OPTIONS+=":strict_string_checks=1"
+ASAN_OPTIONS+=":detect_invalid_pointer_pairs=2"
 ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
 export ASAN_OPTIONS
 
diff --git a/.jenkins.d/30-coverage.sh b/.jenkins.d/30-coverage.sh
index 46d3cf0..0363b9e 100755
--- a/.jenkins.d/30-coverage.sh
+++ b/.jenkins.d/30-coverage.sh
@@ -1,10 +1,5 @@
 #!/usr/bin/env bash
-set -e
-
-JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-source "$JDIR"/util.sh
-
-set -x
+set -ex
 
 if [[ $JOB_NAME == *"code-coverage" ]]; then
     gcovr --object-directory=build \
diff --git a/.jenkins.d/40-headers-check.sh b/.jenkins.d/40-headers-check.sh
index 1258646..486bb4e 100755
--- a/.jenkins.d/40-headers-check.sh
+++ b/.jenkins.d/40-headers-check.sh
@@ -10,9 +10,13 @@
   exit 0
 fi
 
+if has CentOS-8 $NODE_LABELS; then
+  export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
+fi
+
 CXX=${CXX:-g++}
 STD=-std=c++14
-CXXFLAGS="-O2 -Wall -Wno-unused-const-variable -Wno-unused-local-typedef $(pkg-config --cflags libndn-cxx)"
+CXXFLAGS="-O2 -Wall -Wno-unneeded-internal-declaration -Wno-unused-const-variable $(pkg-config --cflags libndn-cxx)"
 INCLUDEDIR="$(pkg-config --variable=includedir libndn-cxx)"/ndn-cxx
 
 echo "Using: $CXX $STD $CXXFLAGS"
diff --git a/.jenkins.d/README.md b/.jenkins.d/README.md
index 7c78349..9087f0f 100644
--- a/.jenkins.d/README.md
+++ b/.jenkins.d/README.md
@@ -1,33 +1,25 @@
-CONTINUOUS INTEGRATION SCRIPTS
-==============================
+# CONTINUOUS INTEGRATION SCRIPTS
 
-Environment Variables Used in Build Scripts
--------------------------------------------
+## Environment Variables Used in Build Scripts
 
-- `NODE_LABELS`: the variable defines a list of OS properties.  The set values are used by the
-  build scripts to select proper behavior for different OS.
+- `NODE_LABELS`: space-separated list of platform properties. The included values are used by
+  the build scripts to select the proper behavior for different operating systems and versions.
 
-  The list should include at least `[OS_TYPE]`, `[DISTRO_TYPE]`, and `[DISTRO_VERSION]`.
+  The list should normally contain `[OS_TYPE]`, `[DISTRO_TYPE]`, and `[DISTRO_VERSION]`.
 
-  Possible values for Linux:
+  Example values:
 
-  * `[OS_TYPE]`: `Linux`
-  * `[DISTRO_TYPE]`: `Ubuntu`
-  * `[DISTRO_VERSION]`: `Ubuntu-16.04`, `Ubuntu-18.04`
+  - `[OS_TYPE]`: `Linux`, `OSX`
+  - `[DISTRO_TYPE]`: `Ubuntu`, `CentOS`
+  - `[DISTRO_VERSION]`: `Ubuntu-16.04`, `Ubuntu-18.04`, `CentOS-8`, `OSX-10.14`, `OSX-10.15`
 
-  Possible values for macOS:
-
-  * `[OS_TYPE]`: `OSX`
-  * `[DISTRO_TYPE]`: `OSX` (can be absent)
-  * `[DISTRO_VERSION]`: `OSX-10.12`, `OSX-10.13`, `OSX-10.14`
-
-- `JOB_NAME`: optional variable to define type of the job.  Depending on the defined job type,
+- `JOB_NAME`: optional variable that defines the type of build job. Depending on the job type,
   the build scripts can perform different tasks.
 
   Possible values:
 
-  * empty: default build process
-  * `code-coverage` (Ubuntu Linux is assumed): debug build with tests and code coverage analysis
-  * `limited-build`: only a single debug build with tests
+  - empty: default build task
+  - `code-coverage`: debug build with tests and code coverage analysis (Ubuntu Linux is assumed)
+  - `limited-build`: only a single debug build with tests
 
-- `WAF_JOBS`: number of parallel build jobs used by waf, defaults to 1.
+- `WAF_JOBS`: number of parallel build threads used by waf, defaults to 1.
diff --git a/.jenkins.d/util.sh b/.jenkins.d/util.sh
index 8ddc4ba..8077a74 100644
--- a/.jenkins.d/util.sh
+++ b/.jenkins.d/util.sh
@@ -16,6 +16,7 @@
     set ${saved_xtrace}
     return ${ret}
 }
+export -f has
 
 sudo_preserve_env() {
     local saved_xtrace
@@ -35,3 +36,4 @@
     set ${saved_xtrace}
     sudo env "${vars[@]}" "$@"
 }
+export -f sudo_preserve_env
diff --git a/docs/INSTALL.rst b/docs/INSTALL.rst
index aa43bd6..5be8a19 100644
--- a/docs/INSTALL.rst
+++ b/docs/INSTALL.rst
@@ -6,22 +6,21 @@
 Supported platforms
 -------------------
 
-ndn-cxx uses continuous integration and has been tested on the following
-platforms:
+ndn-cxx uses continuous integration and has been tested on the following platforms:
 
--  Ubuntu 16.04 (amd64, armhf, i386)
--  Ubuntu 18.04 (amd64)
+-  Ubuntu 16.04 (amd64)
+-  Ubuntu 18.04 (amd64, armhf, i386)
 -  Ubuntu 19.10 (amd64)
 -  macOS 10.13
 -  macOS 10.14
 -  macOS 10.15
--  CentOS 7 (with gcc 7 and boost 1.58.0)
+-  CentOS 8
 
 ndn-cxx is known to work on the following platforms, although they are not officially
 supported:
 
 -  Debian >= 9
--  Fedora >= 24
+-  Fedora >= 29
 -  Gentoo Linux
 -  Raspbian >= 2017-08-16
 -  FreeBSD >= 11.3
@@ -46,13 +45,13 @@
 
     In a terminal, enter::
 
-        sudo apt install build-essential pkg-config python3-minimal libboost-all-dev libssl-dev libsqlite3-dev
+        sudo apt install g++ pkg-config python3-minimal libboost-all-dev libssl-dev libsqlite3-dev
 
-- Fedora
+- CentOS and Fedora
 
     In a terminal, enter::
 
-        sudo yum install gcc-g++ boost-devel openssl-devel sqlite-devel
+        sudo dnf install gcc-c++ pkgconf-pkg-config python3 boost-devel openssl-devel sqlite-devel
 
 - macOS
 
@@ -92,10 +91,11 @@
     sudo apt install doxygen graphviz python3-pip
     sudo pip3 install sphinx sphinxcontrib-doxylink
 
-- On Fedora::
+- On CentOS and Fedora::
 
-    sudo yum install doxygen graphviz python-sphinx
-    sudo pip install sphinxcontrib-doxylink
+    sudo dnf config-manager --enable PowerTools  # on CentOS only
+    sudo dnf install doxygen graphviz python3-pip
+    pip3 install --user sphinx sphinxcontrib-doxylink
 
 - On macOS::
 
@@ -118,7 +118,7 @@
 
 To build in a terminal, change directory to the ndn-cxx root, then enter::
 
-    ./waf configure
+    ./waf configure  # on CentOS, add --without-pch
     ./waf
     sudo ./waf install
 
@@ -189,7 +189,7 @@
     ./waf configure --with-examples
     ./waf
     sudo ./waf install
-    sudo ldconfig # (on Linux only)
+    sudo ldconfig  # on Linux only
 
 To run examples::
 
@@ -208,7 +208,7 @@
     cp examples/consumer.cpp examples/my-new-consumer-app.cpp
     ./waf
     sudo ./waf install
-    sudo ldconfig # (on Linux only)
+    sudo ldconfig  # on Linux only
     ./build/examples/my-new-consumer-app
 
 Debug symbols
@@ -234,10 +234,10 @@
     # Full set of documentation (tutorials + API) in build/docs
     ./waf docs
 
-    # Only tutorials in `build/docs`
+    # Only tutorials in build/docs
     ./waf sphinx
 
-    # Only API docs in `build/docs/doxygen`
+    # Only API docs in build/docs/doxygen
     ./waf doxygen
 
 Manpages are automatically created and installed during the normal build
@@ -259,7 +259,7 @@
     ./waf configure --debug --with-tests
     ./waf
     sudo ./waf install
-    sudo ldconfig # (on Linux only)
+    sudo ldconfig  # on Linux only
 
 In the development build most compiler optimizations are disabled by
 default and all warnings are treated as errors. The default behavior can