Working on getting Ruby 1.8.7, using branch ruby_1_8_7 at revision 28669 is not possible to cross-compile it.
Configure process completes perfectly, but compilation fails:
$ make
rbconfig.rb updated
i686-w64-mingw32-windres --include-dir . --include-dir . --include-dir ../win32 msvcrt-ruby18.rc msvcrt-ruby18.res.o
i686-w64-mingw32-gcc -g -O2 -DRUBY_EXPORT -I. -I.. -c ../array.c
In file included from ../defines.h:186:0,
from ../ruby.h:37,
from ../array.c:15:
../win32/win32.h:154:8: error: redefinition of ‘struct timezone’
/home/luis/mingw/w32/bin/../lib/gcc/i686-w64-mingw32/4.5.2/../../../../i686-w64-mingw32/include/time.h:260:8: note: originally defined here
make: *** [array.o] Error 1
=begin
Hello Mr. Urabe, any progress on this backport?
I'm working now in updating all cross compilation options for rake-compiler, and 1.8.7 remains the red indicator so far:
[ruby-1.8.7-p302] luis@seyori:~/projects/oss/ruby/xbuild187$ makei686-w64-mingw32-gcc -g -O2 -DRUBY_EXPORT -I. -I.. -c ../array.c
In file included from ../defines.h:186:0,
from ../ruby.h:37,
from ../array.c:15:
../win32/win32.h:154:8: error: redefinition of ‘struct timezone’
/Users/luis/mingw/w32/bin/../lib/gcc/i686-w64-mingw32/4.6.0/../../../../i686-w64-mingw32/include/time.h:260:8: note: originally defined here
make: *** [array.o] Error 1
Don't confuse 'w64' with 64bits. GNU triplets are architecture-vendor-os where i686 (x86) is the architecture that represents w64 (mingw-w64) project.
i386-mingw32 and i586-pc-mingw32 are the identificators of mingw32 packages for OSX and Debian respectively.
i686-w64-mingw32 identifies mingw-w64 platform and packages for 32bits while x86_64-w64-mingw32 identifies 64bits compiler target.
Also, the patch is about an already defined structure, which was never backported to 1.8 branches and is blocking Ruby 1.8 to be cross compiled for 32bits.
mingw-w64, a fork/variation of original mingw project provides toolchains that target both 32 and 64bits.
i686-w64-mingw32 is the platform identifier for 32bits GCC of mingw-w64 project.
The patch supplied here is required since mingw-w64 headers are more accurate/up-to-date than mingw ones.
This was fixed in trunk and ruby_1_9_2 branch but never reached any of ruby_1_8_x branches.
I'm switching rake-compiler cross-compilation process to prioritize this compiler instead of GCC 3.4.5 to be in sync with native builds of RubyInstaller (GCC 4.5.0 based).
Hope this clarifies a little bit the purpose and the platform. Again, w64 is not 64bits but is the vendor identifier of mingw-w64 project in the GNU platform triplet.
Can you check the patch contents and see if they could be applied. Again, this is not a 64bits patch, is just an update definition of MinGW headers manually backported from r26311
After reading that post, it is clear something has not been correctly communicated to the developers:
Ruby 1.9.2-p0 has been compiled with GCC 4.5.0 and needs GCC 4.5.0, from their instructions it is clear they are using the old DevKit (this affects ruby.h, rbconfig.rb and win32.h listed as patches
It is clear the dependency on MSVC tools (lib.exe) by extconf even when lib is not available by GCC.
I believe a better patch needs to be provided to these developers that solves their specific build problems.
=end