make: In ndn-cpp-config.h, to avoid polluting the global name space, generate NDN_CPP_HAVE_BOOST_FUNCTION etc. instead of HAVE_BOOST_FUNCTION, etc.
diff --git a/ndn-cpp/c/util/ndn_memory.c b/ndn-cpp/c/util/ndn_memory.c
index ba3fc2e..8051864 100644
--- a/ndn-cpp/c/util/ndn_memory.c
+++ b/ndn-cpp/c/util/ndn_memory.c
@@ -6,7 +6,7 @@
 
 #include "ndn_memory.h"
 
-#if !HAVE_MEMCMP
+#if !NDN_CPP_HAVE_MEMCMP
 int ndn_memcmp(uint8_t *buf1, uint8_t *buf2, size_t len)
 {
   size_t i;
@@ -24,7 +24,7 @@
 int ndn_memcmp_stub_to_avoid_empty_file_warning = 0;
 #endif
 
-#if !HAVE_MEMCPY
+#if !NDN_CPP_HAVE_MEMCPY
 void ndn_memcpy(uint8_t *dest, uint8_t *src, size_t len)
 {
   size_t i;
@@ -36,7 +36,7 @@
 int ndn_memcpy_stub_to_avoid_empty_file_warning = 0;
 #endif
 
-#if !HAVE_MEMSET
+#if !NDN_CPP_HAVE_MEMSET
 void ndn_memset(uint8_t *dest, int val, size_t len)
 {
   size_t i;
diff --git a/ndn-cpp/c/util/ndn_memory.h b/ndn-cpp/c/util/ndn_memory.h
index abf3bcf..9d23e2d 100644
--- a/ndn-cpp/c/util/ndn_memory.h
+++ b/ndn-cpp/c/util/ndn_memory.h
@@ -5,7 +5,7 @@
  */
 
 /*
- * Based on HAVE_MEMCPY and HAVE_MEMSET in ndn-cpp-config.h, use the library version or a local implementation of memcmp, memcpy and memset.
+ * Based on NDN_CPP_HAVE_MEMCPY and NDN_CPP_HAVE_MEMSET in ndn-cpp-config.h, use the library version or a local implementation of memcmp, memcpy and memset.
  */
 
 #ifndef NDN_MEMORY_H
@@ -17,7 +17,7 @@
 extern "C" {
 #endif
 
-#if HAVE_MEMCMP
+#if NDN_CPP_HAVE_MEMCMP
 #include <memory.h>
 /**
  * Use the library version of memcmp.
@@ -30,7 +30,7 @@
 int ndn_memcmp(uint8_t *buf1, uint8_t *buf2, size_t len);
 #endif
 
-#if HAVE_MEMCPY
+#if NDN_CPP_HAVE_MEMCPY
 #include <memory.h>
 /**
  * Use the library version of memcpy.
@@ -43,7 +43,7 @@
 void ndn_memcpy(uint8_t *dest, uint8_t *src, size_t len);
 #endif
 
-#if HAVE_MEMSET
+#if NDN_CPP_HAVE_MEMSET
 #include <memory.h>
 /**
  * Use the library version of memset.
diff --git a/ndn-cpp/common.hpp b/ndn-cpp/common.hpp
index 74f0214..80d1874 100644
--- a/ndn-cpp/common.hpp
+++ b/ndn-cpp/common.hpp
@@ -13,10 +13,10 @@
 
 // Depending on where ./configure found shared_ptr, define the ptr_lib namespace.
 // We always use ndn::ptr_lib.
-#if HAVE_STD_SHARED_PTR
+#if NDN_CPP_HAVE_STD_SHARED_PTR
 #include <memory>
 namespace ndn { namespace ptr_lib = std; }
-#elif HAVE_BOOST_SHARED_PTR
+#elif NDN_CPP_HAVE_BOOST_SHARED_PTR
 #include <boost/shared_ptr.hpp>
 #include <boost/make_shared.hpp>
 namespace ndn { namespace ptr_lib = boost; }
@@ -36,10 +36,10 @@
 
 // Depending on where ./configure found function, define the func_lib namespace.
 // We always use ndn::func_lib.
-#if HAVE_STD_FUNCTION
+#if NDN_CPP_HAVE_STD_FUNCTION
 #include <functional>
 namespace ndn { namespace func_lib = std; }
-#elif HAVE_BOOST_FUNCTION
+#elif NDN_CPP_HAVE_BOOST_FUNCTION
 #include <boost/function.hpp>
 #include <boost/bind.hpp>
 namespace ndn { namespace func_lib = boost; }
diff --git a/ndn-cpp/security/identity/basic-identity-storage.cpp b/ndn-cpp/security/identity/basic-identity-storage.cpp
index 135bbe8..5215e5f 100644
--- a/ndn-cpp/security/identity/basic-identity-storage.cpp
+++ b/ndn-cpp/security/identity/basic-identity-storage.cpp
@@ -5,10 +5,10 @@
  * See COPYING for copyright and distribution information.
  */
 
-// Only compile if ndn-cpp-config.h defines HAVE_SQLITE3.
-#include "../../c/common.h"
+// Only compile if ndn-cpp-config.h defines NDN_CPP_HAVE_SQLITE3.
+#include "../../ndn-cpp-config.h"
 #if 0 // temporarily disable.
-//#ifdef HAVE_SQLITE3
+//#ifdef NDN_CPP_HAVE_SQLITE3
 
 #include <stdlib.h>
 #include <sstream>
@@ -674,4 +674,4 @@
         
 }
 
-#endif // HAVE_SQLITE3
+#endif // NDN_CPP_HAVE_SQLITE3
diff --git a/ndn-cpp/security/identity/basic-identity-storage.hpp b/ndn-cpp/security/identity/basic-identity-storage.hpp
index 7e8862b..5c61112 100644
--- a/ndn-cpp/security/identity/basic-identity-storage.hpp
+++ b/ndn-cpp/security/identity/basic-identity-storage.hpp
@@ -8,10 +8,10 @@
 #ifndef NDN_BASIC_IDENTITY_STORAGE_H
 #define NDN_BASIC_IDENTITY_STORAGE_H
 
-// Only compile if ndn-cpp-config.h defines HAVE_SQLITE3.
-#include "../../c/common.h"
+// Only compile if ndn-cpp-config.h defines NDN_CPP_HAVE_SQLITE3.
+#include "../../ndn-cpp-config.h"
 #if 0 // temporarily disable.
-//#ifdef HAVE_SQLITE3
+//#ifdef NDN_CPP_HAVE_SQLITE3
 
 #include <sqlite3.h>
 #include "../../common.hpp"
@@ -207,6 +207,6 @@
 
 }
 
-#endif // HAVE_SQLITE3
+#endif // NDN_CPP_HAVE_SQLITE3
 
 #endif
diff --git a/ndn-cpp/security/identity/osx-private-key-storage.cpp b/ndn-cpp/security/identity/osx-private-key-storage.cpp
index 3efc99b..d1ea2c5 100644
--- a/ndn-cpp/security/identity/osx-private-key-storage.cpp
+++ b/ndn-cpp/security/identity/osx-private-key-storage.cpp
@@ -5,11 +5,10 @@
  * See COPYING for copyright and distribution information.
  */
 
-// Only compile if ndn-cpp-config.h defines HAVE_OSX_SECKEYCHAIN 1.
-#include "../../c/common.h"
+// Only compile if ndn-cpp-config.h defines NDN_CPP_HAVE_OSX_SECKEYCHAIN 1.
+#include "../../ndn-cpp-config.h"
 #if 0 // temporarily disable.
-//#if HAVE_OSX_SECKEYCHAIN
-
+//#if NDN_CPP_HAVE_OSX_SECKEYCHAIN
 
 #include <fstream>
 #include <sstream>
@@ -514,4 +513,4 @@
   
 }
 
-#endif HAVE_OSX_SECKEYCHAIN
+#endif NDN_CPP_HAVE_OSX_SECKEYCHAIN
diff --git a/ndn-cpp/security/identity/osx-private-key-storage.hpp b/ndn-cpp/security/identity/osx-private-key-storage.hpp
index edb15db..514d660 100644
--- a/ndn-cpp/security/identity/osx-private-key-storage.hpp
+++ b/ndn-cpp/security/identity/osx-private-key-storage.hpp
@@ -8,10 +8,10 @@
 #ifndef NDN_OSX_PRIVATEKEY_STORAGE_H
 #define NDN_OSX_PRIVATEKEY_STORAGE_H
 
-// Only compile if ndn-cpp-config.h defines HAVE_OSX_SECKEYCHAIN 1.
-#include "../../c/common.h"
+// Only compile if ndn-cpp-config.h defines NDN_CPP_HAVE_OSX_SECKEYCHAIN 1.
+#include "../../ndn-cpp-config.h"
 #if 0 // temporarily disable.
-//#if HAVE_OSX_SECKEYCHAIN
+//#if NDN_CPP_HAVE_OSX_SECKEYCHAIN
 
 #include "../../common.hpp"
 #include "private-key-storage.hpp"
@@ -201,6 +201,6 @@
   
 }
 
