[rjb-users] doesn't compile in mingw

Roger Pack rogerdpack2 at gmail.com
Sat Oct 3 09:31:22 EDT 2009


> Now github repositry http://github.com/arton/rjb is complete.
> The revesion 1.1.12 what I'd cited at last mail is my misconception,
> 1.1.9 is the newest.

Nice.

Here's a patch for building in mingw

diff --git a/ext/extconf.rb b/ext/extconf.rb
index 1342e9d..974c868 100644
--- a/ext/extconf.rb
+++ b/ext/extconf.rb
@@ -17,8 +17,10 @@ class Path

   def include(parent, child)
     inc = joint(parent, child)
-    $INCFLAGS += " -I#{inc}"
-    $CFLAGS += " -I#{inc}"
+    inc2 = inc
+    inc2 = '"' + inc + '"' if RUBY_PLATFORM =~ /mingw/
+    $INCFLAGS += " -I#{inc2}"
+    $CFLAGS += " -I#{inc2}"
     inc
   end

diff --git a/rjb.rake b/rjb.rake
index 79ae842..cb7ed8d 100644
--- a/rjb.rake
+++ b/rjb.rake
@@ -35,10 +35,10 @@ spec = Gem::Specification.new do |s|
   files = FileList['ext/*.java', 'ext/*.c', 'ext/*.h', 'ext/depend',
                    'data/rjb/**/*.class', 'lib/*.rb', 'samples/**/*.rb',
                    'test/*.rb', 'test/**/*.class', 'COPYING',
'ChangeLog', 'readme.*']
-  if /mswin32/ =~ RUBY_PLATFORM
+  if /mswin32|mingw/ =~ RUBY_PLATFORM
     FileUtils.cp 'ext/rjbcore.so', 'lib/rjbcore.so'
     files << "lib/rjbcore.so"
-    s.requirements << ' VC6 version of Ruby'
+    s.requirements << ' VC6 version of Ruby' if RUBY_PLATFORM =~ /mswin/
   end
   s.files = files
   s.test_file = 'test/test.rb'


This works for 1.8 + mingw.

Unfortunately in 1.9 I'm faced with the following oddity--
>> require './rjbcore.so'
LoadError: 127: The specified procedure could not be found.   - Init_rjbcore
C:/dev/ruby/downloads/rjb/ext/rjbcore.so
        from (irb):2:in `require'
        from (irb):2
        from C:/ruby/bin/irb:12:in `<main>'

So it may be necessary to still distribute "fat binaries" (pre
compiled using the rake compiler) if we want a working version for 1.9
mingw, as apparently the windows compiler is broke (?)
Thanks!
-r


More information about the rjb-users mailing list