From patchwork Mon May 27 11:34:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 246582 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 612262C0087 for ; Mon, 27 May 2013 21:37:03 +1000 (EST) Received: from localhost ([::1]:37512 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgvjZ-0004ha-K3 for incoming@patchwork.ozlabs.org; Mon, 27 May 2013 07:37:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ugvhi-0002EV-0g for qemu-devel@nongnu.org; Mon, 27 May 2013 07:35:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ugvhg-0004tB-PW for qemu-devel@nongnu.org; Mon, 27 May 2013 07:35:05 -0400 Received: from mail-ee0-f51.google.com ([74.125.83.51]:38655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ugvhg-0004pj-Gr for qemu-devel@nongnu.org; Mon, 27 May 2013 07:35:04 -0400 Received: by mail-ee0-f51.google.com with SMTP id e51so3933822eek.10 for ; Mon, 27 May 2013 04:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=V192gYauK9RNRcJUC7JGze46m6sdu0IVyhqMKHjeD+g=; b=yExrFOii+73CeqMd6E+7vTVMrSLdawRWma2LiE4+QaCF/lTgXRc8erJ73OFV9iHmWj qobfX8f1IQQzZLh6eShki9TgA6wmQ5WX4OkTojsHMEv9ef8UyKTfhqw0WtW4PVgmWJ+H zuz/VinOH6Q6zpaZZQHzPJEoxzH+zdDTwgrhlwAD9UVm62Lh0i0Y2cQe8b1iVKgTTrQf tfcfAr++EM8qspA6Tr9SvAI/B07e0AZH8QMN2ZyQ/clpEY9BDcVV49q8OburzNDYBqa6 AGeBmV2j+LQhDAhVMuZECxkLu3oG0mcy3U3Nx7V9VSBfOlofWiCdvTS3grE1KyO4MJ/4 NSkA== X-Received: by 10.14.87.9 with SMTP id x9mr53879136eee.3.1369654503771; Mon, 27 May 2013 04:35:03 -0700 (PDT) Received: from playground.lan (net-37-117-138-128.cust.dsl.vodafone.it. [37.117.138.128]) by mx.google.com with ESMTPSA id s8sm41020634eeo.4.2013.05.27.04.35.01 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 27 May 2013 04:35:02 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 27 May 2013 13:34:50 +0200 Message-Id: <1369654491-1467-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1369654491-1467-1-git-send-email-pbonzini@redhat.com> References: <1369654491-1467-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.83.51 Cc: peter.maydell@linaro.org, afaerber@suse.de Subject: [Qemu-devel] [PATCH 3/4] main: use TARGET_ARCH only for the target-specific #define X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Everything else needs to match the executable name, which is TARGET_NAME. Before: $ sh4eb-linux-user/qemu-sh4eb --help usage: qemu-sh4 [options] program [arguments...] Linux CPU emulator (compiled for sh4 emulation) After: $ sh4eb-linux-user/qemu-sh4eb --help usage: qemu-sh4eb [options] program [arguments...] Linux CPU emulator (compiled for sh4eb emulation) Signed-off-by: Paolo Bonzini --- arch_init.c | 2 +- bsd-user/main.c | 6 +++--- configure | 25 +++++++++++++++---------- linux-user/main.c | 6 +++--- scripts/create_config | 13 ++++--------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/arch_init.c b/arch_init.c index 49c5dc2..22fbe96 100644 --- a/arch_init.c +++ b/arch_init.c @@ -123,7 +123,7 @@ static struct defconfig_file { bool userconfig; } default_config_files[] = { { CONFIG_QEMU_CONFDIR "/qemu.conf", true }, - { CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf", true }, + { CONFIG_QEMU_CONFDIR "/target-" TARGET_NAME ".conf", true }, { NULL }, /* end of list */ }; diff --git a/bsd-user/main.c b/bsd-user/main.c index 0da3ab9..572f13a 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -670,8 +670,8 @@ void cpu_loop(CPUSPARCState *env) static void usage(void) { - printf("qemu-" TARGET_ARCH " version " QEMU_VERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n" - "usage: qemu-" TARGET_ARCH " [options] program [arguments...]\n" + printf("qemu-" TARGET_NAME " version " QEMU_VERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n" + "usage: qemu-" TARGET_NAME " [options] program [arguments...]\n" "BSD CPU emulator (compiled for %s emulation)\n" "\n" "Standard options:\n" @@ -706,7 +706,7 @@ static void usage(void) "Note that if you provide several changes to single variable\n" "last change will stay in effect.\n" , - TARGET_ARCH, + TARGET_NAME, interp_prefix, x86_stack_size); exit(1); diff --git a/configure b/configure index d2c234e..bbafbac 100755 --- a/configure +++ b/configure @@ -4302,7 +4311,6 @@ upper() { echo "$@"| LC_ALL=C tr '[a-z]' '[A-Z]' } -echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak target_arch_name="`upper $TARGET_ARCH`" echo "TARGET_$target_arch_name=y" >> $config_target_mak echo "TARGET_NAME=$target_name" >> $config_target_mak diff --git a/linux-user/main.c b/linux-user/main.c index b97b8cf..21725a4 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3339,7 +3339,7 @@ static void handle_arg_strace(const char *arg) static void handle_arg_version(const char *arg) { - printf("qemu-" TARGET_ARCH " version " QEMU_VERSION QEMU_PKGVERSION + printf("qemu-" TARGET_NAME " version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); exit(0); } @@ -3400,8 +3400,8 @@ static void usage(void) int maxarglen; int maxenvlen; - printf("usage: qemu-" TARGET_ARCH " [options] program [arguments...]\n" - "Linux CPU emulator (compiled for " TARGET_ARCH " emulation)\n" + printf("usage: qemu-" TARGET_NAME " [options] program [arguments...]\n" + "Linux CPU emulator (compiled for " TARGET_NAME " emulation)\n" "\n" "Options and associated environment variables:\n" "\n"); diff --git a/scripts/create_config b/scripts/create_config index e52cca1..d776927 100755 --- a/scripts/create_config +++ b/scripts/create_config @@ -70,16 +70,10 @@ case $line in value=${line#*=} echo "#define $name $value" ;; - TARGET_ARCH=*) # configuration - target_arch=${line#*=} - echo "#define TARGET_ARCH \"$target_arch\"" - ;; TARGET_BASE_ARCH=*) # configuration target_base_arch=${line#*=} - if [ "$target_base_arch" != "$target_arch" ]; then - base_arch_name=`echo $target_base_arch | LC_ALL=C tr '[a-z]' '[A-Z]'` - echo "#define TARGET_$base_arch_name 1" - fi + base_arch_name=`echo $target_base_arch | LC_ALL=C tr '[a-z]' '[A-Z]'` + echo "#define TARGET_$base_arch_name 1" ;; TARGET_XML_FILES=*) # do nothing @@ -88,7 +82,8 @@ case $line in # do nothing ;; TARGET_NAME=*) - # do nothing + target_name=${line#*=} + echo "#define TARGET_NAME \"$target_name\"" ;; TARGET_DIRS=*) # do nothing