The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Building openssl for Ruby with Visual Studio

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Daniel Berger

Posts: 1383
Nickname: djberg96
Registered: Sep, 2004

Daniel Berger is a Ruby Programmer who also dabbles in C and Perl
Building openssl for Ruby with Visual Studio Posted: May 11, 2014 8:51 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Daniel Berger.
Original Post: Building openssl for Ruby with Visual Studio
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Daniel Berger
Latest Posts From Testing 1,2,3...

Advertisement
Yet another "how to build" post mostly for my own reference, but you may find it useful.

Building the openssl lib for Ruby with Visual Studio is a bit of a pain. First, you'll need to install openssl itself (which you can build from source if you have Perl installed) or use their precompiled stuff. To build openssl itself from source, do this:

  perl Configure VC-WIN32 --prefix=C:\usr\local
  ms\do_ms
  nmake -f ms\nt.mak 
  nmake -f ms\nt.mak install


This assumes a 32-bit build, but you get the idea. Once that's done, you'll need to cd to the ext/openssl directory of wherever your Ruby source code is. Before you begin you will need to hand edit the extconf.rb file and change line 40 from "if $mingw" to "if File::ALT_SEPARATOR". This ensures that the gdi and wsock32 libs are linked properly.

This was reported at https://bugs.ruby-lang.org/issues/9817

With that done, run "ruby extconf.rb --with-openssl-dir=c:/usr/local", or wherever you installed openssl. Once that's complete you have to pause again and hand edit the generated Makefile because it's missing a declaration for $(top_srcdir). Look near the bottom and you'll see this line:

  ossl.o: $(top_srcdir)/thread_native.h $(top_srcdir)/thread_$(THREAD_MODEL).h


Change that line to this:

  ossl.o: ../../thread_native.h ../../thread_$(THREAD_MODEL).h


This was reported and inexplicably rejected at https://bugs.ruby-lang.org/issues/9824

Then run "nmake" followed by "nmake install". Once that's done you can test it out by firing up irb and typing 'require "openssl"' to ensure you don't get an error.

That's it!

Read: Building openssl for Ruby with Visual Studio

Topic: Software Apprenticeship Podcast Episode 3 is Out Previous Topic   Next Topic Topic: Announcing the Software Apprenticeship Podcast

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use