-#endif HAVE_OSX_SECKEYCHAIN
+#endif NDN_CPP_HAVE_OSX_SECKEYCHAIN
 
 #endif
diff --git a/ndn-cpp/util/logging.cpp b/ndn-cpp/util/logging.cpp
index 1ea8667..7147768 100644
--- a/ndn-cpp/util/logging.cpp
+++ b/ndn-cpp/util/logging.cpp
@@ -8,7 +8,7 @@
 
 #include "logging.hpp"
 
-#ifdef HAVE_LOG4CXX
+#ifdef NDN_CPP_HAVE_LOG4CXX
 
 #include <log4cxx/logger.h>
 #include <log4cxx/basicconfigurator.h>
diff --git a/ndn-cpp/util/logging.hpp b/ndn-cpp/util/logging.hpp
index e6a402f..87d9ad5 100644
--- a/ndn-cpp/util/logging.hpp
+++ b/ndn-cpp/util/logging.hpp
@@ -11,7 +11,7 @@
 
 #include "../common.hpp"
 
-#ifdef HAVE_LOG4CXX
+#ifdef NDN_CPP_HAVE_LOG4CXX
 
 #include <log4cxx/logger.h>
 
@@ -48,7 +48,7 @@
 void
 INIT_LOGGERS ();
 
-#else // else HAVE_LOG4CXX
+#else // else NDN_CPP_HAVE_LOG4CXX
 
 #define INIT_LOGGER(name)
 #define _LOG_FUNCTION(x)
@@ -74,6 +74,6 @@
 #define _LOG_DEBUG(x)
 #endif
 
-#endif // HAVE_LOG4CXX
+#endif // NDN_CPP_HAVE_LOG4CXX
 
 #endif