View | Details | Raw Unified | Return to bug 2459
Collapse All | Expand All

(-)a/CHANGES.html (+2 lines)
 Lines 102-107    Link Here 
102
</ul>
102
</ul>
103
<h2>Changes to build system:</h2>
103
<h2>Changes to build system:</h2>
104
<ul>
104
<ul>
105
  <li> A new waf build option, --check-config, was added to allow users to print the current configuration summary, as appears at the end of ./waf configure.  See bug 2459 for discussion.</li>
106
  <li> The configure summary is now sorted, to make it easier to check the status of optional features.</li>
105
</ul>
107
</ul>
106
<h2>Changed behavior:</h2>
108
<h2>Changed behavior:</h2>
107
This section is for behavioral changes to the models that were not due to a bug fix.
109
This section is for behavioral changes to the models that were not due to a bug fix.
(-)a/RELEASE_NOTES (+2 lines)
 Lines 41-46    Link Here 
41
  this model matches the API and behavior of YansWifiPhy closely, but
41
  this model matches the API and behavior of YansWifiPhy closely, but
42
  over time is expected to support a different PHY abstraction and error
42
  over time is expected to support a different PHY abstraction and error
43
  models.
43
  models.
44
- (build system) New --check-config option to waf to reprint the summary of optional features which are configured.
44
45
45
Bugs fixed
46
Bugs fixed
46
----------
47
----------
 Lines 89-94    Link Here 
89
- Bug 2446 - Comma instead of pipe in Attributes
90
- Bug 2446 - Comma instead of pipe in Attributes
90
- Bug 2351 - Wrong symbol rate calculation for channels with 10 and 5 Mhz width
91
- Bug 2351 - Wrong symbol rate calculation for channels with 10 and 5 Mhz width
91
- Bug 2454 - DsrRouting::NotifyDataReceipt is also triggered for wifi management packets
92
- Bug 2454 - DsrRouting::NotifyDataReceipt is also triggered for wifi management packets
93
- Bug 2458 - Add ./waf --check-config option to reprint the summary of optional features from the configuration.
92
94
93
Known issues
95
Known issues
94
------------
96
------------
(-)a/doc/tutorial/source/getting-started.rst (-19 / +21 lines)
 Lines 392-398    Link Here 
392
following commands::
392
following commands::
393
393
394
  $ ./waf clean
394
  $ ./waf clean
395
  $ ./waf --build-profile=optimized --enable-examples --enable-tests configure
395
  $ ./waf configure --build-profile=optimized --enable-examples --enable-tests
396
396
397
This runs Waf out of the local directory (which is provided as a convenience
397
This runs Waf out of the local directory (which is provided as a convenience
398
for you).  The first command to clean out the previous build is not 
398
for you).  The first command to clean out the previous build is not 
 Lines 453-481    Link Here 
453
  Checking for program doxygen                                     : /usr/local/bin/doxygen 
453
  Checking for program doxygen                                     : /usr/local/bin/doxygen 
454
  ---- Summary of optional NS-3 features:
454
  ---- Summary of optional NS-3 features:
455
  Build profile                 : debug
455
  Build profile                 : debug
456
  BRITE Integration             : not enabled (BRITE not enabled (see option --with-brite))
456
  Build directory               : build
457
  Build directory               : build
458
  Build examples                : enabled
459
  Build tests                   : enabled
460
  Emulated Net Device           : enabled (<netpacket/packet.h> include not detected)
461
  Emulation FdNetDevice         : not enabled (needs netpacket/packet.h)
462
  File descriptor NetDevice     : enabled
463
  GNU Scientific Library (GSL)  : enabled
464
  GtkConfigStore                : enabled
465
  MPI Support                   : enabled
466
  NS-3 Click Integration        : not enabled (nsclick not enabled (see option --with-nsclick))
467
  NS-3 OpenFlow Integration     : not enabled (Required boost libraries not found, missing: system, signals, filesystem)
468
  Network Simulation Cradle     : not enabled (NSC not found (see option --with-nsc))
469
  PlanetLab FdNetDevice         : not enabled (PlanetLab operating system not detected (see option --force-planetlab))
470
  PyViz visualizer              : enabled
457
  Python Bindings               : enabled
471
  Python Bindings               : enabled
458
  BRITE Integration             : not enabled (BRITE not enabled (see option --with-brite))
