summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2021-05-29 13:39:20 +0900
committernagachika <nagachika@ruby-lang.org>2021-05-29 13:39:20 +0900
commit9d63a8dd0beefa49796eb86ab688c2eb0cd89a20 (patch)
treef459389c444b33e80cf2b4738b9eabb5e4d40f2f /test
parent5af5ea7f860ed64062796e54e73274e7a56c7280 (diff)
merge revision(s) 5cdf99f64e344b8e4638824d55f5caf33be682ca: [Backport #17761]
mkmf: fixed install directories of header files in extension libraries [Bug #17761] When installing an extension library which provides a header, that header should be installed under site_ruby (or vendor_ruby when "--vendor" option was given to extconf.rb). However, currently this file is about to be installed in the core include directory. --- lib/mkmf.rb | 8 ++++---- test/mkmf/test_install.rb | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 test/mkmf/test_install.rb
Diffstat (limited to 'test')
-rw-r--r--test/mkmf/test_install.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/mkmf/test_install.rb b/test/mkmf/test_install.rb
new file mode 100644
index 0000000000..7f8c603d42
--- /dev/null
+++ b/test/mkmf/test_install.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: false
+require_relative 'base'
+
+class TestMkmf
+ class TestInstall < TestMkmf
+ def test_install_dirs
+ Dir.mktmpdir do |dir|
+ File.write(dir+"/extconf.rb", "require 'mkmf'; create_makefile('test')")
+ all_assertions do |a|
+ a.foreach(
+ ["site"],
+ ["vendor", "--vendor"],
+ ) do |dest, *options|
+ assert_ruby_status(["-C", dir, "extconf.rb", *options])
+ mf = File.read(dir+"/Makefile")
+ a.foreach(
+ ["RUBYCOMMONDIR", "$(#{dest}dir)$(target_prefix)"],
+ ["RUBYLIBDIR", "$(#{dest}libdir)$(target_prefix)"],
+ ["RUBYARCHDIR", "$(#{dest}archdir)$(target_prefix)"],
+ ["HDRDIR", "$(#{dest}hdrdir)$(target_prefix)"],
+ ["ARCHHDRDIR", "$(#{dest}archhdrdir)$(target_prefix)"],
+ ) do |(var, path)|
+ assert_equal path, mf[/^#{var}\s*=\s*(.*)$/, 1]
+ end
+ end
+ end
+ end
+ end
+ end
+end