diff -r 1ccc02a7676b wscript --- a/wscript Wed Sep 16 15:03:25 2009 +0100 +++ b/wscript Thu Sep 17 16:53:08 2009 +0400 @@ -194,6 +194,10 @@ help=('Compile NS-3 statically: works only on linux, without python'), dest='enable_static', action='store_true', default=False) + opt.add_option('--enable-strip', + help=('Remove all symbol table and relocation information from the executable'), + dest='enable_strip', action='store_true', + default=False) # options provided in a script in a subdirectory named "src" opt.sub_options('src') @@ -324,6 +328,15 @@ conf.report_optional_feature("ENABLE_SUDO", "Use sudo to set suid bit", env['ENABLE_SUDO'], why_not_sudo) + # enable executables strip + if Options.options.enable_strip: + env['ENABLE_STRIP'] = True + conf.report_optional_feature("strip", "Strip executables", True, '') + else: + env['ENABLE_STRIP'] = False + conf.report_optional_feature("strip", "Strip executables", False, + "option --enable-strip not selected") + # we cannot pull regression traces without mercurial conf.find_program('hg', var='MERCURIAL') @@ -441,6 +454,8 @@ program.env.append_value('LINKFLAGS', '-Wl,--whole-archive,-Bstatic') program.env.append_value('LINKFLAGS', '-lns3') program.env.append_value('LINKFLAGS', '-Wl,-Bdynamic,--no-whole-archive') + if program.env['ENABLE_STRIP']: + program.env.append_value('LINKFLAGS', '-s') return program def add_scratch_programs(bld):