Hi, I’ve made a commit in Gem em-udns to allow compiling udns C
library under MacOSX 32 and 64 bits, but I need testing as I’m not a
Mac user.
Could somebody with Mac 32/64 bits install the Ruby Gem em-udns (last
version is 0.2.5) and tell me the success of the installation?
Thanks a lot.
https://github.com/ibc/em-udns/
opened 08:06PM - 13 Feb 11 UTC
closed 07:37PM - 19 Aug 11 UTC
C udns
Gem
For now em-udns relies on [udns](http://www.corpit.ru/mjt/udns.html) C library i… nstalled in the system (see `have_library("udns")` in ext/extconf.rb and `#include <udns.h>` in ext/em-udns.c).
However udns is not mantained in Linux distributions. Last version in Debian/Ubuntu is 0.0.9 while current udns version is 0.1.0 (fixing some bugs).
Also, udns tarball doesn't include "make install", but just "make", and it generates a static linudns.a and not a dynamic libdudsn.so.
The author of udns said me this in udns maillist:
> You can try running `make sharedlib' in the udns source directory --this will produce a series of .lo files, just like it produces a bunch of .o files for static library. You grab these .lo files and produce a static library from them -- libudns.a, like this:<pre>
> rm -f libudns.a
> ar r libudns.a *.lo
> </pre>
> This is not perfect, but will work for your case. Regular static library will not - because you're producing shared object from it, and regular static library is meant to be used to produce a simple executable.
> Another alternative is to re-implement the makefile using the same build system as uses - this is trivial, you just need to take a list of files from udns Makefile.
So we need udns sources to be included within the em-udns gem, so `gem install em-udns` would compile udns, and em-udns would compiled against it. The first solution given above (using `make sharedlib` and `ar r libudns.a *.lo`) does work, but I don't know how to integrate it within a gem. Or maybe it's better just to modify the Makefile of udns and integrate it in some way.
committed 06:08PM - 19 Aug 11 UTC
On Aug 19, 2011, at 11:58 AM, Iaki Baz C. wrote:
Hi, I’ve made a commit in Gem em-udns to allow compiling udns C
library under MacOSX 32 and 64 bits, but I need testing as I’m not a
Mac user.
Could somebody with Mac 32/64 bits install the Ruby Gem em-udns (last
version is 0.2.5) and tell me the success of the installation?
SOLAR:ruby-1.9.2-p290 chriswhite$ gem install em-udns
Building native extensions. This could take a while…
Building native extensions. This could take a while…
Successfully installed eventmachine-0.12.10
Successfully installed em-udns-0.2.5
2 gems installed
Installing ri documentation for eventmachine-0.12.10…
Installing ri documentation for em-udns-0.2.5…
Installing RDoc documentation for eventmachine-0.12.10…
Installing RDoc documentation for em-udns-0.2.5…
Build looks okay. This is on 64 bit snow leopard. Sample from github
works too:
SOLAR:RandomRubyCode chriswhite$ ruby em-udns-test.rb
result => [“74.125.224.84”, “74.125.224.81”, “74.125.224.82”,
“74.125.224.80”, “74.125.224.83”]
Best Regards,
Chris W.
2011/8/19 Chris W. [email protected] :
Build looks okay. This is on 64 bit snow leopard. Sample from github works too:
SOLAR:RandomRubyCode chriswhite$ ruby em-udns-test.rb
result => [“74.125.224.84”, “74.125.224.81”, “74.125.224.82”, “74.125.224.80”,
“74.125.224.83”]
Great
Thanks a lot.