From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: [PATCH 14/17] Fix build when objdir != srcdir Date: Sun, 17 May 2009 10:43:16 -0500 Message-ID: <1242574999-20887-16-git-send-email-aliguori@us.ibm.com> References: <1242574999-20887-1-git-send-email-aliguori@us.ibm.com> Cc: Glauber Costa , Anthony Liguori , Avi Kivity To: kvm@vger.kernel.org Return-path: Received: from e2.ny.us.ibm.com ([32.97.182.142]:54907 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754730AbZEQPnn (ORCPT ); Sun, 17 May 2009 11:43:43 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e2.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4HFdhct018965 for ; Sun, 17 May 2009 11:39:43 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4HFhhKF257832 for ; Sun, 17 May 2009 11:43:43 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n4HFfhub030615 for ; Sun, 17 May 2009 11:41:43 -0400 In-Reply-To: <1242574999-20887-1-git-send-email-aliguori@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. Signed-off-by: Anthony Liguori Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori diff --git a/configure b/configure index 04e072b..23ac0ef 100755 --- a/configure +++ b/configure @@ -499,7 +499,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 @@ -1580,6 +1580,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" @@ -1945,10 +1950,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..8de7eaf 100644 --- a/kvm/libkvm/Makefile +++ b/kvm/libkvm/Makefile @@ -1,5 +1,12 @@ include ../../config-host.mak -include config-$(ARCH).mak +ifneq ($(VPATH),) +srcdir=$(VPATH)/kvm/libkvm +else +srcdir=. +endif + +include $(srcdir)/config-$(ARCH).mak + # libkvm is not -Wredundant-decls friendly yet CFLAGS += -Wno-redundant-decls @@ -18,6 +25,8 @@ LDFLAGS += $(CFLAGS) CXXFLAGS = $(autodepend-flags) +VPATH:=$(VPATH)/kvm/libkvm + autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -- 1.6.0.6