src/internet-stack/wscript
author Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
Fri, 05 Sep 2008 19:55:21 +0100
changeset 3628 a9c05c7e54f2
parent 3626 2438df52233e
child 3634 abab38fa09ab
permissions -rw-r--r--
Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
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; -*-
3579
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
     2
import Params
3628
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
     3
import Task
3579
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
     4
import os
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
     5
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
     6
# Mercurial repository of the network simulation cradle
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
     7
NETWORK_SIMULATION_CRADLE_REPO = "https://secure.wand.net.nz/mercurial/nsc"
3628
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
     8
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
     9
# directory that contains network simulation cradle source
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    10
# note, this path is relative to the project root
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    11
NSC_DIR = "nsc"
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    12
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    13
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    14
def set_options(opt):
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    15
    opt.add_option('--nsc',
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    16
                   help=('Enable Network Simulation Cradle to allow the use real-world network stacks'),
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    17
                   action="store_true", default=False,
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    18
                   dest='nsc')
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    19
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    20
3579
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    21
def nsc_fetch():
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    22
    def nsc_clone():
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    23
        print "Retrieving nsc from " + NETWORK_SIMULATION_CRADLE_REPO
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    24
        if os.system("hg version > /dev/null 2>&1") != 0:
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    25
            Params.fatal("Mercurial not installed, http fallback not yet implemented")
3626
2438df52233e We don't want mercurial -q option when fetching nsc, user feedback is important.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3625
diff changeset
    26
        if os.system("hg  clone " + NETWORK_SIMULATION_CRADLE_REPO) != 0:
3579
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    27
            Params.fatal("hg -q clone %s failed" % NETWORK_SIMULATION_CRADLE_REPO)
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    28
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    29
    def nsc_update():
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    30
        if os.system("hg version > /dev/null 2>&1") != 0:
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    31
            Params.warning("Mercurial not installed, not updating nsc source")
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    32
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    33
        print "Pulling nsc updates from " + NETWORK_SIMULATION_CRADLE_REPO
3626
2438df52233e We don't want mercurial -q option when fetching nsc, user feedback is important.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3625
diff changeset
    34
        if os.system("cd nsc && hg pull %s && hg update" % NETWORK_SIMULATION_CRADLE_REPO) != 0:
3579
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    35
            Params.warning("Updating nsc using mercurial failed")
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    36
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    37
    if not os.path.exists("nsc"):
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    38
        nsc_clone()
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    39
    else:
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    40
        nsc_update()
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    41
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    42
def configure(conf):
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    43
    # checks for flex and bison, which is needed to build NSCs globaliser
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    44
    def check_nsc_buildutils():
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    45
        import flex
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    46
        import bison
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    47
        conf.check_tool('flex bison')
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    48
        e = conf.create_library_configurator()
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    49
        e.mandatory = True
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    50
        e.name = 'fl'
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    51
        e.run()
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    52
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    53
    if not Params.g_options.nsc:
3625
30afad8324d5 Add a summary of optional features at the end of the configuration stage.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3595
diff changeset
    54
        conf.report_optional_feature("nsc", "Network Simulation Cradle", False,
30afad8324d5 Add a summary of optional features at the end of the configuration stage.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3595
diff changeset
    55
                                     "--nsc configure option not given")
3579
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    56
	return
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    57
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    58
    check_nsc_buildutils()
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    59
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    60
    arch = os.uname()[4]
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    61
    ok = False
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    62
    if arch == 'x86_64' or arch == 'i686' or arch == 'i586' or arch == 'i486' or arch == 'i386':
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    63
        conf.env['NSC_ENABLED'] = 'yes'
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    64
        conf.define('NETWORK_SIMULATION_CRADLE', 1)
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    65
        conf.write_config_header('ns3/core-config.h')
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    66
        e = conf.create_library_configurator()
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    67
        e.mandatory = True
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    68
        e.name = 'dl'
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    69
        e.define = 'HAVE_DL'
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    70
        e.uselib = 'DL'
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    71
        e.run()
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    72
        ok = True
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    73
    conf.check_message('NSC supported architecture', arch, ok)
3625
30afad8324d5 Add a summary of optional features at the end of the configuration stage.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3595
diff changeset
    74
    conf.report_optional_feature("nsc", "Network Simulation Cradle", ok,
30afad8324d5 Add a summary of optional features at the end of the configuration stage.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3595
diff changeset
    75
                                 "architecture %r not supported" % arch)
3579
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
    76
    nsc_fetch()
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
    77
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
    78
