Introduce a new mkmf option `--target-rbconfig` to specify the RbConfig
file for the deployment target platform. This option is useful for
cross-compiling Ruby extensions without faking the global top-level
`RbConfig` constant.
This commit is to add an extra option to enable verbose mode (V=1) in the
generated `Makefile` at runtime of the Ruby to print compiler command lines by
the commands below when building native extensions. It's possible to enable the
verbose mode by setting the environment variable `MAKEFLAGS="V=1"`[1]
implemented in GNU make. However, I wanted to make a consistent user-interface
not depending on the specific make's implementation.
```
$ ruby /path/to/extconf.rb -- --with-verbose
```
You can also add the extra option via rake-compiler gem.
```
$ rake compiler -- --with-verbose
```
If the extra option is not given, the value of the
`RbConfig::CONFIG["MKMF_VERBOSE"]` enabled by the configure option below is
used.
```
$ ./configure --enable-mkmf-verbose
```
For the unit tests, updated the following files.
* The `test/mkmf/test_configuration.rb` was created to test the cases with the
`configuration` method and this implementation.
* Updated the `TestMkmf#assert_separately` to set the extra
arguments in `test/mkmf/base.rb`. Updated tests using the `assert_separately`.
* Added tests for `MakeMakefile#with_config` in the `test/mkmf/test_config.rb`.
[1] https://www.gnu.org/software/make/manual/html_node/Variables_002fRecursion.html
Fixes [Bug #19695]
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
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.
Make write methods of IO-like objects accept multiple arguments,
as well as IO#write.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/mkmf/test_framework.rb (test_single_framework): fix header
file name for case-sensitive filesystem. it may not be same as
the framework name, but should be the actual file name.
[ruby-dev:50093] [Bug #13489]
* test/mkmf/test_framework.rb (test_multi_frameworks): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (find_executable0): On Windows, it is actually valid
to surround individual PATH directory entries with double
quotes. Remove these before joining the path as otherwise the
literal quotes would become part of the path, resulting in the
executable not to be found. [Fix GH-1305]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Add assertion to examine the existence of HAVE_RUBY_INIT.
* test/mkmf/test_have_func.rb (test_not_have_func):
Add assertion to examine the absence of HAVE_RUBY_INIT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
When you change this to true, you may need to add more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/mkmf/test_framework.rb (test_single_framework): use Ruby
framework, as CoreFoundation framework uses Apple extensions
unsupported by standard GCC other than Apple-patched clang.
* test/mkmf/test_framework.rb (test_multi_frameworks): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): get rid of
interference by modifying global variables in have_devel? method.
[ruby-core:67962] [Bug #10821]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (have_framework): try without -ObjC option first as
MacPorts GCCs do not support it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (xsystem): expand environment variable in all macros not
expanded with RbConfig. [Bug #8702]
* test/mkmf/test_framework.rb (create_framework): replace all $@ not
only once.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/mkmf/base.rb, test/mkmf/test_config.rb: needs to set $extmk
since worker processes in parallel test mode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/test/unit/assertions.rb (Test::Unit::Assertions#message):
convert msg by call if it is a proc, as well as assert.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (MakeMakefile#merge_libs): insert following reversal
ordered elements just after the duplicated element, not overwriting
successive elements. [ruby-core:50314] [Bug #7467]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e