build: (fixes #3007) Boost library configuration in contrib
authorRyan Mast <mast9@llnl.gov>
Thu, 06 Dec 2018 17:43:16 -0800
changeset 13891 cce751c7e678
parent 13890 b6be8762cc18
child 13892 53fa9b4b8c09
build: (fixes #3007) Boost library configuration in contrib
contrib/wscript
src/wscript
wscript
--- a/contrib/wscript	Thu Dec 06 22:35:26 2018 +0100
+++ b/contrib/wscript	Thu Dec 06 17:43:16 2018 -0800
@@ -26,6 +26,10 @@
         all_contrib_modules.append(dirname)
 all_contrib_modules.sort()
 
+def get_required_boost_libs(conf):
+    for module in all_contrib_modules:
+        conf.recurse (module, name="required_boost_libs", mandatory=False)
+
 def options(opt):
     for module in all_contrib_modules:
         opt.recurse(module, mandatory=False)
--- a/src/wscript	Thu Dec 06 22:35:26 2018 +0100
+++ b/src/wscript	Thu Dec 06 17:43:16 2018 -0800
@@ -29,7 +29,9 @@
         all_modules.append(dirname)
 all_modules.sort()
 
-
+def get_required_boost_libs(conf):
+    for module in all_modules:
+        conf.recurse (module, name="required_boost_libs", mandatory=False)
 
 def options(opt):
     opt.add_option('--enable-rpath',
@@ -49,18 +51,6 @@
         opt.recurse(module, mandatory=False)
 
 def configure(conf):
-    conf.env['REQUIRED_BOOST_LIBS'] = []
-    for module in all_modules:
-        conf.recurse (module, name="required_boost_libs", mandatory=False)
-
-    if conf.env['REQUIRED_BOOST_LIBS'] is not []:
-        conf.load('boost')
-        conf.check_boost(lib=' '.join (conf.env['REQUIRED_BOOST_LIBS']), mandatory=False)
-        if not conf.env['LIB_BOOST']:
-            conf.check_boost(lib=' '.join (conf.env['REQUIRED_BOOST_LIBS']), libpath="/usr/lib64", mandatory=False)
-            if not conf.env['LIB_BOOST']:
-                conf.env['LIB_BOOST'] = []
-
     # Append blddir to the module path before recursing into modules
     blddir = os.path.abspath(os.path.join(conf.bldnode.abspath(), conf.variant))
     conf.env.append_value('NS3_MODULE_PATH', blddir + "/lib")
--- a/wscript	Thu Dec 06 22:35:26 2018 +0100
+++ b/wscript	Thu Dec 06 17:43:16 2018 -0800
@@ -457,6 +457,19 @@
     else:
         Logs.warn("CXX Standard flag " + Options.options.cxx_standard + " was not recognized, using compiler's default")
 
+    # Find Boost libraries by modules
+    conf.env['REQUIRED_BOOST_LIBS'] = []
+    for modules_dir in ['src', 'contrib']:
+        conf.recurse (modules_dir, name="get_required_boost_libs", mandatory=False)
+
+    if conf.env['REQUIRED_BOOST_LIBS'] is not []:
+        conf.load('boost')
+        conf.check_boost(lib=' '.join (conf.env['REQUIRED_BOOST_LIBS']), mandatory=False)
+        if not conf.env['LIB_BOOST']:
+            conf.check_boost(lib=' '.join (conf.env['REQUIRED_BOOST_LIBS']), libpath="/usr/lib64", mandatory=False)
+            if not conf.env['LIB_BOOST']:
+                conf.env['LIB_BOOST'] = []
+
     # Set this so that the lists won't be printed at the end of this
     # configure command.
     conf.env['PRINT_BUILT_MODULES_AT_END'] = False