build: various updates

 * Upgrade waf to 2.0.14
 * Sync default compiler flags with ndn-cxx

Change-Id: I9e5bbbc7c13d1770e6ac0b0b5f5c0fbe17f89f23
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index e690290..9e045c3 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -20,9 +20,9 @@
                       'The minimum supported gcc version is 5.3.0.')
         conf.flags = GccFlags()
     elif cxx == 'clang':
-        if ccver < (3, 5, 0):
+        if ccver < (3, 6, 0):
             errmsg = ('The version of clang you are using is too old.\n'
-                      'The minimum supported clang version is 3.5.0.')
+                      'The minimum supported clang version is 3.6.0.')
         conf.flags = ClangFlags()
     else:
         warnmsg = 'Note: %s compiler is unsupported' % cxx
@@ -129,6 +129,10 @@
     def getGeneralFlags(self, conf):
         flags = super(GccBasicFlags, self).getGeneralFlags(conf)
         flags['CXXFLAGS'] += ['-std=c++14']
+        if Utils.unversioned_sys_platform() == 'linux':
+            flags['LINKFLAGS'] += ['-fuse-ld=gold']
+        elif Utils.unversioned_sys_platform() == 'freebsd':
+            flags['LINKFLAGS'] += ['-fuse-ld=lld']
         return flags
 
     def getDebugFlags(self, conf):
@@ -145,7 +149,7 @@
                               '-Wno-error=maybe-uninitialized', # Bug #1615
                               '-Wno-unused-parameter',
                               ]
-        flags['LINKFLAGS'] += ['-fuse-ld=gold', '-Wl,-O1']
+        flags['LINKFLAGS'] += ['-Wl,-O1']
         return flags
 
     def getOptimizedFlags(self, conf):
@@ -158,7 +162,7 @@
                               '-Wnon-virtual-dtor',
                               '-Wno-unused-parameter',
                               ]
-        flags['LINKFLAGS'] += ['-fuse-ld=gold', '-Wl,-O1']
+        flags['LINKFLAGS'] += ['-Wl,-O1']
         return flags
 
 class GccFlags(GccBasicFlags):
@@ -179,6 +183,8 @@
             # Bug #4296
             flags['CXXFLAGS'] += [['-isystem', '/usr/local/include'], # for Homebrew
                                   ['-isystem', '/opt/local/include']] # for MacPorts
+        if Utils.unversioned_sys_platform() == 'freebsd':
+            flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']] # Bug #4790
         return flags
 
     def getDebugFlags(self, conf):
@@ -186,15 +192,13 @@
         flags['CXXFLAGS'] += ['-fcolor-diagnostics',
                               '-Wextra-semi',
                               '-Wundefined-func-template',
-                              '-Wno-error=deprecated-register',
-                              '-Wno-error=infinite-recursion', # Bug #3358
-                              '-Wno-error=keyword-macro', # Bug #3235
-                              '-Wno-error=unneeded-internal-declaration', # Bug #1588
                               '-Wno-unused-local-typedef', # Bugs #2657 and #3209
                               ]
         version = self.getCompilerVersion(conf)
         if version < (3, 9, 0) or (Utils.unversioned_sys_platform() == 'darwin' and version < (8, 1, 0)):
             flags['CXXFLAGS'] += ['-Wno-unknown-pragmas']
+        if version < (6, 0, 0):
+            flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721
         return flags
 
     def getOptimizedFlags(self, conf):
@@ -207,4 +211,6 @@
         version = self.getCompilerVersion(conf)
         if version < (3, 9, 0) or (Utils.unversioned_sys_platform() == 'darwin' and version < (8, 1, 0)):
             flags['CXXFLAGS'] += ['-Wno-unknown-pragmas']
+        if version < (6, 0, 0):
+            flags['CXXFLAGS'] += ['-Wno-missing-braces'] # Bug #4721
         return flags