Skip to content

Commit

Permalink
Avoid using -bundle with -dynamiclib on darwin.
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Oct 3, 2011
1 parent 4e10d14 commit d057450
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configure
Expand Up @@ -118,7 +118,7 @@ class Configure


# TODO: add conditionals for platforms # TODO: add conditionals for platforms
if RbConfig::CONFIG["build_os"] =~ /darwin/ if RbConfig::CONFIG["build_os"] =~ /darwin/
@ldshared = "#{@cc} -dynamic -bundle -undefined suppress -flat_namespace" @ldshared = "#{@cc} -bundle -undefined suppress -flat_namespace"
else else
@ldshared = "#{@cc} -shared" @ldshared = "#{@cc} -shared"
end end
Expand Down
11 changes: 9 additions & 2 deletions rakelib/ext_helper.rb
Expand Up @@ -99,7 +99,14 @@ def add_mri_capi
$LIBS << " #{DEFAULT["LIBS"]}" $LIBS << " #{DEFAULT["LIBS"]}"
$LIBS << " #{DEFAULT["DLDLIBS"]}" $LIBS << " #{DEFAULT["DLDLIBS"]}"


unless RUBY_PLATFORM =~ /mingw/ case RUBY_PLATFORM
when /mingw/
# do nothing
when /darwin/
# necessary to avoid problems with RVM injecting flags into the MRI build
# process.
add_ldflag DEFAULT["LDSHARED"].split[1..-1].join(' ').gsub(/-dynamiclib/, "")
else
add_ldflag DEFAULT["LDSHARED"].split[1..-1].join(' ') add_ldflag DEFAULT["LDSHARED"].split[1..-1].join(' ')
end end


Expand Down Expand Up @@ -183,7 +190,7 @@ def add_rbx_capi
when /darwin/ when /darwin/
# on Unix we need a g++ link, not gcc. # on Unix we need a g++ link, not gcc.
# Ff line contributed by Daniel Harple. # Ff line contributed by Daniel Harple.
$LDSHARED = "#{$CXX} -dynamic -bundle -undefined suppress -flat_namespace -lstdc++" $LDSHARED = "#{$CXX} -bundle -undefined suppress -flat_namespace -lstdc++"


when /aix/ when /aix/
$LDSHARED = "#{$CXX} -shared -Wl,-G -Wl,-brtl" $LDSHARED = "#{$CXX} -shared -Wl,-G -Wl,-brtl"
Expand Down
2 changes: 1 addition & 1 deletion spec/ruby/optional/capi/rake_helper.rb
Expand Up @@ -7,7 +7,7 @@
case PLATFORM case PLATFORM
when /darwin/ when /darwin/
output = "#{$cwd}/#{$ext_name}.bundle" output = "#{$cwd}/#{$ext_name}.bundle"
build_cmd = "cc -dynamic -bundle -undefined suppress -flat_namespace #{common} -o #{output}" build_cmd = "cc -bundle -undefined suppress -flat_namespace #{common} -o #{output}"
else else
output = "#{$cwd}/#{$ext_name}.so" output = "#{$cwd}/#{$ext_name}.so"
build_cmd = "cc -shared #{common} -o #{output}" build_cmd = "cc -shared #{common} -o #{output}"
Expand Down

0 comments on commit d057450

Please sign in to comment.