From patchwork Tue Apr 27 15:07:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 51084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 70B4CB7D7F for ; Wed, 28 Apr 2010 01:10:29 +1000 (EST) Received: from localhost ([127.0.0.1]:59172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6mPa-0005rK-4R for incoming@patchwork.ozlabs.org; Tue, 27 Apr 2010 11:09:22 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6mNi-0005ME-Az for qemu-devel@nongnu.org; Tue, 27 Apr 2010 11:07:26 -0400 Received: from [140.186.70.92] (port=54523 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6mNg-0005K8-Uw for qemu-devel@nongnu.org; Tue, 27 Apr 2010 11:07:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6mNf-0006Jg-8u for qemu-devel@nongnu.org; Tue, 27 Apr 2010 11:07:24 -0400 Received: from mx20.gnu.org ([199.232.41.8]:20524) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6mNf-0006Jb-5w for qemu-devel@nongnu.org; Tue, 27 Apr 2010 11:07:23 -0400 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1O6mNe-0002ez-EH for qemu-devel@nongnu.org; Tue, 27 Apr 2010 11:07:22 -0400 Received: (qmail 23442 invoked from network); 27 Apr 2010 15:07:20 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 Apr 2010 15:07:20 -0000 From: Nathan Froyd To: qemu-devel@nongnu.org Date: Tue, 27 Apr 2010 08:07:20 -0700 Message-Id: <1272380840-1132-1-git-send-email-froydnj@codesourcery.com> X-Mailer: git-send-email 1.6.3.2 X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: pbonzini@redhat.com Subject: [Qemu-devel] [PATCH] work around make bug for *-user builds X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When I try to build a linux-user target, I get: Makefile:84: *** missing `endif'. Stop. As best as I can figure out, what happens is that when we call eval from set-vpath, make is checking that there are no dangling conditionals at the end of the input. But in this case make is doing the wrong thing: the input is just what gets fed to eval, not the wider Makefile from which eval was called. To restore buildability of the *-user configs, move calls to set-vpath out from under ifdefs, and conditionally provide a path for set-vpath. Signed-off-by: Nathan Froyd Acked-by: Paolo Bonzini --- Makefile.target | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile.target b/Makefile.target index 65beed5..e1c0f4a 100644 --- a/Makefile.target +++ b/Makefile.target @@ -79,9 +79,11 @@ signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS) ######################################################### # Linux user emulator target -ifdef CONFIG_LINUX_USER +# This call (sans `if') ought to be under the ifdef below, but that +# triggers bugs in make. +$(call set-vpath,$(if $CONFIG_LINUX_USER,$(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR))) -$(call set-vpath, $(SRC_PATH)/linux-user:$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)) +ifdef CONFIG_LINUX_USER QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) obj-y = main.o syscall.o strace.o mmap.o signal.o thunk.o \ @@ -111,9 +113,9 @@ endif #CONFIG_LINUX_USER ######################################################### # Darwin user emulator target -ifdef CONFIG_DARWIN_USER +$(call set-vpath,$(if $CONFIG_DARWIN_USER,$(SRC_PATH)/darwin-user)) -$(call set-vpath, $(SRC_PATH)/darwin-user) +ifdef CONFIG_DARWIN_USER QEMU_CFLAGS+=-I$(SRC_PATH)/darwin-user -I$(SRC_PATH)/darwin-user/$(TARGET_ARCH) @@ -138,9 +140,9 @@ endif #CONFIG_DARWIN_USER ######################################################### # BSD user emulator target -ifdef CONFIG_BSD_USER +$(call set-vpath,$(if $CONFIG_BSD_USER,$(SRC_PATH)/bsd-user)) -$(call set-vpath, $(SRC_PATH)/bsd-user) +ifdef CONFIG_BSD_USER QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)