merge
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Fri, 18 May 2007 17:28:15 +0200
changeset 653 1cbe10298f91
parent 652 b7867dad0b7a (current diff)
parent 651 a59b1caeb7f1 (diff)
child 654 77ced4ddc0f7
merge
--- a/src/wscript	Fri May 18 17:26:28 2007 +0200
+++ b/src/wscript	Fri May 18 17:28:15 2007 +0200
@@ -17,17 +17,20 @@
 
 def set_options(opt):
     opt.sub_options('simulator')
+    opt.add_option('--enable-rpath',
+                   help=("Link programs with rpath"),
+                   action="store_true", dest='enable_rpath',
+                   default=(sys.platform != 'linux2'))
     opt.add_option('--disable-rpath',
                    help=("Don't link programs with rpath"),
-                   action="store_true", default=False,
-                   dest='disable_rpath')
-
+                   action="store_false", dest='enable_rpath',
+                   default=(sys.platform != 'linux2'))
 
 def configure(conf):
     conf.sub_config('core')
     conf.sub_config('simulator')
 
-    conf.env['DISABLE_RPATH'] = Params.g_options.disable_rpath
+    conf.env['ENABLE_RPATH'] = Params.g_options.enable_rpath
 
 
 def build(bld):
@@ -36,13 +39,13 @@
     ## Note: this is slightly evil; we get away because our programs
     ## and libs are not supposed to be installed system wide.
     env = bld.env_of_name('default')
-    if not env['DISABLE_RPATH']:
+    if not env['ENABLE_RPATH']:
         for module in all_modules:
             node = bld.m_curdirnode.find_dir(module)
             if sys.platform == 'win32':
                 os.environ["PATH"] = ';'.join([os.environ["PATH"], node.abspath(env)])
             else:
-                env.append_value('RPATH', '-Wl,--rpath=%s' % (node.abspath(env),))
+                env.append_value('RPATH', '-Wl,-rpath=%s' % (node.abspath(env),))
     
     bld.add_subdirs(all_modules)