build: Conditional check for C++11 and add ability to use system's boost instead of bundled version

1. C++11 is enabled by default and can be disabled with
--without-c++11 (or --with-c++11=no)

2. Use of system's boost libraries can be requested with
--with-system-boost.  By default, the bundled version of boost is used
when necessary.

Refs #1065 (http://redmine.named-data.net/issues/1065)

Change-Id: I823b67c62764c80476aedf41335dd69e7687f47b
diff --git a/include/ndn-cpp/common.hpp b/include/ndn-cpp/common.hpp
index 1af6cf2..9a79f62 100644
--- a/include/ndn-cpp/common.hpp
+++ b/include/ndn-cpp/common.hpp
@@ -12,16 +12,30 @@
 // common.h include ndn-cpp-config.h.
 #include "c/common.h"
 
+#if NDN_CPP_HAVE_CXX11
 // Depending on where ./configure found shared_ptr, define the ptr_lib namespace.
 // We always use ndn::ptr_lib.
-#if NDN_CPP_HAVE_STD_SHARED_PTR
+// #if NDN_CPP_HAVE_STD_SHARED_PTR
 #include <memory>
 namespace ndn { namespace ptr_lib = std; }
-#elif NDN_CPP_HAVE_BOOST_SHARED_PTR
+
+// #if NDN_CPP_HAVE_STD_FUNCTION
+#include <functional>
+namespace ndn { namespace func_lib = std; }
+
+#elif NDN_CPP_USE_SYSTEM_BOOST
+
+// #if NDN_CPP_HAVE_BOOST_SHARED_PTR
 #include <boost/shared_ptr.hpp>
 #include <boost/make_shared.hpp>
 namespace ndn { namespace ptr_lib = boost; }
-#else
+
+// #if NDN_CPP_HAVE_BOOST_FUNCTION
+#include <boost/function.hpp>
+#include <boost/bind.hpp>
+namespace ndn { namespace func_lib = boost; }
+
+#else // use embedded boost headers
 /* Use the boost header files in this distribution that were extracted with:
 cd <BOOST DEVELOPMENT DIRECTORY WITH boost SUBDIRECTORY>
 dist/bin/bcp --namespace=ndnboost shared_ptr make_shared weak_ptr function bind any iostreams <NDN-CPP ROOT>/include
@@ -46,22 +60,12 @@
 #include <ndnboost/shared_ptr.hpp>
 #include <ndnboost/make_shared.hpp>
 namespace ndn { namespace ptr_lib = ndnboost; }
-#endif
 
-// Depending on where ./configure found function, define the func_lib namespace.
-// We always use ndn::func_lib.
-#if NDN_CPP_HAVE_STD_FUNCTION
-#include <functional>
-namespace ndn { namespace func_lib = std; }
-#elif NDN_CPP_HAVE_BOOST_FUNCTION
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
-namespace ndn { namespace func_lib = boost; }
-#else
 // Use the boost header files in this distribution that were extracted as above:
 #include <ndnboost/function.hpp>
 #include <ndnboost/bind.hpp>
 namespace ndn { namespace func_lib = ndnboost; }
+
 #endif
 
 namespace ndn {