Bug 1327 - Version installed ns-3 files

This commit is contained in:
Gustavo Carneiro / Vedran Miletić
2012-01-11 14:34:14 +00:00
parent eecb030ae9
commit ff86ca198d
5 changed files with 24 additions and 13 deletions

View File

@@ -1,5 +1,7 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import wutils
def configure(conf):
have_gtk = conf.pkg_check_modules('GTK_CONFIG_STORE', 'gtk+-2.0 >= 2.12', mandatory=False)
conf.env['ENABLE_GTK_CONFIG_STORE'] = have_gtk
@@ -18,7 +20,7 @@ def configure(conf):
def build(bld):
bld.install_files('${PREFIX}/include/ns3', '../../ns3/config-store-config.h')
bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), '../../ns3/config-store-config.h')
module = bld.create_ns3_module('config-store', ['core', 'network'])
module.source = [

View File

@@ -3,6 +3,8 @@ import sys
import Options
import wutils
def options(opt):
opt.add_option('--int64x64-as-double',
help=('Whether to use a double floating point'
@@ -94,7 +96,7 @@ int main ()
conf.write_config_header('ns3/core-config.h', top=True)
def build(bld):
bld.install_files('${PREFIX}/include/ns3', '../../ns3/core-config.h')
bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), '../../ns3/core-config.h')
core = bld.create_ns3_module('core')
core.source = [

View File

@@ -1,7 +1,9 @@
## -*-Mode : python; py-indent-offset : 4; indent-tabs-mode : nil; coding : utf-8; -*-
import wutils
def build (bld) :
bld.install_files('${PREFIX}/include/ns3', '../../ns3/netanim-config.h')
bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), '../../ns3/netanim-config.h')
module = bld.create_ns3_module ('netanim', ['internet', 'mobility', 'wimax', 'wifi', 'csma'])
module.includes = '.'
module.source = [

View File

@@ -79,7 +79,8 @@ def create_ns3_module(bld, name, dependencies=(), test=False):
module = bld.new_task_gen(features=['cxx', 'cxxstlib', 'ns3module'])
else:
module = bld.new_task_gen(features=['cxx', 'cxxshlib', 'ns3module'])
module.target = '%s/ns3-%s' % (bld.srcnode.relpath_gen(module.path), name)
module.target = '%s/ns%s-%s-%s' % (bld.srcnode.relpath_gen(module.path), wutils.VERSION,
name, bld.env['BUILD_PROFILE'])
linkflags = []
cxxflags = []
ccflags = []
@@ -123,8 +124,8 @@ def create_ns3_module(bld, name, dependencies=(), test=False):
module.env.append_value("INCLUDES", '#')
pcfilegen = bld(features='ns3pcfile')
pcfilegen.module = module
module.pcfilegen = bld(features='ns3pcfile')
module.pcfilegen.module = module
return module
@@ -372,7 +373,7 @@ class ns3pcfile_task(Task.Task):
def _generate_pcfile(self, name, use, env, outfilename):
outfile = open(outfilename, 'wt')
prefix = env.PREFIX
includedir = env.INCLUDEDIR
includedir = Utils.subst_vars('${INCLUDEDIR}/%s%s' % (wutils.APPNAME, wutils.VERSION), env)
libdir = env.LIBDIR
libs = self._self_libs(env, name, '${libdir}')
for dep in use:
@@ -385,7 +386,8 @@ class ns3pcfile_task(Task.Task):
cflags = cflags + self._cflags(dep) + self._cxxflags(dep) + \
self._defines(dep) + self._includes(dep)
if dep.startswith('ns3-'):
requires.append("lib"+dep)
dep_name = dep[4:]
requires.append("libns%s-%s-%s" % (wutils.VERSION, dep_name, env['BUILD_PROFILE']))
print >> outfile, """\
prefix=%s
libdir=%s
@@ -411,7 +413,7 @@ Requires: %s\
@TaskGen.feature('ns3pcfile')
@TaskGen.after_method('process_rule')
def apply(self):
output_filename = 'lib%s.pc' % self.module.name
output_filename = 'lib%s.pc' % os.path.basename(self.module.target)
output_node = self.path.find_or_declare(output_filename)
assert output_node is not None, str(self)
task = self.create_task('ns3pcfile')
@@ -436,7 +438,7 @@ def apply_ns3header(self):
task = self.create_task('ns3header')
task.mode = getattr(self, 'mode', 'install')
if task.mode == 'install':
self.bld.install_files('${PREFIX}/include/ns3', [src_node])
self.bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), [src_node])
task.set_inputs([src_node])
task.set_outputs([dst_node])
else:
@@ -630,7 +632,7 @@ def apply_ns3moduleheader(self):
task.mode = getattr(self, "mode", "install")
if task.mode == 'install':
assert module_obj is not None, self.module
self.bld.install_files('${PREFIX}/include/ns3',
self.bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION),
ns3_dir_node.find_or_declare("%s-module.h" % self.module))
task.set_inputs(all_headers_inputs)
task.set_outputs(all_headers_outputs)

View File

@@ -320,6 +320,7 @@ def configure(conf):
env.append_value('DEFINES', 'NS3_LOG_ENABLE')
env['PLATFORM'] = sys.platform
env['BUILD_PROFILE'] = Options.options.build_profile
if conf.env['CXX_NAME'] in ['gcc', 'icc']:
if Options.options.build_profile == 'release':
@@ -570,7 +571,7 @@ def create_suid_program(bld, name):
program.is_ns3_program = True
program.module_deps = list()
program.name = name
program.target = name
program.target = "%s%s-%s-%s" % (wutils.APPNAME, wutils.VERSION, name, bld.env.BUILD_PROFILE)
if bld.env['ENABLE_SUDO']:
program.create_task("SuidBuild")
@@ -584,7 +585,7 @@ def create_ns3_program(bld, name, dependencies=('core',)):
program.is_ns3_program = True
program.name = name
program.target = program.name
program.target = "%s%s-%s-%s" % (wutils.APPNAME, wutils.VERSION, name, bld.env.BUILD_PROFILE)
# Each of the modules this program depends on has its own library.
program.ns3_module_dependencies = ['ns3-'+dep for dep in dependencies]
program.includes = "# #/.."
@@ -628,6 +629,7 @@ def add_scratch_programs(bld):
obj.find_sources_in_dirs('.')
obj.target = filename
obj.name = obj.target
obj.install_path = None
elif filename.endswith(".cc"):
name = filename[:-len(".cc")]
obj = bld.create_ns3_program(name, all_modules)
@@ -635,6 +637,7 @@ def add_scratch_programs(bld):
obj.source = filename
obj.target = name
obj.name = obj.target
obj.install_path = None
def _get_all_task_gen(self):