I'm not sure if this is a Mac-only problem or what, but we were getting incompatible-function-pointer errors when trying to build the RocketAMF C extensions. This fixes that! (Maybe it's like, Mac-only but as of Ruby 3.4 in specific? We're running RocketAMF in production on Ruby 3.4 right now without this. Shrug.)
18 lines
No EOL
517 B
Ruby
18 lines
No EOL
517 B
Ruby
require 'mkmf'
|
|
|
|
# Disable the native extension by creating an empty Makefile on JRuby
|
|
if defined? JRUBY_VERSION
|
|
message "Generating phony Makefile for JRuby so the gem installs"
|
|
mfile = File.join(File.dirname(__FILE__), 'Makefile')
|
|
File.open(mfile, 'w') {|f| f.write dummy_makefile(File.dirname(__FILE__)) }
|
|
exit 0
|
|
end
|
|
|
|
if enable_config("sort-props", false)
|
|
$defs.push("-DSORT_PROPS") unless $defs.include? "-DSORT_PROPS"
|
|
end
|
|
have_func('rb_str_encode')
|
|
|
|
$CFLAGS += " -Wall"
|
|
|
|
create_makefile('rocketamf_ext') |