[Xorp-hackers] Building without strip enabled?

Ben Greear greearb at candelatech.com
Tue Sep 29 17:29:44 PDT 2009


It seems the upstream code won't build without stripping.  The
patch below allows me to have this work as I expected:

scons strip=no install

diff --git a/SConstruct b/SConstruct
index ffec87f..aca5d96 100644
--- a/SConstruct
+++ b/SConstruct
@@ -133,9 +133,8 @@ print 'CXX:              ', env['CXX']
  env['STRIP'] = ARGUMENTS.get('STRIP', 'strip')
  print 'STRIP:            ', env['STRIP']

-if env['strip']:
-    env['strip'] = True
-print 'Strip binaries:   ', env.has_key('strip')
+env['strip'] = ARGUMENTS.get('strip', 'yes')
+print 'Strip binaries:   ', env['strip']

  if env['shared']:
      env['SHAREDLIBS'] = "defined"
@@ -165,7 +164,7 @@ def InstallProgram(env, dest, files, perm = 0755):
      obj = env.Install(dest, files)
      for i in obj:
         env.AddPostAction(i, env.Chmod(str(i), perm))
-       if env.has_key('strip') and env.has_key('STRIP'):
+       if (env['strip'] == 'yes') and env.has_key('STRIP'):
             env.AddPostAction(i, Action("$STRIP $TARGET"))
      return obj
  SConsEnvironment.InstallProgram = InstallProgram
@@ -187,7 +186,7 @@ def InstallLibrary(env, dest, files, perm = 0644):
      obj = env.Install(dest, files)
      for i in obj:
         env.AddPostAction(i, env.Chmod(str(i), perm))
-       if env.has_key('strip') and env.has_key('STRIP'):
+       if (env['strip'] == 'yes') and env.has_key('STRIP'):
             env.AddPostAction(i, Action("$STRIP --strip-unneeded $TARGET"))
      return obj
  SConsEnvironment.InstallLibrary = InstallLibrary

-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



More information about the Xorp-hackers mailing list