WAF: make all ns3 modules register themselves in the environment; link the run-tests program with all ns3 modules, not with a hardcoded list.
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Fri, 15 Jun 2007 15:19:38 +0100
changeset 7706441e0706902
parent 769 b4c78b6bdbd1
child 771 86b8d2312ec8
WAF: make all ns3 modules register themselves in the environment; link the run-tests program with all ns3 modules, not with a hardcoded list.
src/applications/wscript
src/common/wscript
src/core/wscript
src/devices/p2p/wscript
src/internet-node/wscript
src/node/wscript
src/simulator/wscript
src/wscript
utils/wscript
     1.1 --- a/src/applications/wscript	Thu Jun 14 13:09:56 2007 +0100
     1.2 +++ b/src/applications/wscript	Fri Jun 15 15:19:38 2007 +0100
     1.3 @@ -1,6 +1,10 @@
     1.4  ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
     1.5  
     1.6  
     1.7 +def configure(conf):
     1.8 +    conf.env.append_value('NS3_MODULES', 'ns3-applications')
     1.9 +
    1.10 +
    1.11  def build(bld):
    1.12      obj = bld.create_obj('cpp', 'shlib')
    1.13      obj.name = 'ns3-applications'
     2.1 --- a/src/common/wscript	Thu Jun 14 13:09:56 2007 +0100
     2.2 +++ b/src/common/wscript	Fri Jun 15 15:19:38 2007 +0100
     2.3 @@ -1,5 +1,7 @@
     2.4  ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
     2.5  
     2.6 +def configure(conf):
     2.7 +    conf.env.append_value('NS3_MODULES', 'ns3-common')
     2.8  
     2.9  def build(bld):
    2.10      common = bld.create_obj('cpp', 'shlib')
     3.1 --- a/src/core/wscript	Thu Jun 14 13:09:56 2007 +0100
     3.2 +++ b/src/core/wscript	Fri Jun 15 15:19:38 2007 +0100
     3.3 @@ -3,6 +3,8 @@
     3.4  
     3.5  
     3.6  def configure(conf):
     3.7 +    conf.env.append_value('NS3_MODULES', 'ns3-core')
     3.8 +
     3.9      e = conf.create_header_configurator()
    3.10      e.mandatory = False
    3.11      e.name = 'stdlib.h'
     4.1 --- a/src/devices/p2p/wscript	Thu Jun 14 13:09:56 2007 +0100
     4.2 +++ b/src/devices/p2p/wscript	Fri Jun 15 15:19:38 2007 +0100
     4.3 @@ -1,6 +1,10 @@
     4.4  ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
     4.5  
     4.6  
     4.7 +def configure(conf):
     4.8 +    conf.env.append_value('NS3_MODULES', 'ns3-p2p')
     4.9 +
    4.10 +
    4.11  def build(bld):
    4.12      p2p = bld.create_obj('cpp', 'shlib')
    4.13      p2p.name = 'ns3-p2p'
     5.1 --- a/src/internet-node/wscript	Thu Jun 14 13:09:56 2007 +0100
     5.2 +++ b/src/internet-node/wscript	Fri Jun 15 15:19:38 2007 +0100
     5.3 @@ -1,6 +1,10 @@
     5.4  ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
     5.5  
     5.6  
     5.7 +def configure(conf):
     5.8 +    conf.env.append_value('NS3_MODULES', 'ns3-internet-node')
     5.9 +
    5.10 +
    5.11  def build(bld):
    5.12      obj = bld.create_obj('cpp', 'shlib')
    5.13      obj.name = 'ns3-internet-node'
     6.1 --- a/src/node/wscript	Thu Jun 14 13:09:56 2007 +0100
     6.2 +++ b/src/node/wscript	Fri Jun 15 15:19:38 2007 +0100
     6.3 @@ -1,5 +1,8 @@
     6.4  ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
     6.5  
     6.6 +def configure(conf):
     6.7 +    conf.env.append_value('NS3_MODULES', 'ns3-node')
     6.8 +
     6.9  
    6.10  def build(bld):
    6.11      node = bld.create_obj('cpp', 'shlib')
     7.1 --- a/src/simulator/wscript	Thu Jun 14 13:09:56 2007 +0100
     7.2 +++ b/src/simulator/wscript	Fri Jun 15 15:19:38 2007 +0100
     7.3 @@ -13,6 +13,8 @@
     7.4  
     7.5  
     7.6  def configure(conf):
     7.7 +    conf.env.append_value('NS3_MODULES', 'ns3-simulator')
     7.8 +
     7.9      if Params.g_options.high_precision_as_double:
    7.10          conf.add_define('USE_HIGH_PRECISION_DOUBLE', 1)
    7.11          conf.env['USE_HIGH_PRECISION_DOUBLE'] = 1
     8.1 --- a/src/wscript	Thu Jun 14 13:09:56 2007 +0100
     8.2 +++ b/src/wscript	Fri Jun 15 15:19:38 2007 +0100
     8.3 @@ -29,6 +29,7 @@
     8.4  
     8.5      blddir = os.path.abspath(os.path.join(conf.m_blddir, conf.env.variant()))
     8.6      for module in all_modules:
     8.7 +        conf.sub_config(module)
     8.8          conf.env.append_value('NS3_MODULE_PATH', os.path.join(blddir, 'src', module))
     8.9  
    8.10  
     9.1 --- a/utils/wscript	Thu Jun 14 13:09:56 2007 +0100
     9.2 +++ b/utils/wscript	Fri Jun 15 15:19:38 2007 +0100
     9.3 @@ -1,23 +1,24 @@
     9.4  ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
     9.5 -import sys
     9.6 -import Params
     9.7  
     9.8  
     9.9  def build(bld):
    9.10 +    env = bld.env_of_name('default')
    9.11  
    9.12      def create_ns_prog(name, source):
    9.13          obj = bld.create_obj('cpp', 'program')
    9.14          obj.target = name
    9.15 -        obj.uselib_local = "ns3-core ns3-common ns3-simulator"
    9.16          obj.source = source
    9.17          return obj
    9.18  
    9.19      unit_tests = create_ns_prog('run-tests', 'run-tests.cc')
    9.20      unit_tests.install_var  = 0 # do not install
    9.21      unit_tests.unit_test    = 1 # runs on 'waf check'
    9.22 +    ## link unit test program with all ns3 modules
    9.23 +    unit_tests.uselib_local = env['NS3_MODULES']
    9.24 +    print env['NS3_MODULES']
    9.25      
    9.26 -    #if sys.platform != 'win32':
    9.27      obj = create_ns_prog('bench-simulator', 'bench-simulator.cc')
    9.28 +    obj.uselib_local = "ns3-core ns3-common ns3-simulator"
    9.29 +
    9.30      obj = create_ns_prog('replay-simulation', 'replay-simulation.cc')
    9.31 -    ## bench-packets requires missing header files
    9.32 -    #obj = create_ns_prog('bench-packets', 'bench-packets.cc')
    9.33 +    obj.uselib_local = "ns3-core ns3-common ns3-simulator"