build: tell libc++ to avoid including transitive headers

And apply BOOST_*_NO_DEPRECATED to debug builds only

Change-Id: I4ee56ac53a2ac6d8cd7d449b2792b66d9b811870
diff --git a/.jenkins.d/10-build.sh b/.jenkins.d/10-build.sh
index 199ed20..3bcfe44 100755
--- a/.jenkins.d/10-build.sh
+++ b/.jenkins.d/10-build.sh
@@ -30,7 +30,5 @@
 ./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE
 ./waf --color=yes build
 
-# (tests will be run against the debug version)
-
 # Install
 sudo ./waf --color=yes install
diff --git a/.waf-tools/boost.py b/.waf-tools/boost.py
index a6cdabe..dab6949 100644
--- a/.waf-tools/boost.py
+++ b/.waf-tools/boost.py
@@ -1,6 +1,3 @@
-#!/usr/bin/env python
-# encoding: utf-8
-#
 # partially based on boost.py written by Gernot Vormayr
 # written by Ruediger Sonderfeld <ruediger@c-plusplus.de>, 2008
 # modified by Bjoern Michaelsen, 2008
diff --git a/.waf-tools/coverage.py b/.waf-tools/coverage.py
index cc58165..4ca9740 100644
--- a/.waf-tools/coverage.py
+++ b/.waf-tools/coverage.py
@@ -1,5 +1,3 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
 from waflib import TaskGen
 
 def options(opt):
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index ef97f25..98b3a7f 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -1,5 +1,3 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
 import platform
 from waflib import Configure, Logs, Utils
 
@@ -128,16 +126,16 @@
 
     def getGeneralFlags(self, conf):
         """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
+        return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}
+
+    def getDebugFlags(self, conf):
+        """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode"""
         return {
             'CXXFLAGS': [],
             'LINKFLAGS': [],
             'DEFINES': ['BOOST_ASIO_NO_DEPRECATED', 'BOOST_FILESYSTEM_NO_DEPRECATED'],
         }
 
-    def getDebugFlags(self, conf):
-        """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode"""
-        return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}
-
     def getOptimizedFlags(self, conf):
         """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in optimized mode"""
         return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['NDEBUG']}
@@ -245,6 +243,9 @@
         elif self.getCompilerVersion(conf) >= (15, 0, 0):
             # https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode
             flags['DEFINES'] += ['_LIBCPP_ENABLE_ASSERTIONS=1']
+        # Tell libc++ to avoid including transitive headers
+        # https://libcxx.llvm.org/DesignDocs/HeaderRemovalPolicy.html
+        flags['DEFINES'] += ['_LIBCPP_REMOVE_TRANSITIVE_INCLUDES=1']
         return flags
 
     def getOptimizedFlags(self, conf):
diff --git a/.waf-tools/sanitizers.py b/.waf-tools/sanitizers.py
index a8fe55d..c65d009 100644
--- a/.waf-tools/sanitizers.py
+++ b/.waf-tools/sanitizers.py
@@ -1,4 +1,4 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+# Davide Pesavento (LIP6), 2016
 
 def options(opt):
     opt.add_option('--with-sanitizer', action='store', default='', dest='sanitizers',
diff --git a/.waf-tools/sphinx_build.py b/.waf-tools/sphinx_build.py
index b44a54f..8585352 100644
--- a/.waf-tools/sphinx_build.py
+++ b/.waf-tools/sphinx_build.py
@@ -1,6 +1,3 @@
-#!/usr/bin/env python
-# encoding: utf-8
-
 # inspired by code by Hans-Martin von Gaudecker, 2012
 
 import os
diff --git a/INSTALL.md b/INSTALL.md
index 6835f61..762ba14 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -16,21 +16,29 @@
 
   On Debian and Ubuntu:
 
-      sudo apt install libpcap-dev
+  ```shell
+  sudo apt install libpcap-dev
+  ```
 
   On CentOS and Fedora:
 
-      sudo dnf install libpcap-devel
+  ```shell
+  sudo dnf install libpcap-devel
+  ```
 
 ## Build Steps
 
 To configure, compile, and install ndn-tools, type the following commands
 in ndn-tools source directory:
 
-    ./waf configure
-    ./waf
-    sudo ./waf install
+```shell
+./waf configure
+./waf
+sudo ./waf install
+```
 
 To uninstall:
 
-    sudo ./waf uninstall
+```shell
+sudo ./waf uninstall
+```
diff --git a/README-dev.md b/README-dev.md
index e7acc71..d29f34b 100644
--- a/README-dev.md
+++ b/README-dev.md
@@ -6,24 +6,26 @@
 If you choose the GPL v3, please use the following license boilerplate in all `.hpp`
 and `.cpp` files:
 
-    /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-    /*
-     * Copyright (c) [Year(s)] [Copyright Holder(s)].
-     *
-     * This file is part of ndn-tools (Named Data Networking Essential Tools).
-     * See AUTHORS.md for complete list of ndn-tools authors and contributors.
-     *
-     * ndn-tools is free software: you can redistribute it and/or modify it under the terms
-     * of the GNU General Public License as published by the Free Software Foundation,
-     * either version 3 of the License, or (at your option) any later version.
-     *
-     * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-     * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-     * PURPOSE.  See the GNU General Public License for more details.
-     *
-     * You should have received a copy of the GNU General Public License along with
-     * ndn-tools, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
-     */
+```cpp
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) [Year(s)], [Copyright Holder(s)].
+ *
+ * This file is part of ndn-tools (Named Data Networking Essential Tools).
+ * See AUTHORS.md for complete list of ndn-tools authors and contributors.
+ *
+ * ndn-tools is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * ndn-tools, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+```
 
 ## Directory Structure and Build Script