From patchwork Tue Oct 12 13:00:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 67575 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 30881B70AF for ; Wed, 13 Oct 2010 00:37:15 +1100 (EST) Received: from localhost ([127.0.0.1]:38470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5f2V-0003SO-My for incoming@patchwork.ozlabs.org; Tue, 12 Oct 2010 09:37:11 -0400 Received: from [140.186.70.92] (port=41342 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5eUB-0007eq-Vh for qemu-devel@nongnu.org; Tue, 12 Oct 2010 09:01:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P5eU4-0004gK-QM for qemu-devel@nongnu.org; Tue, 12 Oct 2010 09:01:43 -0400 Received: from mail-qy0-f173.google.com ([209.85.216.173]:48077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P5eU4-0004Lx-Mv for qemu-devel@nongnu.org; Tue, 12 Oct 2010 09:01:36 -0400 Received: by mail-qy0-f173.google.com with SMTP id 36so629119qyk.4 for ; Tue, 12 Oct 2010 06:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:subject:date :message-id:x-mailer:in-reply-to:references; bh=KBM4+SC7Dc6TzEIamqgs+9j1e6LkvSqmf//fUOAKXDM=; b=Qc7QS8A85fDEt91l7Ish18SRKgj0QDnoHC6z+AEO0DTLBQFiNdcRwLtEZb6ECsMal1 3kE4pzuVTGWj7d5FyjVFD0J9e2mBB8jO2HyE5EDBPoqshVZnpdAx6AkV/Esl1+wms9ty zVau8SNftLOlzmg6zwx4XNAbDqRq0v2r7X09o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=rdc3PLPkY6+sYN0G72UlRiDbdyf5o5yHTiR78YzDnFD/Pk7nYDfuz4e/mvq25y9DA3 KCPxqGn5AMHOhMgvR19yS9C2S5reQD4kJNixsPwkaKfFX69A9YO9aRBcrwvAzXiJxayV yGJuA/BgKXTjNuW+IHn1qOkTvX15abR0MRzgE= Received: by 10.224.212.74 with SMTP id gr10mr5733819qab.339.1286888496255; Tue, 12 Oct 2010 06:01:36 -0700 (PDT) Received: from localhost.localdomain (nat-pool-brq-t.redhat.com [209.132.186.34]) by mx.google.com with ESMTPS id s34sm5931078qcp.20.2010.10.12.06.01.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 12 Oct 2010 06:01:35 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 12 Oct 2010 15:00:34 +0200 Message-Id: <1286888457-5033-17-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1286888457-5033-1-git-send-email-pbonzini@redhat.com> References: <1286888457-5033-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 16/39] introduce CFLAGS= and LDFLAGS= configure command-line options 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 Also, run checks with -O2. Some headers may provide different code based on __OPTIMIZE__, so it's good to be consistent. Signed-off-by: Paolo Bonzini --- configure | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/configure b/configure index b387994..2a2f64e 100755 --- a/configure +++ b/configure @@ -187,6 +187,10 @@ for opt do ;; --cpu=*) cpu="$optarg" ;; + CFLAGS=*) CFLAGS="$CFLAGS" + ;; + LDFLAGS=*) LDFLAGS="$LDFLAGS" + ;; --extra-cflags=*) QEMU_CFLAGS="$optarg $QEMU_CFLAGS" ;; --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" @@ -223,13 +227,17 @@ sdl_config="${cross_prefix}${SDL_CONFIG-sdl-config}" # default flags for all hosts QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" -CFLAGS="-g $CFLAGS" QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS" QEMU_CPPFLAGS="-I. -I\$(SRC_PATH)" -LDFLAGS="-g $LDFLAGS" + +if test "$debug" = "no" ; then + : ${CFLAGS='-O2 -g'} +else + : ${CFLAGS='-g'} +fi # find source path source_path=`dirname "$0"` @@ -515,9 +523,9 @@ for opt do ;; --install=*) install="$optarg" ;; - --extra-cflags=*) + CFLAGS=*|--extra-cflags=*) ;; - --extra-ldflags=*) + LDFLAGS=*|--extra-ldflags=*) ;; --cpu=*) ;; @@ -817,8 +825,6 @@ echo "Advanced options (experts only):" echo " --source-path=PATH path of source code [$source_path]" echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" echo " --cc=CC use C compiler CC [$cc]" -echo " --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS" -echo " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS" echo " --make=MAKE use specified make [$make]" echo " --install=INSTALL use specified install [$install]" echo " --static enable static build [$static]" @@ -913,6 +919,15 @@ echo " Default:trace-" echo " --disable-spice disable spice" echo " --enable-spice enable spice" echo "" +echo "Deprecated options:" +echo " --extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS" +echo " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS" +echo "" +echo "Some influential environment variables can be passed on the command line:" +echo " CFLAGS C compiler flags" +echo " LDFLAGS linker flags, e.g. -L if you have libraries in a" +echo " nonstandard directory " +echo "" echo "NOTE: The object files are built at the place where configure is launched" exit 1 fi @@ -2193,10 +2208,6 @@ fi # End of CC checks # After here, no more $cc or $ld runs -if test "$debug" = "no" ; then - CFLAGS="-O2 $CFLAGS" -fi - # Consult white-list to determine whether to enable werror # by default. Only enable by default for git builds z_version=`cut -f3 -d. $source_path/VERSION`