Received: from eggs.gnu.org ([140.186.70.92]:40521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R18MI-0003am-Ve for qemu-devel@nongnu.org; Tue, 06 Sep 2011 22:59:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R18MG-0003Bz-Ax for qemu-devel@nongnu.org; Tue, 06 Sep 2011 22:59:26 -0400 Received: from speedy.comstyle.com ([206.51.28.2]:34088 helo=mail.comstyle.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R18MG-0003BI-82 for qemu-devel@nongnu.org; Tue, 06 Sep 2011 22:59:24 -0400 Received: from rox.home.comstyle.com (rox.home.comstyle.com [IPv6:2001:470:b01e:3:ca0a:a9ff:fe93:42c9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: brad) by mail.comstyle.com (Postfix) with ESMTPSA id 2D45198512 for ; Tue, 6 Sep 2011 22:59:18 -0400 (EDT) Date: Tue, 6 Sep 2011 22:59:16 -0400 From: Brad Message-ID: <20110907025910.GA21819@rox.home.comstyle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] Add options to disable build with debug symbols and override optimization flags. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Add --disable-debug-symbols to disable building with debug symbols and --optflags to override the optimization flags passed to the compiler. --- configure | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/configure b/configure index c3044c7..c7948b6 100755 --- a/configure +++ b/configure @@ -77,6 +77,7 @@ path_of() { # default parameters source_path=`dirname "$0"` cpu="" +optflags="-O2" interp_prefix="/usr/gnemul/qemu-%M" static="no" sparc_cpu="" @@ -136,6 +137,7 @@ kvm="no" gprof="no" debug_tcg="no" debug_mon="no" +debug_symbols="yes" debug="no" strip_opt="yes" bigendian="no" @@ -232,13 +234,11 @@ sdl_config="${SDL_CONFIG-${cross_prefix}sdl-config}" # default flags for all hosts QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" -CFLAGS="-g $CFLAGS" QEMU_CFLAGS="-Wall -Wundef -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_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/fpu" -LDFLAGS="-g $LDFLAGS" # make source path absolute source_path=`cd "$source_path"; pwd` @@ -518,6 +518,8 @@ for opt do ;; --cc=*) ;; + --optflags=*) optflags="$optarg" + ;; --host-cc=*) host_cc="$optarg" ;; --make=*) make="$optarg" @@ -588,6 +590,10 @@ for opt do ;; --disable-debug-mon) debug_mon="no" ;; + --enable-debug-symbols) debug_symbols="yes" + ;; + --disable-debug-symbols) debug_symbols="no" + ;; --enable-debug) # Enable debugging options that aren't excessively noisy debug_tcg="yes" @@ -937,6 +943,7 @@ echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" echo " --cc=CC use C compiler CC [$cc]" echo " --host-cc=CC use C compiler CC [$host_cc] for code run at" echo " build time" +echo " --optflags=FLAGS override optimization compiler flags [$optflags]" 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]" @@ -2569,8 +2576,13 @@ fi # End of CC checks # After here, no more $cc or $ld runs +if test "$debug_symbols" = "yes" ; then + CFLAGS="-g $CFLAGS" + LDFLAGS="-g $LDFLAGS" +fi + if test "$debug" = "no" ; then - CFLAGS="-O2 $CFLAGS" + CFLAGS="$optflags $CFLAGS" fi # Consult white-list to determine whether to enable werror -- 1.7.6