3628
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    79
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    80
class NscBuildTask(Task.TaskBase):
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    81
    """task that builds nsc
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    82
    """
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    83
    def __init__(self, builddir):
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    84
        self.m_display = 'build-nsc'
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    85
        self.prio = 1000 # build after the rest of ns-3
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    86
        self.builddir = builddir
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    87
        super(NscBuildTask, self).__init__()
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    88
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    89
    def run(self):
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    90
        # XXX: Detect gcc major version(s) available to build supported stacks
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    91
        kernels = [['linux-2.6.18', 'linux2.6.18'],
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    92
                   ['linux-2.6.26', 'linux2.6.26']]
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    93
        for dir, name in kernels:
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    94
            soname = 'lib' + name + '.so'
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    95
            if not os.path.exists(os.path.join("..", NSC_DIR, dir, soname)):
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    96
                if os.system('cd ../%s && python scons.py %s' % (NSC_DIR, dir)) != 0:
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    97
                    Params.fatal("Building NSC stack failed")
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    98
        builddir = self.builddir
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
    99
        if not os.path.exists(builddir + '/nsc'):
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   100
            try:
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   101
                os.symlink('../../' + NSC_DIR, builddir + '/nsc')
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   102
            except:
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   103
                Params.fatal("Error linkink " + builddir + '/nsc')
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   104
        if not os.path.exists(builddir + '/' + soname):
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   105
            try:
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   106
                os.symlink('../../' + NSC_DIR + '/' + dir + '/' + soname, builddir +  '/' + soname)
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   107
            except:
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   108
                Params.fatal("Error linking " + builddir + '/' + soname)
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   109
        
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   110
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   111
def build(bld):
3260
8c0ab08144e6 bug 186: internet-node directory must be renamed to internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3216
diff changeset
   112
    obj = bld.create_ns3_module('internet-stack', ['node'])
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   113
    obj.source = [
2707
1c353c7aef5b introduce AddInternetStack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2609
diff changeset
   114
        'internet-stack.cc',
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   115
        'ipv4-l4-protocol.cc',
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   116
        'udp-header.cc',
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 1496
diff changeset
   117
        'tcp-header.cc',
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   118
        'ipv4-checksum.cc',
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   119
        'ipv4-interface.cc',
760
975a88259e2e Re-sync WAF build with the latest SConstruct changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 729
diff changeset
   120
        'ipv4-l3-protocol.cc',
983
47c42bd66fb7 Support dynamic routing and multiple routing protocols; static routing table is refactored as a "routing protocol".
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 976
diff changeset
   121
        'ipv4-static-routing.cc',
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   122
        'ipv4-end-point.cc',
760
975a88259e2e Re-sync WAF build with the latest SConstruct changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 729
diff changeset
   123
        'udp-l4-protocol.cc',
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 1496
diff changeset
   124
        'tcp-l4-protocol.cc',
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   125
        'arp-header.cc',
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   126
        'arp-cache.cc',
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   127
        'arp-ipv4-interface.cc',
760
975a88259e2e Re-sync WAF build with the latest SConstruct changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 729
diff changeset
   128
        'arp-l3-protocol.cc',
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   129
        'ipv4-loopback-interface.cc',
3130
881cc06cd651 rename UdpSocket to UdpSocketImpl
Tom Henderson <tomh@tomh.org>
parents: 3126
diff changeset
   130
        'udp-socket-impl.cc',
3131
d82336dfd269 change TcpSocket to TcpSocketImpl
Tom Henderson <tomh@tomh.org>
parents: 3130
diff changeset
   131
        'tcp-socket-impl.cc',
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   132
        'ipv4-end-point-demux.cc',
760
975a88259e2e Re-sync WAF build with the latest SConstruct changes.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 729
diff changeset
   133
        'ipv4-impl.cc',
3126
68d35477a842 s/UdpImpl/UdpSocketFactoryImpl
Tom Henderson <tomh@tomh.org>
parents: 2830
diff changeset
   134
        'udp-socket-factory-impl.cc',
3133
295e061719fc change TcpImpl to TcpSocketFactoryImpl
Tom Henderson <tomh@tomh.org>
parents: 3131
diff changeset
   135
        'tcp-socket-factory-impl.cc',
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 1496
diff changeset
   136
        'pending-data.cc',
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 1496
diff changeset
   137
        'sequence-number.cc',
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 1496
diff changeset
   138
        'rtt-estimator.cc',
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   139
        ]
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   140
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   141
    headers = bld.create_obj('ns3header')
3260
8c0ab08144e6 bug 186: internet-node directory must be renamed to internet-stack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 3216
diff changeset
   142
    headers.module = 'internet-stack'
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   143
    headers.source = [
2707
1c353c7aef5b introduce AddInternetStack
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 2609
diff changeset
   144
        'internet-stack.h',
1244
9ee2a9242c10 make sure udp-header.h is exported for main-packet-printer
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents: 1177
diff changeset
   145
        'udp-header.h',
2224
6f97d21a99c2 Added in ns-3-tcp (second try)
Raj Bhattacharjea <raj.b@gatech.edu>
parents: 1496
diff changeset
   146
        'tcp-header.h',
2321
f1a18a24d318 Make sequence-number.h a public header file (because it is included by another public header, tcp-header.h)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 2224
diff changeset
   147
        'sequence-number.h',
3380
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3260
diff changeset
   148
        'ipv4-interface.h',
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3260
diff changeset
   149
        'ipv4-l3-protocol.h',
38b8549b1ad3 Minor doc notes added to ipv4.h
tjkopena@cs.drexel.edu
parents: 3260
diff changeset
   150
        'ipv4-static-routing.h',
537
e8a4183dfe00 Add support for building with WAF
Gustavo J. A. M. Carneiro <gjcarneiro@gmail.com>
parents:
diff changeset
   151
        ]
3579
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
   152
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
   153
    if bld.env()['NSC_ENABLED']:
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
   154
        obj.source.append ('nsc-tcp-socket-impl.cc')
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
   155
        obj.source.append ('nsc-tcp-l4-protocol.cc')
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
   156
        obj.source.append ('nsc-tcp-socket-factory-impl.cc')
9e5eaef3e082 nsc: enable network simulation cradle
Florian Westphal <fw@strlen.de>
parents: 3380
diff changeset
   157
        obj.source.append ('nsc-sysctl.cc')
3595
693faf7f4e9b nsc: Fix build problem if gtk config store is disabled
Florian Westphal <fw@strlen.de>
parents: 3588
diff changeset
   158
        obj.uselib = 'DL'
3628
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   159
        
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   160
        builddir = os.path.abspath(os.path.join(bld.env()['NS3_BUILDDIR'], bld.env ().variant()))
a9c05c7e54f2 Move all NSC related build code into src/internet-stack, to unclutter a bit the main wscript
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents: 3626
diff changeset
   161
        NscBuildTask(builddir)