Last active
October 7, 2021 16:50
-
-
Save criess/b67fa4b4251162c5c0d69a3c9fcd0c39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if RUBY_PLATFORM =~ /darwin/ && !File.exists?(RbConfig::CONFIG["rubyarchhdrdir"]) | |
RbConfig::CONFIG["rubyarchhdrdir"].sub!(RUBY_PLATFORM.split('-').last, Dir.entries(File.dirname(RbConfig::CONFIG["rubyarchhdrdir"])).reject{|d|d.start_with?(".","ruby")}.first.split('-').last) | |
end | |
RbConfig::CONFIG["rubyhdrdir"].gsub!(/^/, '/app/ruby') | |
RbConfig::CONFIG["rubyarchhdrdir"].gsub!(/^/, '/app/ruby') | |
RbConfig::CONFIG["archlibdir"].gsub!(/^/, '/app/ruby') | |
require 'mkmf' | |
$LIBS << " -lpthread" if $LIBS !~ /-lpthread/ | |
$CFLAGS << " -g" | |
if RUBY_PLATFORM =~ /solaris/ | |
have_library('xnet') | |
$CFLAGS << " -D_XPG4_2" | |
$CFLAGS << " -D__EXTENSIONS__" | |
if RUBY_PLATFORM =~ /solaris2.9/ | |
$CFLAGS << " -D__SOLARIS9__" | |
end | |
end | |
have_header('alloca.h') | |
have_header('ruby/version.h') | |
have_header('ruby/io.h') | |
have_header('ruby/thread.h') | |
have_var('ruby_version') | |
have_func('rb_thread_io_blocking_region', 'ruby/io.h') | |
have_func('rb_thread_call_without_gvl', 'ruby/thread.h') | |
with_cflags($CFLAGS) do | |
create_makefile('passenger_native_support') | |
if RUBY_PLATFORM =~ /solaris/ | |
# Fix syntax error in Solaris /usr/ccs/bin/make. | |
# https://code.google.com/p/phusion-passenger/issues/detail?id=999 | |
makefile = File.read("Makefile") | |
makefile.sub!(/^ECHO = .*/, "ECHO = echo") | |
File.open("Makefile", "w") do |f| | |
f.write(makefile) | |
end | |
elsif RUBY_PLATFORM =~ /darwin/ | |
# The OS X Clang 503.0.38 update (circa March 15 2014) broke | |
# /usr/bin/ruby's mkmf. mkmf inserts -multiply_definedsuppress | |
# into the Makefile, but that flag is no longer supported by | |
# Clang. We remove this manually. | |
makefile = File.read("Makefile") | |
makefile.sub!(/-multiply_definedsuppress/, "") | |
File.open("Makefile", "w") do |f| | |
f.write(makefile) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment