public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix build when objdir != srcdir (v2)
@ 2009-04-30 15:06 Anthony Liguori
  2009-04-30 15:24 ` Avi Kivity
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2009-04-30 15:06 UTC (permalink / raw)
  To: kvm; +Cc: Anthony Liguori, Avi Kivity

This requires adding the necessary bits to configure to create the directories
and symlinks for libkvm.  It also requires sticking KVM_CFLAGS in
config-host.mak to ensure that it gets the right set of includes for the
kernel headers.

v1 => v2
  Fix build when objdir == srcdir

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 configure           |   10 ++++++++--
 kvm/libkvm/Makefile |    4 +++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index fc0fb9b..c41e269 100755
--- a/configure
+++ b/configure
@@ -518,7 +518,7 @@ if test "$werror" = "yes" ; then
 CFLAGS="$CFLAGS -Werror"
 fi
 
-CFLAGS="$CFLAGS -I$(readlink -f "kvm/libkvm")"
+CFLAGS="$CFLAGS -I$(readlink -f "$source_path/kvm/libkvm")"
 
 if test "$solaris" = "no" ; then
     if ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
@@ -1785,6 +1785,11 @@ bsd)
 ;;
 esac
 
+# this is a temp hack needed for libkvm
+if test "$kvm" = "yes" ; then
+    echo "KVM_CFLAGS=$kvm_cflags" >> $config_mak
+fi
+
 tools=
 if test `expr "$target_list" : ".*softmmu.*"` != 0 ; then
   tools="qemu-img\$(EXESUF) $tools"
@@ -2162,10 +2167,11 @@ done # for target in $targets
 
 # build tree in object directory if source path is different from current one
 if test "$source_path_used" = "yes" ; then
-    DIRS="tests tests/cris slirp audio"
+    DIRS="tests tests/cris slirp audio kvm/libkvm"
     FILES="Makefile tests/Makefile"
     FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
     FILES="$FILES tests/test-mmap.c"
+    FILES="$FILES kvm/libkvm/Makefile"
     for dir in $DIRS ; do
             mkdir -p $dir
     done
diff --git a/kvm/libkvm/Makefile b/kvm/libkvm/Makefile
index 727ce48..2f2cfa2 100644
--- a/kvm/libkvm/Makefile
+++ b/kvm/libkvm/Makefile
@@ -1,5 +1,5 @@
 include ../../config-host.mak
-include config-$(ARCH).mak
+include $(VPATH)/kvm/libkvm/config-$(ARCH).mak
 
 # libkvm is not -Wredundant-decls friendly yet
 CFLAGS += -Wno-redundant-decls
@@ -18,6 +18,8 @@ LDFLAGS += $(CFLAGS)
 
 CXXFLAGS = $(autodepend-flags)
 
+VPATH:=$(VPATH)/kvm/libkvm
+
 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
 
 
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix build when objdir != srcdir (v2)
  2009-04-30 15:06 [PATCH] Fix build when objdir != srcdir (v2) Anthony Liguori
@ 2009-04-30 15:24 ` Avi Kivity
  2009-04-30 15:47   ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: Avi Kivity @ 2009-04-30 15:24 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: kvm

Anthony Liguori wrote:
> This requires adding the necessary bits to configure to create the directories
> and symlinks for libkvm.  It also requires sticking KVM_CFLAGS in
> config-host.mak to ensure that it gets the right set of includes for the
> kernel headers.
>
> v1 => v2
>   Fix build when objdir == srcdir
>
>   

Is this the new patch?  I still get

[avi@cleopatra qemu-kvm (master)]$ make
make[1]: Entering directory `/home/avi/qemu-kvm/x86_64-softmmu'
make -C ../kvm/libkvm 
KVM_CFLAGS="-I/home/avi/qemu-kvm/kvm/kernel/include 
-I/home/avi/qemu-kvm/kvm/kernel/arch/x86/include"
make[2]: Entering directory `/home/avi/qemu-kvm/kvm/libkvm'
Makefile:2: /kvm/libkvm/config-x86_64.mak: No such file or directory
make[2]: *** No rule to make target `/kvm/libkvm/config-x86_64.mak'.  Stop.
make[2]: Leaving directory `/home/avi/qemu-kvm/kvm/libkvm'
make[1]: *** [libkvm.a] Error 2
make[1]: Leaving directory `/home/avi/qemu-kvm/x86_64-softmmu'
make: *** [subdir-x86_64-softmmu] Error 2



-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix build when objdir != srcdir (v2)
  2009-04-30 15:24 ` Avi Kivity
@ 2009-04-30 15:47   ` Anthony Liguori
  0 siblings, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2009-04-30 15:47 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm

Avi Kivity wrote:
> Anthony Liguori wrote:
>> This requires adding the necessary bits to configure to create the 
>> directories
>> and symlinks for libkvm.  It also requires sticking KVM_CFLAGS in
>> config-host.mak to ensure that it gets the right set of includes for the
>> kernel headers.
>>
>> v1 => v2
>>   Fix build when objdir == srcdir
>>
>>   
>
> Is this the new patch?  I still get

Sorry, still getting used to git vs. guilt.  Didn't git add before git 
commit --amend.

-- 
Regards,

Anthony Liguori


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-30 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-30 15:06 [PATCH] Fix build when objdir != srcdir (v2) Anthony Liguori
2009-04-30 15:24 ` Avi Kivity
2009-04-30 15:47   ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox