From a9db53ef7732ca58c96a6ba0c7e88ab7ebe96dd6 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 29 May 2016 03:08:45 +0000 Subject: auto_ext.rb * ext/-test-/auto_ext.rb (auto_ext): utitily method to create extension libraries for tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/-test-/file/extconf.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'ext/-test-/file') diff --git a/ext/-test-/file/extconf.rb b/ext/-test-/file/extconf.rb index c4cfdadcaf..321c173f4c 100644 --- a/ext/-test-/file/extconf.rb +++ b/ext/-test-/file/extconf.rb @@ -1,5 +1,5 @@ # frozen_string_literal: false -$INCFLAGS << " -I$(topdir) -I$(top_srcdir)" +require_relative "../auto_ext.rb" headers = %w[sys/param.h sys/mount.h sys/vfs.h].select {|h| have_header(h)} if have_type("struct statfs", headers) @@ -14,9 +14,4 @@ if have_type("struct statvfs", headers) have_struct_member("struct statvfs", "f_type", headers) end -$srcs = Dir[File.join($srcdir, "*.{#{SRC_EXT.join(%q{,})}}")] -inits = $srcs.map {|s| File.basename(s, ".*")} -inits.delete("init") -inits.map! {|s|"X(#{s})"} -$defs << "-DTEST_INIT_FUNCS(X)=\"#{inits.join(' ')}\"" -create_makefile("-test-/file") +auto_ext(inc: true) -- cgit v1.2.3