build: Fix compatibility with Python 3
Change-Id: I5a7b332eb43b44ca528c27db762bf8e7e1f022e6
Refs: #3499
diff --git a/wscript b/wscript
index 6055bfd..9d9a879 100644
--- a/wscript
+++ b/wscript
@@ -1,8 +1,10 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-import os
-VERSION='0.2'
-APPNAME='ndn-tools'
+VERSION = '0.2'
+APPNAME = 'ndn-tools'
+
+from waflib import Utils
+import os
def options(opt):
opt.load(['compiler_cxx', 'gnu_dirs'])
@@ -16,11 +18,8 @@
conf.load(['compiler_cxx', 'gnu_dirs',
'default-compiler-flags', 'sphinx_build', 'boost'])
- if not os.environ.has_key('PKG_CONFIG_PATH'):
- os.environ['PKG_CONFIG_PATH'] = ':'.join([
- '/usr/lib/pkgconfig',
- '/usr/local/lib/pkgconfig',
- '/opt/local/lib/pkgconfig'])
+ if 'PKG_CONFIG_PATH' not in os.environ:
+ os.environ['PKG_CONFIG_PATH'] = Utils.subst_vars('${LIBDIR}/pkgconfig', conf.env)
conf.check_cfg(package='libndn-cxx', args=['--cflags', '--libs'],
uselib_store='NDN_CXX', mandatory=True)