src/visualizer/wscript
author Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
Tue, 13 Sep 2011 13:47:17 +0100
changeset 7494 d93f5e8e0a59
parent 7487 82cd20da9650
child 7712 e22640804bf7
permissions -rw-r--r--
waf-1.6: Mac OSX and other fixes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6676
8a57344a8d09 Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     1
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
7297
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
     2
import Options
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
     3
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
     4
def configure(conf):
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
     5
    # If Python was explicitly disabled, then add this module to the
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
     6
    # list of modules that won't be built if they are enabled.
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
     7
    if Options.options.python_disable:
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
     8
        conf.env['MODULES_NOT_BUILT'].append('visualizer')
6676
8a57344a8d09 Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
     9
8a57344a8d09 Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    10
def build(bld):
7297
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    11
    # Don't do anything for this module if Python was explicitly
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    12
    # disabled.
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    13
    if 'visualizer' in bld.env['MODULES_NOT_BUILT']:
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    14
        return
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    15
7487
82cd20da9650 Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7297
diff changeset
    16
    headers = bld.new_task_gen(features=['ns3header'])
6676
8a57344a8d09 Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    17
    headers.module = 'visualizer'
8a57344a8d09 Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    18
    headers.source = [
8a57344a8d09 Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    19
        ]
8a57344a8d09 Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    20
7297
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    21
    module = bld.create_ns3_module('visualizer', ['internet', 'wifi', 'point-to-point'])
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    22
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    23
    # XXX This file was added so that static builds would work on
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    24
    # Darwin, which doesn't like modules with no source files.  It
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    25
    # would have been better to add this module to the list
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    26
    # conf.env['MODULES_NOT_BUILT'] if Python bindings were not
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    27
    # enabled, but it's not possible for this module to determine in
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    28
    # its configure() function if Python bindings will be enabled
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    29
    # because that is done by the wscript file in bindings/python that
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    30
    # is parsed after this module's wscript file is parsed.
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    31
    module.source = [
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    32
        'model/dummy-file-for-static-builds.cc',
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    33
        ]
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    34
6915
d61f311999f1 Fix the build of visualizer module when the python headers are missing
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6676
diff changeset
    35
    if not bld.env['ENABLE_PYTHON_BINDINGS']:
d61f311999f1 Fix the build of visualizer module when the python headers are missing
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6676
diff changeset
    36
        return
d61f311999f1 Fix the build of visualizer module when the python headers are missing
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6676
diff changeset
    37
6676
8a57344a8d09 Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    38
    module.features.append('pyembed')
7494
d93f5e8e0a59 waf-1.6: Mac OSX and other fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7487
diff changeset
    39
    #module.env.append_value('CXXFLAGS', module.env['shlib_CXXFLAGS'])
d93f5e8e0a59 waf-1.6: Mac OSX and other fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7487
diff changeset
    40
    #module.includes = '.'
6676
8a57344a8d09 Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff changeset
    41
7297
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    42
    module.source.extend([
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    43
        'model/pyviz.cc',
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    44
        'model/visual-simulator-impl.cc',
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    45
        ])
e552e9840a14 Make ns3tcp, ns3wifi, and visualizer modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 6977
diff changeset
    46
    headers.source.append('model/pyviz.h')
6977
0ae77a662277 Add visualizer modular python bindings
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6950
diff changeset
    47
0ae77a662277 Add visualizer modular python bindings
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6950
diff changeset
    48
    bld.ns3_python_bindings()