Project

General

Profile

Actions

Feature #19695

closed

mkmf: Adding the extra option --with-verbose to enable verbose mode.

Added by jaruga (Jun Aruga) 10 months ago. Updated 10 months ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:113662]

Description

I want the new feature to enable the verbose mode by setting the V = 1 in the generated Makefile at runtime when building native extensions. Because the V = 1 prints the compiler command lines. And it's useful to confirm and update the compiler flags. It can be used like the command below.

$ ruby /path/to/extconf.rb -- --with-verbose

$ grep '^V =' Makefile 
V = 1

Or it can be used with rake-compiler gem.

$ rake compile -- --with-verbose

The pull-request is https://github.com/ruby/ruby/pull/7863.

Actions #1

Updated by jaruga (Jun Aruga) 10 months ago

  • Description updated (diff)
Actions #2

Updated by jaruga (Jun Aruga) 10 months ago

  • Description updated (diff)
Actions #3

Updated by jaruga (Jun Aruga) 10 months ago

  • Description updated (diff)
Actions #5

Updated by Anonymous 10 months ago

  • Status changed from Open to Closed

Applied in changeset git|57459b83a9a52ab921094a1562fe3056df9a437a.


mkmf: Add the extra option --with-verbose to enable verbose mode. (#7863)

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

Actions #6

Updated by jaruga (Jun Aruga) 10 months ago

  • Description updated (diff)

Updated by jaruga (Jun Aruga) 10 months ago

$ rake compiler -- --with-verbose

Sorry for my typo in the commit message. It's not "rake compiler" but "rake compile".

$ rake compile -- --with-verbose
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0