3 PR
= %r
!(.*?)[/]?shotgun/rubinius
!
9 elsif File
.symlink
?($0)
10 path
= File
.readlink($0)
14 my_name
= File
.basename($0)
17 prefix
= "" if prefix
== "./"
19 unless prefix
[0] == ?/
20 prefix
= File
.expand_path File
.join(Dir
.getwd
, prefix
)
23 real
= File
.join(prefix
, 'shotgun/rubinius.local.bin')
25 # Setup all the crazy library path stuff so that librubinus is picked
31 addition
= "#{@prefix}/shotgun/lib"
34 ENV[name
] = "#{addition}:#{cur}"
40 set_env
'LD_LIBRARY_PATH'
41 set_env
'LD_LIBRARY_PATH_64'
45 set_env
'DYLD_LIBRARY_PATH'
46 set_env
'DYLD_FALLBACK_LIBRARY_PATH'
48 ENV['RBX_IN_BUILDDIR'] = "1"
50 ENV['RBX_PREFIX'] = "#{prefix}/"
52 unless ENV['RBX_BOOTSTRAP']
53 ENV['RBX_BOOTSTRAP'] = "#{prefix}/runtime/bootstrap"
56 unless ENV['RBX_CORE']
57 ENV['RBX_CORE'] = "#{prefix}/runtime/core"
60 unless ENV['RBX_PLATFORM']
61 ENV['RBX_PLATFORM'] = "#{prefix}/runtime/platform"
64 unless ENV['RBX_LOADER']
65 ENV['RBX_LOADER'] = "#{prefix}/runtime/loader.rbc"
68 unless ENV['RBX_PLATFORM_CONF']
69 ENV['RBX_PLATFORM_CONF'] = "#{prefix}/runtime/platform.conf"
72 ENV['RUBYLIB'] = %w(lib stdlib
).map
{ |dir
| File
.join(prefix
, dir
) }.join(":")
77 ENV['PATH'] = "#{prefix}/shotgun:#{ENV['PATH']}"
78 args
= ['-x', "#{prefix}/shotgun/gdbcommands"]
79 if `uname -s` == "Darwin" and `uname -r`.split(".")[0].to_i
< 9
80 args
<< '-x' << "#{prefix}/shotgun/gdbenvironment"
82 args
<< '--args' << "/dev/null"
84 exec
"gdb", *(args
+ ARGV)
85 elsif ARGV[0] == "--valgrind"
88 exec
'valgrind', *(args
+ ARGV)
89 elsif ARGV[0] == "--shark"
91 puts
"Starting up rubinius, then pausing for shark to start"
92 pid
= fork
{ sleep
5; exec real
, *ARGV }
93 exec
"shark -o rbxshark -i -1 -a #{pid}"
94 elsif ARGV[0] == "--dtrace"
96 puts
"Starting up rubinius, then pausing for dtrace to start"
97 pid
= fork
{ sleep
5; exec real
, *ARGV }
98 exec
"dtrace -s #{ENV['SCRIPT']} -p #{pid}"
100 exec
[real
, my_name
], *ARGV