diff options
author | Richard Jones <rich@koneko.home.annexia.org> | 2010-03-22 10:30:25 +0000 |
---|---|---|
committer | Richard Jones <rich@koneko.home.annexia.org> | 2010-03-22 10:41:46 +0000 |
commit | cef4ba0b8fec2b95153a07ac9537306e50ba167f (patch) | |
tree | cacaff477cc4954879cc64fe79bc68672e27b34b /ruby | |
parent | e5fa90a795ab632918081195c356aa4c02ab61cd (diff) | |
download | libguestfs-cef4ba0b8fec2b95153a07ac9537306e50ba167f.tar.gz libguestfs-cef4ba0b8fec2b95153a07ac9537306e50ba167f.tar.xz libguestfs-cef4ba0b8fec2b95153a07ac9537306e50ba167f.zip |
Mac OS X: Fix configure-time tests for Ruby.
For ARCHFLAGS change, see:
http://www.ruby-forum.com/topic/129717#579065
We also add a test for the <guestfs.h> header and include
that header when testing the library.
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/Rakefile.in | 2 | ||||
-rw-r--r-- | ruby/ext/guestfs/extconf.rb | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/ruby/Rakefile.in b/ruby/Rakefile.in index a0002553..e77b0ebd 100644 --- a/ruby/Rakefile.in +++ b/ruby/Rakefile.in @@ -38,7 +38,7 @@ CLOBBER.include [ "@builddir@/config.save", "@builddir@/ext/**/mkmf.log", # Build locally file MAKEFILE => EXT_CONF do |t| - unless sh "top_srcdir=$(pwd)/@top_srcdir@; top_builddir=$(pwd)/@top_builddir@; cd #{File::dirname(EXT_CONF)}; ruby #{File::basename(EXT_CONF)} --with-_guestfs-include=$top_srcdir/src --with-_guestfs-lib=$top_builddir/src/.libs" + unless sh "top_srcdir=$(pwd)/@top_srcdir@; top_builddir=$(pwd)/@top_builddir@; export ARCHFLAGS=\"-arch $(uname -m)\"; cd #{File::dirname(EXT_CONF)}; ruby #{File::basename(EXT_CONF)} --with-_guestfs-include=$top_srcdir/src --with-_guestfs-lib=$top_builddir/src/.libs" $stderr.puts "Failed to run extconf" break end diff --git a/ruby/ext/guestfs/extconf.rb b/ruby/ext/guestfs/extconf.rb index 67389fd5..3413e040 100644 --- a/ruby/ext/guestfs/extconf.rb +++ b/ruby/ext/guestfs/extconf.rb @@ -22,7 +22,10 @@ extension_name = '_guestfs' dir_config(extension_name) -unless have_library("guestfs", "guestfs_create") +unless have_header ("guestfs.h") + raise "<guestfs.h> not found" +end +unless have_library("guestfs", "guestfs_create", "guestfs.h") raise "libguestfs not found" end |