Bug 1136 - --enable-static is not working on ppc linux platform
--enable-static is not working on ppc linux platform
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: general
ns-3-dev
Mac powerpc Linux
: P5 critical
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-11 15:08 EDT by baofenye
Modified: 2011-09-25 10:58 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description baofenye 2011-05-11 15:08:03 EDT
./waf configure --enable-static

...
...
...
Static build                  : enabled
...
...
...

The report says static build is enabled, but the following python codes in wscript never catch the case for ppc-linux to set env['ENABLE_STATIC_NS3'] = True, and after running ./waf build it still build shared ns3 libraries.

If I set env['ENABLE_STATIC_NS3'] = True by changing wscript, it works and builds static libraries.

FY

********************************************************************************
wscript:
   382 
   383     env['ENABLE_STATIC_NS3'] = False
   384     if Options.options.enable_static:
   385         if env['PLATFORM'].startswith('linux') and \
   386                 env['CXX_NAME'] in ['gcc', 'icc']:
   387             if re.match('i[3-6]86', os.uname()[4]):
   388                 conf.report_optional_feature("static", "Static build", True, '')
   389                 env['ENABLE_STATIC_NS3'] = True
   390             elif os.uname()[4] == 'x86_64':
   391                 if env['ENABLE_PYTHON_BINDINGS'] and \
   392                         not conf.check_compilation_flag('-mcmodel=large'):
   393                     conf.report_optional_feature("static", "Static build", False,
   394                                                  "Can't enable static builds because " + \
   395                                                      "no -mcmodel=large compiler " \
   396                                                      "option. Try --disable-python or upgrade your " \
   397                                                      "compiler to at least gcc 4.3.x.")
   398                 else:
   399                     conf.report_optional_feature("static", "Static build", True, '')
   400                     env['ENABLE_STATIC_NS3'] = True                    
   401         elif env['CXX_NAME'] == 'gcc' and \
   402                 (env['PLATFORM'].startswith('darwin') or \
   403                      env['PLATFORM'].startswith('cygwin')):
   404                 conf.report_optional_feature("static", "Static build", True, '')
   405                 env['ENABLE_STATIC_NS3'] = True
   406         else:
   407             conf.report_optional_feature("static", "Static build", False,
   408                                          "Unsupported platform")
   409     else:
   410         conf.report_optional_feature("static", "Static build", False,
   411                                      "option --enable-static not selected")
********************************************************************************
Comment 1 Gustavo J. A. M. Carneiro 2011-09-25 10:58:35 EDT
I think this is fixed now in ns-3-dev: http://code.nsnam.org/ns-3-dev/rev/fd2a26e455b3