From patchwork Fri Dec 9 06:52:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Evans X-Patchwork-Id: 130285 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 061401007D7 for ; Fri, 9 Dec 2011 17:51:55 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751244Ab1LIGvx (ORCPT ); Fri, 9 Dec 2011 01:51:53 -0500 Received: from ozlabs.org ([203.10.76.45]:37864 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941Ab1LIGvx (ORCPT ); Fri, 9 Dec 2011 01:51:53 -0500 Received: from [10.61.2.183] (ibmaus65.lnk.telstra.net [165.228.126.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPSA id 43A031007D6; Fri, 9 Dec 2011 17:51:52 +1100 (EST) Message-ID: <4EE1B03D.9090409@ozlabs.org> Date: Fri, 09 Dec 2011 17:52:45 +1100 From: Matt Evans User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110921 Thunderbird/3.1.15 MIME-Version: 1.0 To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org CC: penberg@kernel.org, asias.hejun@gmail.com, levinsasha928@gmail.com, gorcunov@gmail.com Subject: [PATCH V2 03/23] kvm tools: Re-arrange Makefile to heed CFLAGS before checking for optional libs References: In-Reply-To: Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org The checks for optional libraries build code to perform the tests, so should respect certain CFLAGS -- in particular, -m64 so we check for 64bit libraries if they're required. Signed-off-by: Matt Evans --- tools/kvm/Makefile | 86 ++++++++++++++++++++++++++------------------------- 1 files changed, 44 insertions(+), 42 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile index f85a154..009a6ba 100644 --- a/tools/kvm/Makefile +++ b/tools/kvm/Makefile @@ -85,48 +85,6 @@ OBJS += hw/vesa.o OBJS += hw/pci-shmem.o OBJS += kvm-ipc.o -FLAGS_BFD := $(CFLAGS) -lbfd -has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD)) -ifeq ($(has_bfd),y) - CFLAGS += -DCONFIG_HAS_BFD - OBJS += symbol.o - LIBS += -lbfd -endif - -FLAGS_VNCSERVER := $(CFLAGS) -lvncserver -has_vncserver := $(call try-cc,$(SOURCE_VNCSERVER),$(FLAGS_VNCSERVER)) -ifeq ($(has_vncserver),y) - OBJS += ui/vnc.o - CFLAGS += -DCONFIG_HAS_VNCSERVER - LIBS += -lvncserver -endif - -FLAGS_SDL := $(CFLAGS) -lSDL -has_SDL := $(call try-cc,$(SOURCE_SDL),$(FLAGS_SDL)) -ifeq ($(has_SDL),y) - OBJS += ui/sdl.o - CFLAGS += -DCONFIG_HAS_SDL - LIBS += -lSDL -endif - -FLAGS_ZLIB := $(CFLAGS) -lz -has_ZLIB := $(call try-cc,$(SOURCE_ZLIB),$(FLAGS_ZLIB)) -ifeq ($(has_ZLIB),y) - CFLAGS += -DCONFIG_HAS_ZLIB - LIBS += -lz -endif - -FLAGS_AIO := $(CFLAGS) -laio -has_AIO := $(call try-cc,$(SOURCE_AIO),$(FLAGS_AIO)) -ifeq ($(has_AIO),y) - CFLAGS += -DCONFIG_HAS_AIO - LIBS += -laio -endif - -LIBS += -lrt -LIBS += -lpthread -LIBS += -lutil - # Additional ARCH settings for x86 ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ -e s/arm.*/arm/ -e s/sa110/arm/ \ @@ -172,6 +130,50 @@ else UNSUPP_ERR = endif + +FLAGS_BFD := $(CFLAGS) -lbfd +has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD)) +ifeq ($(has_bfd),y) + CFLAGS += -DCONFIG_HAS_BFD + OBJS += symbol.o + LIBS += -lbfd +endif + +FLAGS_VNCSERVER := $(CFLAGS) -lvncserver +has_vncserver := $(call try-cc,$(SOURCE_VNCSERVER),$(FLAGS_VNCSERVER)) +ifeq ($(has_vncserver),y) + OBJS += ui/vnc.o + CFLAGS += -DCONFIG_HAS_VNCSERVER + LIBS += -lvncserver +endif + +FLAGS_SDL := $(CFLAGS) -lSDL +has_SDL := $(call try-cc,$(SOURCE_SDL),$(FLAGS_SDL)) +ifeq ($(has_SDL),y) + OBJS += ui/sdl.o + CFLAGS += -DCONFIG_HAS_SDL + LIBS += -lSDL +endif + +FLAGS_ZLIB := $(CFLAGS) -lz +has_ZLIB := $(call try-cc,$(SOURCE_ZLIB),$(FLAGS_ZLIB)) +ifeq ($(has_ZLIB),y) + CFLAGS += -DCONFIG_HAS_ZLIB + LIBS += -lz +endif + +FLAGS_AIO := $(CFLAGS) -laio +has_AIO := $(call try-cc,$(SOURCE_AIO),$(FLAGS_AIO)) +ifeq ($(has_AIO),y) + CFLAGS += -DCONFIG_HAS_AIO + LIBS += -laio +endif + +LIBS += -lrt +LIBS += -lpthread +LIBS += -lutil + + DEPS := $(patsubst %.o,%.d,$(OBJS)) OBJS += $(OTHEROBJS)