utils/wscript
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 13 Mar 2008 12:56:49 -0700
changeset 2602 d9262bff6df2
parent 2571 fd0fa0cec413
child 3260 8c0ab08144e6
permissions -rw-r--r--
add back support for introspected doxygen.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
     1
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
1669
5ee478e0475e Compile mobility-visualizer with -fno-strict-aliasing to avoid GNOME bug #316221
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1664
diff changeset
     2
import os.path
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
     3
1664
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
     4
def configure(conf):
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
     5
    check = conf.create_pkgconfig_configurator()
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
     6
    check.name = 'goocanvas gthread-2.0'
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
     7
    check.uselib = 'MOBILITY_VISUALIZER'
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
     8
    check.mandatory = False
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
     9
    conf.env['ENABLE_MOBILITY_VISUALIZER'] = check.run()
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
    10
    
600
fd944dbf33c6 WAF: simplify wscripts using the new chained uselib_local dependencies feature of WAF SVN; now build all samples and examples; add --disable-rpath configure option; add WAF build instructions.
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents: 537
diff changeset
    11
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
    12
def build(bld):
770
6441e0706902 WAF: make all ns3 modules register themselves in the environment; link the run-tests program with all ns3 modules, not with a hardcoded list.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 600
diff changeset
    13
    env = bld.env_of_name('default')
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
    14
1858
68e1964c19e8 WAF: add a new --enable-modules configure option, to tell WAF to build only the specified set of ns-3 modules and its dependencies; programs depending on those modules are automatically excluded from the build.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1855
diff changeset
    15
    unit_tests = bld.create_ns3_program('run-tests', ['common'])
2344
7617aa80498d Fix a typo in the WAF scripts; don't access m_linktask directly, use the get_target_name() method instead (to make it work with waf trunk).
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2158
diff changeset
    16
    unit_tests.inst_var  = 0 # do not install
1217
2f7791ae388d WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 771
diff changeset
    17
    unit_tests.source = 'run-tests.cc'
770
6441e0706902 WAF: make all ns3 modules register themselves in the environment; link the run-tests program with all ns3 modules, not with a hardcoded list.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 600
diff changeset
    18
    ## link unit test program with all ns3 modules
1220
4933e0890acd Build all modules as a single ns3 shared library.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1217
diff changeset
    19
    unit_tests.uselib_local = 'ns3'
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
    20
    
1217
2f7791ae388d WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 771
diff changeset
    21
    obj = bld.create_ns3_program('bench-simulator', ['simulator'])
2f7791ae388d WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 771
diff changeset
    22
    obj.source = 'bench-simulator.cc'
770
6441e0706902 WAF: make all ns3 modules register themselves in the environment; link the run-tests program with all ns3 modules, not with a hardcoded list.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 600
diff changeset
    23
1322
b6a4885a92df re-enable packet benchmarking
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1220
diff changeset
    24
    obj = bld.create_ns3_program('bench-packets', ['common'])
b6a4885a92df re-enable packet benchmarking
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1220
diff changeset
    25
    obj.source = 'bench-packets.cc'
b6a4885a92df re-enable packet benchmarking
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1220
diff changeset
    26
1217
2f7791ae388d WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 771
diff changeset
    27
    obj = bld.create_ns3_program('replay-simulation', ['simulator'])
2f7791ae388d WAF: add new bld.create_ns3_module() and bld.create_ns3_program() methods to make declaration of modules and programs simpler, and allowing us to change how ns-3 is built in a centralized way, without needing to change every module wscript file.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 771
diff changeset
    28
    obj.source = 'replay-simulation.cc'
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1220
diff changeset
    29
1855
ee15fef0cb62 print-trace-sources.cc -> print-introspected-doxygen.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1669
diff changeset
    30
    obj = bld.create_ns3_program('print-introspected-doxygen',
1368
e75dc1a2a5fb add TraceResolver::PrintAvailable method
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1220
diff changeset
    31
                                 ['internet-node', 'csma-cd', 'point-to-point'])
1855
ee15fef0cb62 print-trace-sources.cc -> print-introspected-doxygen.cc
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1669
diff changeset
    32
    obj.source = 'print-introspected-doxygen.cc'
1664
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
    33
2571
fd0fa0cec413 disable mobility visualizer temporarily.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2344
diff changeset
    34
# XXX: disable mobility visualizer code temporarily.
fd0fa0cec413 disable mobility visualizer temporarily.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2344
diff changeset
    35
    env['ENABLE_MOBILITY_VISUALIZER'] = ''
1664
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
    36
    if env['ENABLE_MOBILITY_VISUALIZER']:
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
    37
        obj = bld.create_ns3_program('mobility-visualizer',
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
    38
                                     ['internet-node', 'mobility'])
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
    39
        obj.source = ['mobility-visualizer-model.cc', 'mobility-visualizer-view.cc']
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
    40
        obj.uselib = 'MOBILITY_VISUALIZER'
1669
5ee478e0475e Compile mobility-visualizer with -fno-strict-aliasing to avoid GNOME bug #316221
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1664
diff changeset
    41
        if os.path.basename(obj.env['CXX']).startswith("g++"):
5ee478e0475e Compile mobility-visualizer with -fno-strict-aliasing to avoid GNOME bug #316221
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1664
diff changeset
    42
            obj.env.append_value('CXXFLAGS', '-fno-strict-aliasing')
1664
306c81333d64 Add a small mobility model visualization tool
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 1421
diff changeset
    43