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
This commit is contained in:
Alexander Afanasyev committed 2016-08-03 11:48:27 -07:00
1 parent 044bb7e9e5
commit 224044fc30
2 files changed
+8 -2

No files matched your search

+1 -1
View File
@@ -101,7 +101,7 @@ def check_cryptopp(self, *k, **kw):
self.fatal('CryptoPP not found or is not usable')
isLibWorking = False
for defines in ['', 'CRYPTOPP_DISABLE_ASM']:
for defines in [[], ['CRYPTOPP_DISABLE_ASM']]:
try:
self.check_cxx(msg='Checking if CryptoPP library works',
fragment=CRYPTOPP_CHECK_FRAGMENT,
+7 -1
View File
@@ -19,7 +19,7 @@ def options(opt):
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 @@ main(int, char**)
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.