[ruby-trunk - Bug #7864][Open] lib/mkmf.rb: $(topdir) included in VPATH cause build error

Issue #7864 has been reported by taca (Takahiro K.).


Bug #7864: lib/mkmf.rb: $(topdir) included in VPATH cause build error

Author: taca (Takahiro K.)
Status: Open
Priority: High
Assignee:
Category: build
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-16) [x86_64-netbsd6.0.]

[ruby-dev:46849]での問題は、Ruby 2.0.0-rc2やtrunkでも再現しました。

% sh configure --enable-shared
% make

compiling complex.c
linking shared-object mathn/complex.so
gcc: complex.o: No such file or directory
*** Error code 1

環境は以下のようになります。(GNU makeではありません。)

% uname -rsmp
NetBSD 6.0_STABLE amd64 x86_64

原因は、ext/mathn/complexに生成されたMakefileのVPATHに、

VPATH = $(srcdir):$(topdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby

と、$(topdir)が含まれている関係か、ここで実行したMakefileは、

  1. トップディレクトリにcomplex.oを作成(既にあるcomplex.oを上書き)
  2. complex.soのリンク時はext/mathn/complex/complex.oがなくて失敗

となっています。

VPATHに$(topdir)は、r37933による修正で含められるようになっています。

mkmf.rb: each_compile_rules

  • lib/mkmf.rb (MakeMakefile#each_compile_rules): splat $(VPATH) for
    each VPATH elements.

このログの説明で、何故$(topdir)を含めるようになったかは理解できません。
添付のパッチでr37933の一部を戻すとbuild可能となります。

この修正は Ruby 2.0.0 に反映していただきたいと思います。

Issue #7864 has been updated by mame (Yusuke E.).

Status changed from Open to Assigned
Assignee set to nobu (Nobuyoshi N.)

なかださん、どうでしょうか。


Yusuke E. [email protected]

Bug #7864: lib/mkmf.rb: $(topdir) included in VPATH cause build error

Author: taca (Takahiro K.)
Status: Assigned
Priority: High
Assignee: nobu (Nobuyoshi N.)
Category: build
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2013-02-16) [x86_64-netbsd6.0.]

[ruby-dev:46849]での問題は、Ruby 2.0.0-rc2やtrunkでも再現しました。

% sh configure --enable-shared
% make

compiling complex.c
linking shared-object mathn/complex.so
gcc: complex.o: No such file or directory
*** Error code 1

環境は以下のようになります。(GNU makeではありません。)

% uname -rsmp
NetBSD 6.0_STABLE amd64 x86_64

原因は、ext/mathn/complexに生成されたMakefileのVPATHに、

VPATH = $(srcdir):$(topdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby

と、$(topdir)が含まれている関係か、ここで実行したMakefileは、

  1. トップディレクトリにcomplex.oを作成(既にあるcomplex.oを上書き)
  2. complex.soのリンク時はext/mathn/complex/complex.oがなくて失敗

となっています。

VPATHに$(topdir)は、r37933による修正で含められるようになっています。

mkmf.rb: each_compile_rules

  • lib/mkmf.rb (MakeMakefile#each_compile_rules): splat $(VPATH) for
    each VPATH elements.

このログの説明で、何故$(topdir)を含めるようになったかは理解できません。
添付のパッチでr37933の一部を戻すとbuild可能となります。

この修正は Ruby 2.0.0 に反映していただきたいと思います。