src/tap-bridge/wscript
author Tom Henderson <tomh@tomh.org>
Mon, 28 Sep 2015 20:27:25 -0700
changeset 11676 05ea1489e509
parent 11125 0121c3096a89
permissions -rw-r--r--
bug 2184: Integer overflow in MacLow
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4163
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     1
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     2
5975
c85cb9b073a0 comparing with http://code.nsnam.org/ns-3-dev
Craig Dowell <craigdo@ee.washington.edu>
parents: 4390
diff changeset
     3
import os.path
c85cb9b073a0 comparing with http://code.nsnam.org/ns-3-dev
Craig Dowell <craigdo@ee.washington.edu>
parents: 4390
diff changeset
     4
4163
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     5
def configure(conf):
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     6
    if conf.env['ENABLE_THREADING']:
7494
d93f5e8e0a59 waf-1.6: Mac OSX and other fixes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7487
diff changeset
     7
        conf.env['ENABLE_TAP'] = conf.check_nonfatal(header_name='linux/if_tun.h',
4186
f1d57182d491 tighten up configuration reqs for tap and emu
Craig Dowell <craigdo@ee.washington.edu>
parents: 4164
diff changeset
     8
                                            define_name='HAVE_IF_TUN_H')
4163
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
     9
        conf.report_optional_feature("TapBridge", "Tap Bridge",
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    10
                                     conf.env['ENABLE_TAP'],
4186
f1d57182d491 tighten up configuration reqs for tap and emu
Craig Dowell <craigdo@ee.washington.edu>
parents: 4164
diff changeset
    11
                                     "<linux/if_tun.h> include not detected")
4163
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    12
    else:
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    13
        conf.report_optional_feature("TapBridge", "Tap Bridge",
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    14
                                     False,
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    15
                                     "needs threading support which is not available")
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    16
5975
c85cb9b073a0 comparing with http://code.nsnam.org/ns-3-dev
Craig Dowell <craigdo@ee.washington.edu>
parents: 4390
diff changeset
    17
    if conf.env['ENABLE_TAP']:
7487
82cd20da9650 Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7294
diff changeset
    18
        blddir = os.path.abspath(os.path.join(conf.bldnode.abspath(), conf.variant))
7244
1a9428ead071 fixed paths to tap-creator and emu-sock-creator broken after modules move.
Andrey Mazo <mazo@iitp.ru>
parents: 6982
diff changeset
    19
        tapcreatordir = os.path.abspath(os.path.join(blddir, "src/tap-bridge"))
5975
c85cb9b073a0 comparing with http://code.nsnam.org/ns-3-dev
Craig Dowell <craigdo@ee.washington.edu>
parents: 4390
diff changeset
    20
        conf.env.append_value('NS3_EXECUTABLE_PATH', tapcreatordir)
7294
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    21
    else:
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    22
        # Add this module to the list of modules that won't be built
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    23
        # if they are enabled.
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    24
        conf.env['MODULES_NOT_BUILT'].append('tap-bridge')
5975
c85cb9b073a0 comparing with http://code.nsnam.org/ns-3-dev
Craig Dowell <craigdo@ee.washington.edu>
parents: 4390
diff changeset
    25
4163
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    26
def build(bld):
7294
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    27
    # Don't do anything for this module if tap-bridge's not enabled.
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    28
    if not bld.env['ENABLE_TAP']:
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    29
        return
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    30
11125
0121c3096a89 fix tap-bridge module dependency
Tom Henderson <tomh@tomh.org>
parents: 10825
diff changeset
    31
    module = bld.create_ns3_module('tap-bridge', ['internet', 'network', 'core'])
4163
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    32
    module.source = [
7294
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    33
        'model/tap-bridge.cc',
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    34
        'model/tap-encode-decode.cc',
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    35
        'helper/tap-bridge-helper.cc',
4163
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    36
        ]
9277
0f87d1cb030c Upgrade waf to 1.7.10 and fix included wscripts
Vedran Miletić <rivanvx@gmail.com>
parents: 7694
diff changeset
    37
    headers = bld(features='ns3header')
4163
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    38
    headers.module = 'tap-bridge'
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    39
    headers.source = [
7294
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    40
        'model/tap-bridge.h',
1ebf059e9ebc Make openflow and tap-bridge modules not be built if not appropriate
Mitch Watrous <watrous@u.washington.edu>
parents: 7244
diff changeset
    41
        'helper/tap-bridge-helper.h',
6848
1f453ad50ef3 Converts csma, emu, tap-bridge, point-to-point, wifi and wimax modules into modular format
Lalith Suresh <suresh.lalith@gmail.com>
parents: 6836
diff changeset
    42
        'doc/tap.h',
4163
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    43
        ]
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    44
6982
c383b48d0831 Make sure modular python bindings for emu and tap-bridge are not built on macosx
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6932
diff changeset
    45
    if not bld.env['PLATFORM'].startswith('freebsd'):
7694
ae1974f9365b Make sure the call tap-creator with the new program name
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7494
diff changeset
    46
        tap_creator = bld.create_suid_program('tap-creator')
ae1974f9365b Make sure the call tap-creator with the new program name
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7494
diff changeset
    47
        tap_creator.source = [
6982
c383b48d0831 Make sure modular python bindings for emu and tap-bridge are not built on macosx
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6932
diff changeset
    48
            'model/tap-creator.cc',
c383b48d0831 Make sure modular python bindings for emu and tap-bridge are not built on macosx
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6932
diff changeset
    49
            'model/tap-encode-decode.cc',
c383b48d0831 Make sure modular python bindings for emu and tap-bridge are not built on macosx
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6932
diff changeset
    50
            ]
4163
8c48682b3d42 checkpoint tap development
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff changeset
    51
7694
ae1974f9365b Make sure the call tap-creator with the new program name
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7494
diff changeset
    52
    module.env.append_value("DEFINES", "TAP_CREATOR=\"%s\"" % (tap_creator.target,))
ae1974f9365b Make sure the call tap-creator with the new program name
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 7494
diff changeset
    53
6848
1f453ad50ef3 Converts csma, emu, tap-bridge, point-to-point, wifi and wimax modules into modular format
Lalith Suresh <suresh.lalith@gmail.com>
parents: 6836
diff changeset
    54
    if bld.env['ENABLE_EXAMPLES']:
9277
0f87d1cb030c Upgrade waf to 1.7.10 and fix included wscripts
Vedran Miletić <rivanvx@gmail.com>
parents: 7694
diff changeset
    55
        bld.recurse('examples')
6932
3b497f4f6ad9 Add more modular bindings
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6852
diff changeset
    56
3b497f4f6ad9 Add more modular bindings
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 6852
diff changeset
    57
    bld.ns3_python_bindings()