459
  NS-3 Click Integration        : not enabled (nsclick not enabled (see option --with-nsclick))
460
  GtkConfigStore                : enabled
461
  XmlIo                         : enabled
462
  Threading Primitives          : enabled
463
  Real Time Simulator           : enabled (librt is not available)
472
  Real Time Simulator           : enabled (librt is not available)
464
  Emulated Net Device           : enabled (<netpacket/packet.h> include not detected)
465
  File descriptor NetDevice     : enabled
466
  Tap FdNetDevice               : not enabled (needs linux/if_tun.h)
467
  Emulation FdNetDevice         : not enabled (needs netpacket/packet.h)
468
  PlanetLab FdNetDevice         : not enabled (PlanetLab operating system not detected (see option --force-planetlab))
469
  Network Simulation Cradle     : not enabled (NSC not found (see option --with-nsc))
470
  MPI Support                   : enabled
471
  NS-3 OpenFlow Integration     : not enabled (Required boost libraries not found, missing: system, signals, filesystem)
472
  SQlite stats data output      : enabled
473
  SQlite stats data output      : enabled
473
  Tap Bridge                    : not enabled (<linux/if_tun.h> include not detected)
474
  Tap Bridge                    : not enabled (<linux/if_tun.h> include not detected)
474
  PyViz visualizer              : enabled
475
  Tap FdNetDevice               : not enabled (needs linux/if_tun.h)
476
  Threading Primitives          : enabled
475
  Use sudo to set suid bit      : not enabled (option --enable-sudo not selected)
477
  Use sudo to set suid bit      : not enabled (option --enable-sudo not selected)
476
  Build tests                   : enabled
478
  XmlIo                         : enabled
477
  Build examples                : enabled
478
  GNU Scientific Library (GSL)  : enabled
479
  'configure' finished successfully (1.944s)
479
  'configure' finished successfully (1.944s)
480
480
481
Note the last part of the above output.  Some |ns3| options are not enabled by
481
Note the last part of the above output.  Some |ns3| options are not enabled by
 Lines 485-497    Link Here 
485
would not be enabled and a message would be displayed.  Note further that there is 
485
would not be enabled and a message would be displayed.  Note further that there is 
486
a feature to use the program ``sudo`` to set the suid bit of certain programs.
486
a feature to use the program ``sudo`` to set the suid bit of certain programs.
487
This is not enabled by default and so this feature is reported as "not enabled."
487
This is not enabled by default and so this feature is reported as "not enabled."
488
Finally, to reprint this summary of which optional features are enabled, use
489
the ``--check-config`` option to waf.
488
490
489
Now go ahead and switch back to the debug build that includes the examples and tests.
491
Now go ahead and switch back to the debug build that includes the examples and tests.
490
492
491
::
493
::
492
494
493
  $ ./waf clean
495
  $ ./waf clean
494
  $ ./waf --build-profile=debug --enable-examples --enable-tests configure
496
  $ ./waf configure --build-profile=debug --enable-examples --enable-tests
495
497
496
The build system is now configured and you can build the debug versions of 
498
The build system is now configured and you can build the debug versions of 
497
the |ns3| programs by simply typing
499
the |ns3| programs by simply typing
(-)a/wscript (-24 / +47 lines)
 Lines 146-151    Link Here 
146
    opt.load('cflags')
146
    opt.load('cflags')
147
    opt.load('gnu_dirs')
147
    opt.load('gnu_dirs')
148
148
149
    opt.add_option('--check-config',
150
                   help=('Print the current configuration.'),
151
                   action="store_true", default=False,
152
                   dest="check_config")
153
    
