Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 1 | ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
| 2 | |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 3 | import os |
| 4 | import Logs |
| 5 | import Utils |
Alexander Afanasyev | 2a5df20 | 2011-08-15 22:39:05 -0700 | [diff] [blame] | 6 | import Options |
| 7 | |
| 8 | def set_options(opt): |
| 9 | opt.tool_options('boost') |
| 10 | |
| 11 | def 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 Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 23 | |
Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 24 | def build(bld): |
Ilya Moiseenko | 1eff17d | 2011-08-17 10:55:53 -0700 | [diff] [blame] | 25 | module = bld.create_ns3_module ('NDNabstraction', ['applications', 'core', 'network', 'point-to-point','topology-read','visualizer']) |
Alexander Afanasyev | 404c079 | 2011-08-09 17:09:59 -0700 | [diff] [blame] | 26 | |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 27 | tests = bld.create_ns3_module_test_library('NDNabstraction') |
Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 28 | headers = bld.new_task_gen('ns3header') |
| 29 | headers.module = 'NDNabstraction' |
Alexander Afanasyev | 2a5df20 | 2011-08-15 22:39:05 -0700 | [diff] [blame] | 30 | |
| 31 | if not bld.env['ENABLE_NDN_ABSTRACT']: |
| 32 | return |
| 33 | |
| 34 | module.find_sources_in_dirs (['model', 'apps', 'helper'],[],['.cc']); |
| 35 | tests.find_sources_in_dirs( ['test'], [], ['.cc'] ); |
Alexander Afanasyev | c74a602 | 2011-08-15 20:01:35 -0700 | [diff] [blame] | 36 | headers.find_sources_in_dirs( ['model', 'apps', 'helper'], [], ['.h'] ); |
Alexander Afanasyev | 43e7025 | 2011-08-08 18:48:18 -0700 | [diff] [blame] | 37 | |
Alexander Afanasyev | 2a5df20 | 2011-08-15 22:39:05 -0700 | [diff] [blame] | 38 | |
Alexander Afanasyev | 45b92d4 | 2011-08-14 23:11:38 -0700 | [diff] [blame] | 39 | for path in ["examples"]: |
| 40 | anode = bld.path.find_dir (path) |
| 41 | if not anode or not anode.is_child_of(bld.srcnode): |
| 42 | raise Utils.WscriptError("Unable to use '%s' - either because \ |
| 43 | it's not a relative path"", or it's not child of \ |
| 44 | '%s'."%(name,bld.srcnode)) |
| 45 | bld.rescan(anode) |
| 46 | for filename in bld.cache_dir_contents[anode.id]: |
| 47 | if filename.startswith('.') or not filename.endswith(".cc"): |
| 48 | continue |
| 49 | name = filename[:-len(".cc")] |
| 50 | obj = bld.create_ns3_program(name, ['NDNabstraction']) |
| 51 | obj.path = obj.path.find_dir (path) |
| 52 | obj.source = filename |
| 53 | obj.target = name |
| 54 | obj.name = obj.target |
Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 55 | |
Ilya Moiseenko | 54a6bba | 2011-08-01 11:01:26 -0700 | [diff] [blame] | 56 | if bld.env['ENABLE_OPENSSL']: |
Alexander Afanasyev | 404c079 | 2011-08-09 17:09:59 -0700 | [diff] [blame] | 57 | module.uselib = 'OPENSSL' |
Ilya Moiseenko | 54a6bba | 2011-08-01 11:01:26 -0700 | [diff] [blame] | 58 | |
Ilya Moiseenko | 1762af7 | 2011-07-18 16:43:10 -0700 | [diff] [blame] | 59 | if bld.env['ENABLE_EXAMPLES']: |
| 60 | bld.add_subdirs('examples') |
| 61 | |
Ilya Moiseenko | 02fb706 | 2011-08-11 17:18:00 -0700 | [diff] [blame] | 62 | bld.ns3_python_bindings() |
Alexander Afanasyev | 43e7025 | 2011-08-08 18:48:18 -0700 | [diff] [blame] | 63 | |