equal
deleted
inserted
replaced
1 ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
1 ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- |
2 |
2 |
3 import os.path |
3 import os.path |
|
4 |
|
5 from waflib import Options |
|
6 |
|
7 def options(opt): |
|
8 opt.add_option('--force-planetlab', |
|
9 help=('Forces compilation of PlanetLab even if not suported by the local system'), |
|
10 dest='force_planetlab', default=False, action="store_true") |
4 |
11 |
5 def configure(conf): |
12 def configure(conf): |
6 conf.env['ENABLE_FDNETDEV'] = False |
13 conf.env['ENABLE_FDNETDEV'] = False |
7 |
14 |
8 if conf.env['ENABLE_THREADING']: |
15 if conf.env['ENABLE_THREADING']: |
70 "needs netpacket/packet.h") |
77 "needs netpacket/packet.h") |
71 |
78 |
72 # Enable use of PlanetLab TAP helper |
79 # Enable use of PlanetLab TAP helper |
73 # TODO: How to validate |
80 # TODO: How to validate |
74 (sysname, nodename, release, version, machine) = os.uname() |
81 (sysname, nodename, release, version, machine) = os.uname() |
75 if release.find('onelab') != -1: |
82 if release.find('onelab') != -1 or Options.options.force_planetlab: |
76 conf.env['ENABLE_PLANETLAB'] = True |
83 conf.env['ENABLE_PLANETLAB'] = True |
77 |
84 |
78 if conf.env['ENABLE_PLANETLAB']: |
85 if conf.env['ENABLE_PLANETLAB']: |
79 conf.report_optional_feature("PlanetLabFdNetDevice", |
86 conf.report_optional_feature("PlanetLabFdNetDevice", |
80 "PlanetLab FdNetDevice", |
87 "PlanetLab FdNetDevice", |
82 "Planetlab support enabled") |
89 "Planetlab support enabled") |
83 else: |
90 else: |
84 conf.report_optional_feature("PlanetLabFdNetDevice", |
91 conf.report_optional_feature("PlanetLabFdNetDevice", |
85 "PlanetLab FdNetDevice", |
92 "PlanetLab FdNetDevice", |
86 False, |
93 False, |
87 "PlanetLab operating system not detected") |
94 "PlanetLab operating system not detected (see option --force-planetlab)") |
88 |
95 |
89 def build(bld): |
96 def build(bld): |
90 # Don't do anything for this module if emu's not enabled. |
97 # Don't do anything for this module if emu's not enabled. |
91 if not bld.env['ENABLE_FDNETDEV']: |
98 if not bld.env['ENABLE_FDNETDEV']: |
92 return |
99 return |