build: Add '-fPIC' compilation flag (if available)

The flag is necessary (at least on Linux) if ndn-cpp-dev library is
linked somewhere else to become part of dynamically loading library.

Change-Id: I824f82cae3a4e779acaf78fd5e14fa7dff77536a
diff --git a/wscript b/wscript
index 7bc8a27..abbafaf 100644
--- a/wscript
+++ b/wscript
@@ -110,6 +110,7 @@
 
     conf.check_cxx(lib='pthread', uselib_store='PTHREAD', define_name='HAVE_PTHREAD', mandatory=False)
     conf.check_cxx(lib='rt', uselib_store='RT', define_name='HAVE_RT', mandatory=False)
+    conf.check_cxx(cxxflags=['-fPIC'], uselib_store='PIC', mandatory=False)
 
     if not conf.options.with_sqlite_locking:
         conf.define('DISABLE_SQLITE3_FS_LOCKING', 1)
@@ -126,7 +127,7 @@
         name = "ndn-cpp-dev",
         source = bld.path.ant_glob('src/**/*.cpp',
                                    excl = ['src/**/*-osx.cpp', 'src/**/*-sqlite3.cpp']),
-        use = 'BOOST OPENSSL LOG4CXX CRYPTOPP SQLITE3 RT PTHREAD',
+        use = 'BOOST OPENSSL LOG4CXX CRYPTOPP SQLITE3 RT PIC PTHREAD',
         includes = ". src",
         export_includes = "src",
         install_path = '${LIBDIR}',