From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42150 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5eUi-0007vo-V6 for qemu-devel@nongnu.org; Tue, 12 Oct 2010 09:02:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P5eUb-0004zx-7f for qemu-devel@nongnu.org; Tue, 12 Oct 2010 09:02:16 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:52643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P5eUb-0004Mc-4m for qemu-devel@nongnu.org; Tue, 12 Oct 2010 09:02:09 -0400 Received: by mail-qw0-f45.google.com with SMTP id 5so1841033qwh.4 for ; Tue, 12 Oct 2010 06:02:08 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 12 Oct 2010 15:00:52 +0200 Message-Id: <1286888457-5033-35-git-send-email-pbonzini@redhat.com> In-Reply-To: <1286888457-5033-1-git-send-email-pbonzini@redhat.com> References: <1286888457-5033-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 34/39] add autoconfy --host= option deprecating --cross-prefix List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Unlike --cross-prefix, if you specify a tool by environment variables --host will not affect it. This allows SDL_CONFIG=/usr/.../bin/sdl-config ./configure --host=i686-pc-mingw32 to work. Signed-off-by: Paolo Bonzini --- configure | 41 ++++++++++++++++++++++++++++------------- 1 files changed, 28 insertions(+), 13 deletions(-) diff --git a/configure b/configure index 8ed9736..02e69fc 100755 --- a/configure +++ b/configure @@ -84,6 +84,9 @@ sysroot="/usr/gnemul/qemu-%M" static="no" sparc_cpu="" cross_prefix="" +cross_compiling="no" +default_cross_prefix="" +host="" audio_drv_list="" audio_card_list="ac97 es1370 sb16" audio_possible_cards="ac97 es1370 sb16 cs4231a adlib gus" @@ -178,7 +181,17 @@ spice="" for opt do optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` case "$opt" in - --cross-prefix=*) cross_prefix="$optarg" + --host=*) + host="$optarg" + default_cross_prefix="$host-" + cross_compiling=yes + ;; + --cross-prefix=*) + cross_prefix="$optarg" + if test -n "$cross_prefix"; then + host=`echo "$cross_prefix" | sed 's/-$//' ` + cross_compiling=yes + fi ;; CC=*|--cc=*) CC="$optarg" ;; @@ -220,15 +233,15 @@ done # Using uname is really, really broken. Once we have the right set of checks # we can eliminate it's usage altogether -cc="${cross_prefix}${CC-gcc}" -cpp="${cross_prefix}${CPP-cpp}" -ar="${cross_prefix}${AR-ar}" -objcopy="${cross_prefix}${OBJCOPY-objcopy}" -ld="${cross_prefix}${LD-ld}" -strip="${cross_prefix}${STRIP-strip}" -windres="${cross_prefix}${WINDRES-windres}" -pkg_config="${cross_prefix}${PKG_CONFIG-pkg-config}" -sdl_config="${cross_prefix}${SDL_CONFIG-sdl-config}" +cc="${cross_prefix}${CC-${default_cross_prefix}gcc}" +cpp="${cross_prefix}${CPP-${default_cross_prefix}cpp}" +ar="${cross_prefix}${AR-${default_cross_prefix}ar}" +objcopy="${cross_prefix}${OBJCOPY-${default_cross_prefix}objcopy}" +ld="${cross_prefix}${LD-${default_cross_prefix}ld}" +strip="${cross_prefix}${STRIP-${default_cross_prefix}strip}" +windres="${cross_prefix}${WINDRES-${default_cross_prefix}windres}" +pkg_config="${cross_prefix}${PKG_CONFIG-${default_cross_prefix}pkg-config}" +sdl_config="${cross_prefix}${SDL_CONFIG-${default_cross_prefix}sdl-config}" # default flags for all hosts QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS" @@ -838,7 +851,7 @@ echo " --srcdir=PATH path of source code [$srcdir]" echo " --enable-targets=LIST choose compiled targets [$target_list]" echo " --with-sysroot=PREFIX where to find shared libraries, etc." echo " use %M for cpu name [$sysroot]" -echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" +echo " --host=HOST cross-compile for host triplet HOST [$host]" echo " --enable-static enable static build [$static]" echo " --mandir=PATH install man pages in PATH" echo " --datadir=PATH install firmware in PATH" @@ -928,6 +941,7 @@ echo "Deprecated options:" echo " --interp-prefix=PREFIX where to find shared libraries, etc." echo " use %M for cpu name [$sysroot]" echo " --source-path=PATH path of source code [$srcdir]" +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" @@ -1101,7 +1115,7 @@ feature_not_found() { exit 1; } -if test -z "$cross_prefix" ; then +if test "$cross_compiling" = no; then # --- # big/little endian test @@ -1247,7 +1261,7 @@ else fi sdl=no fi -if test -n "$cross_prefix"; then +if test "$cross_compiling" = yes; then case "`basename $sdlconfig`" in pkg-config*|sdl-config) echo warning: using "\"$sdlconfig\"" to detect cross-compiled sdl >&2 @@ -2309,6 +2323,7 @@ echo "Manual directory `eval echo $mandir`" echo "Target sysroot `eval echo $sysroot`" fi echo "Source path $srcdir" +echo "Host machine $host" echo "C compiler $cc" echo "C preprocessor $cpp" echo "CFLAGS $CFLAGS" -- 1.7.2.3