>From fd249d0c0caf6ef5f2671df2226e2feaf726ecb5 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 22 Mar 2010 10:30:25 +0000 Subject: [PATCH 3/3] 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 header and include that header when testing the library. --- .gitignore | 1 + ruby/Rakefile.in | 2 +- ruby/ext/guestfs/extconf.rb | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2d7f383..5914499 100644 --- a/.gitignore +++ b/.gitignore @@ -202,6 +202,7 @@ regressions/test.err regressions/test.out ruby/bindtests.rb ruby/ext/guestfs/extconf.h +ruby/ext/guestfs/_guestfs.bundle ruby/ext/guestfs/_guestfs.c ruby/ext/guestfs/_guestfs.so ruby/ext/guestfs/mkmf.log diff --git a/ruby/Rakefile.in b/ruby/Rakefile.in index a000255..e77b0eb 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 67389fd..3413e04 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 " not found" +end +unless have_library("guestfs", "guestfs_create", "guestfs.h") raise "libguestfs not found" end -- 1.6.4.1