File tree 1 file changed +9
-8
lines changed
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 2
2
require 'rbconfig'
3
3
4
4
def symlink ( old , new )
5
- if File . exists? ( new ) && File . symlink? ( new )
5
+ begin
6
+ File . symlink ( old , new )
7
+ rescue Errno ::EEXIST
6
8
File . unlink ( new )
9
+ retry
7
10
end
8
- File . symlink ( old , new )
9
11
end
10
12
11
13
$CFLAGS += " -D_LONGLONG_TYPE -g"
12
14
have_library ( "dtrace" , "dtrace_open" )
13
15
14
- # Update machine-dependent symlinks in the source, based on $Config::CONFIG
15
-
16
- cpu = Config ::CONFIG [ 'target_cpu' ]
16
+ # Update machine-dependent symlinks in the source, based on $Config::CONFIG and `uname -p`
17
17
os = Config ::CONFIG [ 'target_os' ]
18
-
19
- cpu . gsub! /^i[4-6]86/ , 'i386'
20
18
os . gsub! /[0-9.]+$/ , ''
21
19
20
+ # On OSX, this is "powerpc", even on Intel...
21
+ #cpu = Config::CONFIG['target_cpu']
22
+ cpu = `uname -p` . chomp
23
+
22
24
dir = "#{ cpu } -#{ os } "
23
25
symlink "#{ dir } /dtrace_probe.c" , "dtrace_probe.c"
24
26
25
27
# Create makefile in the usual way
26
-
27
28
create_makefile ( "dtrace_api" )
28
29
You can’t perform that action at this time.
0 commit comments