build: Enabling ability to use precompiled headers and some other build fixes

Change-Id: If2b216e5674fc762338929026733f3dcb801bb1b
Refs: #1588
diff --git a/wscript b/wscript
index 47aee6c..c43a556 100644
--- a/wscript
+++ b/wscript
@@ -33,7 +33,7 @@
 def options(opt):
     opt.load(['compiler_cxx', 'gnu_dirs'])
     opt.load(['boost', 'unix-socket', 'dependency-checker', 'websocket',
-              'default-compiler-flags', 'coverage',
+              'default-compiler-flags', 'coverage', 'pch',
               'doxygen', 'sphinx_build'],
              tooldir=['.waf-tools'])
 
@@ -55,7 +55,7 @@
 
 def configure(conf):
     conf.load(['compiler_cxx', 'gnu_dirs',
-               'default-compiler-flags',
+               'default-compiler-flags', 'pch',
                'boost', 'dependency-checker', 'websocket',
                'doxygen', 'sphinx_build'])
 
@@ -126,6 +126,7 @@
         use='version BOOST NDN_CXX LIBRT',
         includes='. core',
         export_includes='. core',
+        pch='common-pch.hpp',
         )
 
     nfd_objects = bld(
@@ -140,6 +141,7 @@
         use='core-objects',
         includes='daemon websocketpp',
         export_includes='daemon',
+        pch='common-pch.hpp',
         )
 
     if bld.env['HAVE_LIBPCAP']: