[Ns-developers] Why we believe that only x86 can use static libraries?

YunQiang Su wzssyqa at gmail.com
Mon Sep 19 08:31:13 PDT 2011


In ns-3.12.1/wscript
Line 327, we hardcode linux&&x86 in it.

    env['ENABLE_STATIC_NS3'] = False
    if Options.options.enable_static or
Options.options.enable_shared_and_static:
        if env['PLATFORM'].startswith('linux') and \
                env['CXX_NAME'] in ['gcc', 'icc']:
            if re.match('i[3-6]86', os.uname()[4]):
                conf.report_optional_feature("static", "Static build", True, '')
                if Options.options.enable_static:
                    env['ENABLE_STATIC_NS3'] = True
                if Options.options.enable_shared_and_static:
                    env['ENABLE_SHARED_AND_STATIC_NS3'] = True
            elif os.uname()[4] == 'x86_64':
                if env['ENABLE_PYTHON_BINDINGS'] and \
                        not conf.check_compilation_flag('-mcmodel=large'):
                    conf.report_optional_feature("static", "Static
build", False,
                                                 "Can't enable static
builds because " + \
                                                     "no
-mcmodel=large compiler " \
                                                     "option. Try
--disable-python or upgrade your " \
                                                     "compiler to at
least gcc 4.3.x.")
                else:
                    conf.report_optional_feature("static", "Static
build", True, '')
                    if Options.options.enable_static:
                        env['ENABLE_STATIC_NS3'] = True
                    if Options.options.enable_shared_and_static:
                        env['ENABLE_SHARED_AND_STATIC_NS3'] = True
        elif env['CXX_NAME'] == 'gcc' and \
                (env['PLATFORM'].startswith('darwin') or \
                     env['PLATFORM'].startswith('cygwin')):
                conf.report_optional_feature("static", "Static build", True, '')
                if Options.options.enable_static:
                    env['ENABLE_STATIC_NS3'] = True
                if Options.options.enable_shared_and_static:
                    env['ENABLE_SHARED_AND_STATIC_NS3'] = True
        else:
            conf.report_optional_feature("static", "Static build", False,
                                         "Unsupported platform")
    else:
        conf.report_optional_feature("static", "Static build", False,
                                     "option --enable-static not selected")

-- 
YunQiang Su


More information about the Ns-developers mailing list