From: Luis Lavena Date: 2010-11-29T22:35:36+09:00 Subject: [ruby-core:33466] Re: Planning to release 1.8.7 fixes on 12/25 (Japanese timezone) On Sun, Nov 28, 2010 at 10:56 PM, Urabe Shyouhei wrote: > (2010/11/29 9:53), Luis Lavena wrote: >> � � � � � Config::MAKEFILE_CONFIG["top_srcdir"] = $top_srcdir = >> "../ruby" unless e; \ > > Curious. �You get the exact same error message as you pasted in #4094 ? > It seems your source directory is ../ruby so ../ruby/ruby.h should exist and > the error will not raise. On the original report (#2531), I was getting a reference to the base ruby used to cross-compile: Generating callback.func mkmf.rb can't find header files for ruby at /home/luis/.rvm/ruby-1.8.7-p248/lib/ruby/ruby.h While on #4094 Generating callback.func mkmf.rb can't find header files for ruby at ../ruby/ruby.h On that report, I've tried to cross-compile "inside" ruby checkout (mkdir build; cd build; sh ../configure) I've tried that: Generating callback.func mkmf.rb can't find header files for ruby at ../ruby.h And also outside ruby dir (cd ..; mkdir build-ruby; cd build-ruby; sh ../ruby/configure) Generating callback.func mkmf.rb can't find header files for ruby at ../ruby/ruby.h === But, noticed the following on master, that top_srcdir is build relative to the build dir, so this patch: diff --git a/Makefile.in b/Makefile.in index 4faabc3..3135f08 100644 --- a/Makefile.in +++ b/Makefile.in @@ -138,7 +138,8 @@ fake.rb: Makefile end; \ end; \ prehook = proc do |e|; \ - Config::MAKEFILE_CONFIG["top_srcdir"] = $$top_srcdir = "@top_srcdir@" unless e; \ + builddir = File.expand_path(File.dirname(__FILE__)); \ + Config::MAKEFILE_CONFIG["top_srcdir"] = $$top_srcdir = File.expand_path("@top_srcdir@", builddir) unle untrace_var(:$$extmk, prehook); \ end; \ trace_var(:$$extmk, prehook); \ === Seems to correct the issue: https://gist.github.com/719946 I'm still unsure why this works on ruby_1_8 but not on ruby_1_8_7 (and why don't see similar code there related to fake.rb) but setting the top_srcdir relative to the build directory, works. Thank you for your time, adding the patch to the ticket. -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup�ry