Skip to content

Commit

Permalink
[Truffle] Build test gems using extconf make
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Fish committed Nov 19, 2016
1 parent 1a6ee07 commit c1acde8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/truffle/cexts/globals/ext/globals/extconf.rb
@@ -1,2 +1,2 @@
require 'mkmf'
create_makefile('minimum')
create_makefile('globals')
3 changes: 3 additions & 0 deletions test/truffle/cexts/xml/ext/xml/extconf.rb
@@ -0,0 +1,3 @@
require 'mkmf'
$CFLAGS += " -I#{ENV['LIBXML_INCLUDE']}"
create_makefile('xml')
3 changes: 3 additions & 0 deletions test/truffle/cexts/xopenssl/ext/xopenssl/extconf.rb
@@ -0,0 +1,3 @@
require 'mkmf'
# $CFLAGS += " -I#{ENV['OPENSSL_INCLUDE']}"
create_makefile('xopenssl')
12 changes: 8 additions & 4 deletions tool/jt.rb
Expand Up @@ -773,11 +773,15 @@ def cextc(cext_dir, *clang_opts)
sulong_link '-o', out, *config_libs, *lls
end

def cextc_extconf(cext_dir, *clang_opts)
def cextc_extconf(cext_dir, test_gem, *clang_opts)
build_ruby_su(cext_dir)

gem_name = File.basename(cext_dir)
gem_dir = Dir.glob(ENV['GEM_HOME'] + "/gems/#{gem_name}*/")[0] + "ext/#{gem_name}/"
gem_dir = if test_gem
"#{JRUBY_DIR}/test/truffle/cexts/#{gem_name}/ext/#{gem_name}/"
else
Dir.glob(ENV['GEM_HOME'] + "/gems/#{gem_name}*/")[0] + "ext/#{gem_name}/"
end
Dir.chdir(gem_dir) do
run("extconf.rb")
raw_sh("make")
Expand Down Expand Up @@ -896,7 +900,7 @@ def test_cexts(*args)
next if gem_name == 'xml' && no_libxml
next if gem_name == 'xopenssl' && no_openssl
dir = "#{JRUBY_DIR}/test/truffle/cexts/#{gem_name}"
cextc dir
cextc_extconf dir, true
name = File.basename(dir)
next if gem_name == 'globals' # globals is excluded just for running
run '--graal', "-I#{dir}/lib", "#{dir}/bin/#{name}", :out => output_file
Expand Down Expand Up @@ -929,7 +933,7 @@ def test_cexts(*args)
if gem_name == "ruby-argon2"
cextc gem_root, '-Werror=implicit-function-declaration'
else
cextc_extconf gem_root, '-Werror=implicit-function-declaration'
cextc_extconf gem_root, false, '-Werror=implicit-function-declaration'
end

next if gem_name == 'psd_native' # psd_native is excluded just for running
Expand Down

0 comments on commit c1acde8

Please sign in to comment.