attempt to detect broken --enable-static invocations.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon May 04 20:21:37 2009 +0200 (9 months ago)
changeset 443656fc927210c6
parent 4433 41a18c7aecfc
child 4437 3e4e052d5058
attempt to detect broken --enable-static invocations.
wscript
     1.1 --- a/wscript	Fri May 01 09:07:04 2009 -0700
     1.2 +++ b/wscript	Mon May 04 20:21:37 2009 +0200
     1.3 @@ -290,9 +290,36 @@
     1.4  
     1.5      conf.find_program('valgrind', var='VALGRIND')
     1.6  
     1.7 -    if Options.options.enable_static and \
     1.8 -            env['PLATFORM'].startswith('linux'):
     1.9 -        conf.env['ENABLE_STATIC_NS3'] = Options.options.enable_static
    1.10 +    env['ENABLE_STATIC_NS3'] = False
    1.11 +    if Options.options.enable_static:
    1.12 +        if env['PLATFORM'].startswith('linux') and \
    1.13 +                env['CXX_NAME'] == 'gcc':
    1.14 +            if os.uname()[4] == 'i386':
    1.15 +                conf.report_optional_feature("static", "Static build", True,
    1.16 +                                             "Enabled by user request")
    1.17 +                env['ENABLE_STATIC_NS3'] = True
    1.18 +            elif os.uname()[4] == 'x86_64':
    1.19 +                if env['ENABLE_PYTHON_BINDINGS'] and \
    1.20 +                        not conf.check_compilation_flag('-mcmodel=large'):
    1.21 +                    conf.report_optional_feature("static", "Static build", False,
    1.22 +                                                 "Can't enable static builds because " + \
    1.23 +                                                     "of python and no -mcmodel=large compiler " \
    1.24 +                                                     "option. Try --disable-python or upgrade your " \
    1.25 +                                                     "compiler.")
    1.26 +                else:
    1.27 +                    conf.report_optional_feature("static", "Static build", True,
    1.28 +                                                 "Enabled by user request. Try --disable-python " \
    1.29 +                                                     "to get higher performance.")
    1.30 +                    env['ENABLE_STATIC_NS3'] = True
    1.31 +                    
    1.32 +        else:
    1.33 +            conf.report_optional_feature("static", "Static build", False,
    1.34 +                                         "Unsupported platform")
    1.35 +    else:
    1.36 +        conf.report_optional_feature("static", "Static build", False,
    1.37 +                                     "option --enable-static not selected")
    1.38 +
    1.39 +
    1.40  
    1.41      # Write a summary of optional features status
    1.42      print "---- Summary of optional NS-3 features:"