```ruby
require 'mkmf'
require 'rbconfig'

def symlink(old, new)
  if File.exists?(new) && File.symlink?(new)
    File.unlink(new)
  end
  File.symlink(old, new)
end

$CFLAGS += " -D_LONGLONG_TYPE -g"
have_library("dtrace", "dtrace_open")

# Update machine-dependent symlinks in the source, based on $Config::CONFIG

cpu = Config::CONFIG['target_cpu']
os  = Config::CONFIG['target_os']

cpu.gsub! /^i[4-6]86/, 'i386'
os.gsub!  /[0-9.]+$/, ''

dir = "#{cpu}-#{os}"
symlink "#{dir}/dtrace_probe.c", "dtrace_probe.c"

# Create makefile in the usual way

create_makefile("dtrace_api")

```

Switch platform detection to shell out to uname -p -- Config::Config['target'] lies on Intel with Apple's Universal ruby.
user
```ruby
require 'mkmf'
require 'rbconfig'

def symlink(old, new)
  begin
    File.symlink(old, new)
  rescue Errno::EEXIST
    File.unlink(new)
    retry
  end
end

$CFLAGS += " -D_LONGLONG_TYPE -g"
have_library("dtrace", "dtrace_open")

# Update machine-dependent symlinks in the source, based on $Config::CONFIG and `uname -p`
os  = Config::CONFIG['target_os']
os.gsub!  /[0-9.]+$/, ''

# On OSX, this is "powerpc", even on Intel...
#cpu = Config::CONFIG['target_cpu']
cpu = `uname -p`.chomp

dir = "#{cpu}-#{os}"
symlink "#{dir}/dtrace_probe.c", "dtrace_probe.c"

# Create makefile in the usual way
create_makefile("dtrace_api")

```
assistant