utils/wscript
author Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
Wed, 03 Oct 2007 19:38:03 +0100
changeset 1669 5ee478e0475e
parent 1664 306c81333d64
child 1764 04f2a1dd7e45
child 1855 ee15fef0cb62
child 2037 e619e734c7ea
permissions -rw-r--r--
Compile mobility-visualizer with -fno-strict-aliasing to avoid GNOME bug #316221

## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import os.path

def configure(conf):
    check = conf.create_pkgconfig_configurator()
    check.name = 'goocanvas gthread-2.0'
    check.uselib = 'MOBILITY_VISUALIZER'
    check.mandatory = False
    conf.env['ENABLE_MOBILITY_VISUALIZER'] = check.run()
    

def build(bld):
    env = bld.env_of_name('default')

    unit_tests = bld.create_ns3_program('run-tests')
    unit_tests.install_var  = 0 # do not install
    unit_tests.unit_test    = 1 # runs on 'waf check'
    unit_tests.source = 'run-tests.cc'
    ## link unit test program with all ns3 modules
    unit_tests.uselib_local = 'ns3'
    
    obj = bld.create_ns3_program('bench-simulator', ['simulator'])
    obj.source = 'bench-simulator.cc'

    obj = bld.create_ns3_program('bench-packets', ['common'])
    obj.source = 'bench-packets.cc'

    obj = bld.create_ns3_program('replay-simulation', ['simulator'])
    obj.source = 'replay-simulation.cc'

    obj = bld.create_ns3_program('print-trace-sources',
                                 ['internet-node', 'csma-cd', 'point-to-point'])
    obj.source = 'print-trace-sources.cc'

    if env['ENABLE_MOBILITY_VISUALIZER']:
        obj = bld.create_ns3_program('mobility-visualizer',
                                     ['internet-node', 'mobility'])
        obj.source = ['mobility-visualizer-model.cc', 'mobility-visualizer-view.cc']
        obj.uselib = 'MOBILITY_VISUALIZER'
        if os.path.basename(obj.env['CXX']).startswith("g++"):
            obj.env.append_value('CXXFLAGS', '-fno-strict-aliasing')