Hi
On Aug 14, 2010, at 4:54 AM, Jon wrote:
This is a Windows 7 machine. I’ve gotten the library to compile, but it doesn’t want to compile the extensions - undefined references.
Unfortunately I couldn’t get it compile on my Win7 Ultimate 32-bit machine. The attached patch allows me to build and part of the problem was the build.xml patch I sent you caused the new make.bat to fail because it didn’t handle “make CC=gcc” correctly. I’m not sure all the mods I made to Makefile are needed, but we can tune later. Does this patch work for you when running “ant clean cext”?
I don’t use the “ant cext” target because I couldn’t get both javac and
devkit to run in the same shell on windows, so I’m doing ant jar in one
shell and a direct make in the cext/src in another.
I tried it with deactivating the dependency of cext on the jar, and that
built the cext code fine, so yes, it kinda works.
Even with all of the above, I’m still not able to install the native rdiscount gem and it looks like there’s some mkmf.rb work still left to do. The good news is that the gem pre_install hook seems to be working fine on JRuby like we’ve seen on other impl’s…making progress
The generated Makefile is not really different from the one MRI
generates, save for the include paths, and the same as on unix.
I checked the include flags, they look fine, for some reason the
dependency on ruby.h and defines.h is not checked against those paths on
windows. Ah well, I removed the dependencies, we don’t really need them,
anyway, I just wanted to keep the diff against MRI’s mkmf small.
C:\Users\Jon\Documents\CDev\rdiscount>jruby -S gem install rdiscount-1.6.5.jm1.gem
Doing a “jruby -S gem install rdiscount” now gives me the same linker
error as the capi specs.
C:\Users\tim.felgentreff\Desktop\devkit\jruby\cext\src>jruby -S gem
install rdiscount
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
Temporarily enhancing PATH to include DevKit…
Building native extensions. This could take a while…
ERROR: Error installing rdiscount:
ERROR: Failed to build gem native extension.
C:/Users/tim.felgentreff/Desktop/devkit/jruby/bin/jruby.exe extconf.rb
WARNING: JRuby does not support native extensions or the mkmf' library very well. Check http://kenai.com/projects/jruby/pages/Home for alternatives. C:/Users/tim.felgentreff/Desktop/devkit/jruby/lib/ruby/1.8/mkmf.rb:31 warning: already initialized constant RUBY_PLATFORM checking for random()... no checking for srandom()... no checking for rand()... make cc -I. -I. -IC:/Users/tim.felgentreff/Desktop/devkit/jruby/lib/native/include/ruby -I. -DHAVE_RAND -DHAVE_SRAND -fno-omit-frame-pointer -fno-strict-aliasing -fexceptions -m32 -c basename.c cc -I. -I. -IC:/Users/tim.felgentreff/Desktop/devkit/jruby/lib/native/include/ruby -I. -DHAVE_RAND -DHAVE_SRAND -fno-omit-frame-pointer -fno-strict-aliasing -fexceptions -m32 -c Csio.c ..... more compilation cc -shared -o rdiscount.dll basename.o Csio.o css.o docheader.o dumptree.o emmatch.o generate.o html5.o markdown.o mkdio.o rdiscount.o resource.o tags.o toc.o xml.o -L"." -L"/Users/tim.felgentreff/Desktop/devkit/jruby/lib" -m32 rdiscount.o:rdiscount.c:(.text+0x28): undefined reference to
rb_intern2’
rdiscount.o:rdiscount.c:(.text+0x49): undefined reference to
rb_funcall' rdiscount.o:rdiscount.c:(.text+0x58): undefined reference to
rb_str_buf_new’
… more undefined references
So the question is, what do I need to tell mingw’s gcc to link those
undefined references dynamically?
-Tim
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email