build: Force linking against the locally compiled ndn-cxx library
When ndn-cxx is configured to be linked against static libraries (e.g.,
a static version of boost libraries) while ndn-cxx library is being
compiled as a shared library, waf adds '-L<static/path>' before '-L.'.
This can result in compilation failure when the system has a different
version of the ndn-cxx library installed.
This commit also makes a minor improvement for cryptopp library
detection.
Change-Id: Ia42a21b51a51a867a1b455a95d1cf5de6b21881f
diff --git a/wscript b/wscript
index ba82eed..80b7fb5 100644
--- a/wscript
+++ b/wscript
@@ -19,7 +19,7 @@
opt = opt.add_option_group('Library Options')
opt.add_option('--with-tests', action='store_true', default=False, dest='with_tests',
- help='''build unit tests''')
+ help='''Build unit tests''')
opt.add_option('--without-tools', action='store_false', default=True, dest='with_tools',
help='''Do not build tools''')
@@ -127,6 +127,12 @@
conf.define('SYSCONFDIR', conf.env['SYSCONFDIR'])
+ if not conf.env.enable_static:
+ # If there happens to be a static library, waf will put the corresponding -L flags
+ # before dynamic library flags. This can result in compilation failure when the
+ # system has a different version of the ndn-cxx library installed.
+ conf.env['STLIBPATH'] = ['.'] + conf.env['STLIBPATH']
+
# config file will contain all defines that were added using conf.define('xxx'...)
# Everything that was added directly to conf.env['DEFINES'] will not appear in the
# config file and will be added using compiler directives in the command line.