diff options
author | Matthew Booth <mbooth@redhat.com> | 2009-07-03 11:52:50 +0100 |
---|---|---|
committer | Matthew Booth <mbooth@redhat.com> | 2009-07-03 16:16:51 +0100 |
commit | 349814e9d912c4f372b8fbdfb10b03749911021f (patch) | |
tree | 7168b6ee4dadd363a28a73e2a5ff26799395d75c /ruby/Rakefile.in | |
parent | 5f9cb51f11879ece8b921d833850505d7e57d339 (diff) | |
download | libguestfs-349814e9d912c4f372b8fbdfb10b03749911021f.tar.gz libguestfs-349814e9d912c4f372b8fbdfb10b03749911021f.tar.xz libguestfs-349814e9d912c4f372b8fbdfb10b03749911021f.zip |
Make it possible to build in a separate directory
This patch allows you to do:
mkdir build
cd build
../configure ...
make
This will output all generated files to the build directory. Given that
autogen automatically runs configure, you can also do:
BUILDDIR=./build ./autogen.sh
which will do the right thing.
Also:
* Fix a dependency bug which means that guestfs_protocol.h
isn't automatically rebuilt.
* Re-running autogen.sh with no arguments won't blow away your previous
configure arguments.
Diffstat (limited to 'ruby/Rakefile.in')
-rw-r--r-- | ruby/Rakefile.in | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/ruby/Rakefile.in b/ruby/Rakefile.in index 67f6b178..076efd81 100644 --- a/ruby/Rakefile.in +++ b/ruby/Rakefile.in @@ -24,26 +24,24 @@ require 'rake/gempackagetask' PKG_NAME='@PACKAGE_NAME@' PKG_VERSION='@PACKAGE_VERSION@' -EXT_CONF='ext/guestfs/extconf.rb' -MAKEFILE='ext/guestfs/Makefile' -GUESTFS_MODULE='ext/guestfs/_guestfs.so' -GUESTFS_SRC='ext/guestfs/_guestfs.c' +EXT_CONF='@srcdir@/ext/guestfs/extconf.rb' +MAKEFILE='@builddir@/ext/guestfs/Makefile' +GUESTFS_MODULE='@builddir@/ext/guestfs/_guestfs.so' +GUESTFS_SRC='@builddir@/ext/guestfs/_guestfs.c' -CLEAN.include [ "ext/**/*.o", GUESTFS_MODULE, - "ext/**/depend" ] +CLEAN.include [ "@builddir@/ext/**/*.o", GUESTFS_MODULE, + "@builddir@/ext/**/depend" ] -CLOBBER.include [ "config.save", "ext/**/mkmf.log", +CLOBBER.include [ "@builddir@/config.save", "@builddir@/ext/**/mkmf.log", MAKEFILE ] # Build locally file MAKEFILE => EXT_CONF do |t| - Dir::chdir(File::dirname(EXT_CONF)) do - unless sh "ruby #{File::basename(EXT_CONF)} --with-_guestfs-include=../../../src --with-_guestfs-lib=../../../src/.libs" - $stderr.puts "Failed to run extconf" - break - end - end + 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 --with-_guestfs-lib=$top_builddir/src/.libs" + $stderr.puts "Failed to run extconf" + break + end end file GUESTFS_MODULE => [ MAKEFILE, GUESTFS_SRC ] do |t| Dir::chdir(File::dirname(EXT_CONF)) do |