From patchwork Wed Apr 29 20:47:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 20808 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n3TKmtHh006880 for ; Wed, 29 Apr 2009 20:48:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760976AbZD2Ur4 (ORCPT ); Wed, 29 Apr 2009 16:47:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759369AbZD2Urz (ORCPT ); Wed, 29 Apr 2009 16:47:55 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:57744 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760851AbZD2Ury (ORCPT ); Wed, 29 Apr 2009 16:47:54 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e8.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n3TKcVDk000333 for ; Wed, 29 Apr 2009 16:38:31 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n3TKlsI3152022 for ; Wed, 29 Apr 2009 16:47:54 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n3TKlrAX006752 for ; Wed, 29 Apr 2009 16:47:54 -0400 Received: from localhost.localdomain (sig-9-65-58-151.mts.ibm.com [9.65.58.151]) by d01av04.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n3TKlqlu006662; Wed, 29 Apr 2009 16:47:53 -0400 From: Anthony Liguori To: kvm@vger.kernel.org Cc: Anthony Liguori , Avi Kivity Subject: [PATCH] Fix build when objdir != srcdir Date: Wed, 29 Apr 2009 15:47:52 -0500 Message-Id: <1241038072-7200-1-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.6.0.6 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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 --- 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