blob: 8f210c6d97812c201e2c9bb182d1979e7e146de2 [file] [log] [blame]
Ilya Moiseenko1762af72011-07-18 16:43:10 -07001## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
2
Alexander Afanasyev45b92d42011-08-14 23:11:38 -07003import os
4import Logs
5import Utils
Alexander Afanasyev2a5df202011-08-15 22:39:05 -07006import Options
7
8def set_options(opt):
9 opt.tool_options('boost')
10
11def configure(conf):
12 conf.check_tool('boost')
13 conf.env['BOOST'] = conf.check_boost(lib = '', # need only base
14 min_version='1.40.0' )
15 if not conf.env['BOOST']:
16 conf.report_optional_feature("ndn-abstract", "NDN abstraction", False,
17 "Required boost libraries not found")
18 conf.env['ENABLE_NDN_ABSTRACT']=False;
19 return
20
21 conf.env['ENABLE_NDN_ABSTRACT']=True;
22
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070023
Ilya Moiseenko1762af72011-07-18 16:43:10 -070024def build(bld):
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070025 module = bld.create_ns3_module ('NDNabstraction', ['applications', 'core', 'network', 'point-to-point'])
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070026 tests = bld.create_ns3_module_test_library('NDNabstraction')
Ilya Moiseenko1762af72011-07-18 16:43:10 -070027 headers = bld.new_task_gen('ns3header')
28 headers.module = 'NDNabstraction'
Alexander Afanasyev2a5df202011-08-15 22:39:05 -070029
30 if not bld.env['ENABLE_NDN_ABSTRACT']:
31 return
32
33 module.find_sources_in_dirs (['model', 'apps', 'helper'],[],['.cc']);
34 tests.find_sources_in_dirs( ['test'], [], ['.cc'] );
Alexander Afanasyevc74a6022011-08-15 20:01:35 -070035 headers.find_sources_in_dirs( ['model', 'apps', 'helper'], [], ['.h'] );
Alexander Afanasyev43e70252011-08-08 18:48:18 -070036
Alexander Afanasyev2a5df202011-08-15 22:39:05 -070037
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070038 for path in ["examples"]:
39 anode = bld.path.find_dir (path)
40 if not anode or not anode.is_child_of(bld.srcnode):
41 raise Utils.WscriptError("Unable to use '%s' - either because \
42 it's not a relative path"", or it's not child of \
43 '%s'."%(name,bld.srcnode))
44 bld.rescan(anode)
45 for filename in bld.cache_dir_contents[anode.id]:
46 if filename.startswith('.') or not filename.endswith(".cc"):
47 continue
48 name = filename[:-len(".cc")]
49 obj = bld.create_ns3_program(name, ['NDNabstraction'])
50 obj.path = obj.path.find_dir (path)
51 obj.source = filename
52 obj.target = name
53 obj.name = obj.target
Ilya Moiseenko1762af72011-07-18 16:43:10 -070054
Ilya Moiseenko54a6bba2011-08-01 11:01:26 -070055 if bld.env['ENABLE_OPENSSL']:
Alexander Afanasyev404c0792011-08-09 17:09:59 -070056 module.uselib = 'OPENSSL'
Ilya Moiseenko54a6bba2011-08-01 11:01:26 -070057
Ilya Moiseenko1762af72011-07-18 16:43:10 -070058 if bld.env['ENABLE_EXAMPLES']:
59 bld.add_subdirs('examples')
60
Ilya Moiseenko02fb7062011-08-11 17:18:00 -070061 bld.ns3_python_bindings()
Alexander Afanasyev43e70252011-08-08 18:48:18 -070062