149
    opt.add_option('--cwd',
154
    opt.add_option('--cwd',
150
                   help=('Set the working directory for a program.'),
155
                   help=('Set the working directory for a program.'),
151
                   action="store", type="string", default=None,
156
                   action="store", type="string", default=None,
 Lines 304-309    Link Here 
304
    except conf.errors.ConfigurationError:
309
    except conf.errors.ConfigurationError:
305
        return None
310
        return None
306
311
312
# Write a summary of optional features status
313
def print_config(env, phase='configure'):
314
    if phase == 'configure':
315
        profile = get_build_profile(env)
316
    else:
317
        profile = get_build_profile()
318
        
319
    print("---- Summary of optional NS-3 features:")
320
    print("%-30s: %s%s%s" % ("Build profile", Logs.colors('GREEN'),
321
                             profile, Logs.colors('NORMAL')))
322
    bld = wutils.bld
323
    print("%-30s: %s%s%s" % ("Build directory", Logs.colors('GREEN'),
324
                             Options.options.out, Logs.colors('NORMAL')))
325
    
326
    
327
    for (name, caption, was_enabled, reason_not_enabled) in sorted(env['NS3_OPTIONAL_FEATURES'], key=lambda s : s[1]):
328
        if was_enabled:
329
            status = 'enabled'
330
            color = 'GREEN'
331
        else:
332
            status = 'not enabled (%s)' % reason_not_enabled
333
            color = 'RED'
334
        print("%-30s: %s%s%s" % (caption, Logs.colors(color), status, Logs.colors('NORMAL')))
307
335
308
def configure(conf):
336
def configure(conf):
309
    conf.load('relocation', tooldir=['waf-tools'])
337
    conf.load('relocation', tooldir=['waf-tools'])
 Lines 586-609    Link Here 
586
            value = shlex.split(os.environ[envvar])
614
            value = shlex.split(os.environ[envvar])
587
            conf.env.append_value(confvar, value)
615
            conf.env.append_value(confvar, value)
588
616
589
    # Write a summary of optional features status
617
    print_config(env)
590
    print("---- Summary of optional NS-3 features:")
591
    print("%-30s: %s%s%s" % ("Build profile", Logs.colors('GREEN'),
592
                             Options.options.build_profile, Logs.colors('NORMAL')))
593
    bld = wutils.bld
594
    print("%-30s: %s%s%s" % ("Build directory", Logs.colors('GREEN'),
595
                             Options.options.out, Logs.colors('NORMAL')))
596
    
618
    
597
    
598
    for (name, caption, was_enabled, reason_not_enabled) in sorted(conf.env['NS3_OPTIONAL_FEATURES'], key=lambda s : s[1]):
599
        if was_enabled:
600
            status = 'enabled'
601
            color = 'GREEN'
602
        else:
603
            status = 'not enabled (%s)' % reason_not_enabled
604
            color = 'RED'
605
        print("%-30s: %s%s%s" % (caption, Logs.colors(color), status, Logs.colors('NORMAL')))
606
607
619
608
class SuidBuild_task(Task.Task):
620
class SuidBuild_task(Task.Task):
609
    """task that makes a binary Suid
621
    """task that makes a binary Suid
 Lines 747-758    Link Here 
747
            return obj
759
            return obj
748
    raise KeyError(name)
760
    raise KeyError(name)
749
761
750
762
# Parse the waf lockfile generated by latest 'configure' operation
751
def build(bld):
763
def get_build_profile(env=None):
752
    env = bld.env
764
    if env == None:
753
754
    if Options.options.check_profile:
755
        # Parse the waf lockfile generated by latest 'configure' operation
756
        lockfile = os.environ.get('WAFLOCK', '.lock-waf_%s_build' % sys.platform)
765
        lockfile = os.environ.get('WAFLOCK', '.lock-waf_%s_build' % sys.platform)
757
        profile = "not found"
766
        profile = "not found"
758
        with open(lockfile, "r") as f:
767
        with open(lockfile, "r") as f:
 Lines 764-770    Link Here 
764
                        optkey,optval = x.split(':')
773
                        optkey,optval = x.split(':')
765
                        if (optkey.lstrip() == '\'build_profile\''):
774
                        if (optkey.lstrip() == '\'build_profile\''):
766
                            profile = str(optval.lstrip()).replace("'","")
775
                            profile = str(optval.lstrip()).replace("'","")
767
        print("Build profile: %s" % profile)
776
    else:
777
        profile = Options.options.build_profile
778
    return profile
779
780
def build(bld):
781
    env = bld.env
782
783
    if Options.options.check_config:
784
        print_config(env, 'build')
785
    else:
786
        if Options.options.check_profile:
787
            profile = get_build_profile()
788
            print("Build profile: %s" % profile)
789
        
790
    if Options.options.check_profile or Options.options.check_config:
768
        raise SystemExit(0)
791
        raise SystemExit(0)
769
        return
792
        return
770
793

Return to bug 2459